Compare commits

...

6049 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy
2bb9838a80 Add test for obsolete issue
The problem was fixed in d51bb2c053

 #KT-37692 Obsolete
2020-07-08 15:30:20 +03:00
Yunir Salimzyanov
78a4563baf Update versions of database files to correctly sync muted tests
Cause: bunch files were updated to 201
2020-07-08 14:57:07 +03:00
Lilia
53b2fe9fd8 Add changelog for 1.4-M3 & 1.3.72 plugins update 2020-07-08 13:26:51 +02:00
Toshiaki Kameyama
d2deff4864 Add "Replace with 'equals(..., ignoreCase = true)'" inspection
#KT-40016 Fixed
2020-07-08 12:38:30 +02:00
Dmitriy Novozhilov
a5bfa3ae63 [FIR-TEST] Update broken testdata 2020-07-08 12:13:33 +03:00
Dmitriy Novozhilov
86791f1fef [FIR] Fix parsing fun modifier for interfaces in light-tree2fir 2020-07-08 12:13:32 +03:00
Dmitriy Novozhilov
58af8d68a1 [FIR] Check for isFun flag in SAM resolution 2020-07-08 12:13:32 +03:00
Dmitriy Novozhilov
d1cb776e29 [FIR] Assume all java interfaces are fun interfaces 2020-07-08 12:13:32 +03:00
Dmitriy Novozhilov
a3a79e4295 [FIR] Update testdata due to incorrect SAM detection 2020-07-08 12:13:32 +03:00
Dmitriy Novozhilov
29849b1330 [FIR] Resolve rhs of += in dependent context 2020-07-08 12:13:31 +03:00
Vladimir Dolzhenko
943b59b5d8 Do not provide idea.platform.prefix in run configurations for IJ Ultimate 201+ 2020-07-08 10:26:18 +02:00
Alexander Dudinsky
38535c4fe1 New type of task - TestAggregation task
You can configure smoke test suites and get critical test results faster
This doesn't replace rr/* builds, but complements them for a faster round trip.

Also test tasks and patterns were added for KMM team.
 #KMM-265
2020-07-08 11:23:03 +03:00
Sergey Rostov
ebc4910834 ScriptTemplatesClassRootsIndex: inc version and minor fixes
Content was changed, so we should force reindex.
2020-07-08 11:03:25 +03:00
Mikhail Glukhikh
4a988f467a [FIR2IR] Code cleanup: DelegatedMemberGenerator 2020-07-08 10:05:07 +03:00
Juan Chen
d163853c97 [FIR] add support for implementation by delgation
This commit handles "subclass: super-interface by delegate-expression".

During Psi2Fir, for each delegate, we add to the subclass a synthetic
field (which has type super-interface), and an assignment of the
delegate-expression to the synthetic field in the primary constructor,
so that the delegate-expression can be resolved and transformed along
the way.

During Fir2Ir, we look up delegatable members from the super-interface
and generate corresponding functions/properties for the subclass.

TODO: support for generic delegatable members and generic
super-interface.
2020-07-08 09:42:24 +03:00
Natalia Selezneva
1d45dc8d81 Optimize ScriptTemplatesFromDependenciesProvider
No needs to convert file.url to VirtualFile
because index already has getContainingFiles method
Do not iterate through all children of VirtualFile
to avoid VFS events initialisation for those files
there is no guarantee that file is under source root
so is can be not present is vfs at this moment
2020-07-07 23:26:58 +03:00
Vladimir Dolzhenko
45600830d3 Fixed locking granularity in ScriptDefinitionsManager
#KT-34552 Fixed
#KT-39547 Fixed
2020-07-07 19:15:32 +00:00
simon.ogorodnik
77ccb3767c [FIR] Add system property selector for lightTree2fir / psi2fir 2020-07-07 21:47:24 +03:00
simon.ogorodnik
a460b8f2f4 [FIR] Support source directories for lightTree2fir 2020-07-07 21:47:24 +03:00
simon.ogorodnik
6c7a40627f [FIR] Forbid constructors in processFunctionsByName 2020-07-07 21:47:24 +03:00
simon.ogorodnik
6bc654ee49 [FIR] Add full compiler pipeline modularized test
Fixup: allow kotlin package
2020-07-07 21:47:24 +03:00
simon.ogorodnik
b48dfe9b3d Allow dirs as content root in modularized tests 2020-07-07 21:47:24 +03:00
simon.ogorodnik
bf1c3777ab Add IR specific timing measurements to performance manager 2020-07-07 21:47:24 +03:00
simon.ogorodnik
0de70d295a Fix argument names 2020-07-07 21:47:23 +03:00
simon.ogorodnik
b401443dbd Compute GC metrics only during compilation 2020-07-07 21:47:23 +03:00
simon.ogorodnik
6095ec66ed Allow to pass external performance manager to compiler 2020-07-07 21:47:23 +03:00
Alexander Udalov
8c71d8f126 Undeprecate VariableDescriptorWithAccessors.isDelegated
Apparently there's quite a few valid usages of this method outside of
the compiler frontend, where manual suppression is annoying.
2020-07-07 18:09:40 +02:00
Jinseong Jeon
50b2ea7053 FIR: avoid cast exception in Candidate.prepareExpectedType 2020-07-07 16:55:53 +03:00
Nick
a5f34a880c [FIR] Fix computeTypeArguments() & add diagnostic for type args 2020-07-07 15:52:17 +03:00
Stanislav Erokhin
8772fabc4f Fix since-build version for AS 3.6 and AS 4.0 2020-07-07 15:40:02 +03:00
Nikita Bobko
50d2b963cc Revert "202: Fix GradleFacetImportTest#testJDKImport test" for 193 bunch
This fixes test in 193 and 192 bunch
2020-07-07 12:29:19 +00:00
Nikita Bobko
496b8d5bd4 Create 193 bunch for GradleFacetImportTest.kt 2020-07-07 12:29:18 +00:00
Anton Bannykh
0885d608d8 JS IR: normalize the generate file path in the box tests 2020-07-07 13:00:42 +03:00
Ilya Goncharov
bb35509c38 [Gradle, JS] Warning on missed types and typings on genext npm dep
#KT-38331 fixed
2020-07-07 12:10:13 +03:00
Ilya Goncharov
1b3b2e539c [Gradle, JS] Not run separate dukat if there is no d ts files
^KT-38331 fixed
2020-07-07 12:09:58 +03:00
Jinseong Jeon
a18bd1bb75 FIR deserializer: use annotation info from enclosing class for companion object 2020-07-07 11:43:51 +03:00
Jinseong Jeon
81345bcc26 FIR deserializer: load annotations on inner classes 2020-07-07 11:43:51 +03:00
Victor Petukhov
c588bc604d NI: do substitution stub types during updating trace for lambda (these stub types can appear from the builder inference as postponed variables)
^KT-40060 Fixed
2020-07-07 11:17:06 +03:00
Victor Petukhov
eec3a4720c NI: don't collect members if a receiver type is StubType to avoid creating error candidates instead of not crating them at all
^KT-37717 Fixed
2020-07-07 11:17:06 +03:00
Ivan Kylchik
989e4293a3 [FIR] Fix exhaustiveness check in case of sealed subclass
The problem appear because check was performed only on direct children
of sealed class. To fix this, heritage tree is built and used in check

#KT-38989 Fixed
2020-07-07 10:58:06 +03:00
Nick
40cd30f7f6 [FIR] Partial performance fix for the effective visibility checker 2020-07-07 10:24:04 +03:00
Leonid Startsev
80561ec125 Update kx.serialization dependency
so tests won't fail due to
'library was compiled with pre-release flag' error.

Update test data
2020-07-07 01:14:32 +03:00
Natalia Selezneva
74aa3ac79a Minor: replace deprecated method usage 2020-07-06 23:23:46 +03:00
Natalia Selezneva
b3a84ba081 Fix warning in ScriptConfigurationHighlightingTest
In case of exception from dependencies resolver
we do not threat the configurations as up-to-date,
so the reloading process will be started during test
despite updateScriptDependenciesSynchronously called at startup.
This will lead to the warning from checkHighlighting
because if script reports are different we rehighlight the script.
Note that test won't fail.
2020-07-06 23:23:46 +03:00
Natalia Selezneva
6ec13ab38a Scripts: do not throw roots change event in case when roots are empty 2020-07-06 23:23:46 +03:00
Natalia Selezneva
16c5ba0988 Tests: do not throw roots change event in the current thread
This may cause exception during resolve,
because all caches are invalidated after this
and resolve should be restarted
Exception: module descriptor isn't find in its own dependencies
Unmute IdeReplCompletionTestGenerated.testDefinedExtension

^KT-34825 Fixed
2020-07-06 23:23:46 +03:00
Igor Yakovlev
5871628f2b Possibly fix flacky test of light classes for decompiled declarations
Tests:
JavaAgainstKotlinBinariesCheckerTestGenerated.testInferenceReturnType_1_8JavaAgainstKotlinBinariesCheckerTestGenerated.testReturnInnerClasses
2020-07-06 22:28:45 +03:00
Roman Golyshev
637d3430ff KT-39869 Remove redundant performDelayedRefactoringRequests call
- In `ObsoleteExperimentalCoroutinesInspection` it is redundant because
it is performed immediately after the single `bindToFqName` call,
so there is no reason to postpone the refactoring and then immediately
invoke it
- In `ObsoleteKotlinJsPackagesInspection` there are no reason to call
it at all (no refactorings are postponed)
2020-07-06 18:04:02 +00:00
Roman Golyshev
5cf6b860a6 KT-39869 Add inspection for FQN usages of kotlin.browser package
- `kotlin.dom` does not need this because it contains only extensions
- Add test for launching whole project fix; mute it because currently it
does not pass
  - The test fails because in tests `RefJavaManager` tries to create
  `RefJavaFileImpl` for .kt files. It will try to use UAST, but it
  does not work for JS files. In production this is disabled, so no
  problems occur
2020-07-06 18:04:01 +00:00
Roman Golyshev
91fa5d38b3 KT-39869 Fix review suggestions
- Review: https://jetbrains.team/p/kt/review/1349
2020-07-06 18:04:00 +00:00
Roman Golyshev
75de352ce2 KT-39869 Add ObsoleteKotlinJsPackagesInspection inspection
- This inspection allows to migrate from `kotlin.dom|kotlin.browser`
to `kotlinx.dom|kotlinx.browser` packages respectively
- This inspection is available from the import statements, and also
from the `Run migrations` action
- ^KT-39869 Fixed
2020-07-06 18:04:00 +00:00
Roman Golyshev
ec087e8f3d KT-39869 Move base classes to separate file 2020-07-06 18:03:59 +00:00
Roman Golyshev
871bb30dbe KT-39869 Refactor ObsoleteExperimentalCoroutinesInspection.kt
- We need this to reuse the logic for migration inspections
2020-07-06 18:03:58 +00:00
Toshiaki Kameyama
6b5c31e2fc Move statement up: do not apply to @file annotation
#KT-10790 Fixed
2020-07-06 17:50:39 +02:00
Yaroslav Chernyshev
aeed7fe52d KT-36801 Added forgotten changes for 192 platform
#KT-39989 Fixed
2020-07-06 18:07:11 +03:00
Ivan Kylchik
574aa0affe [FIR] Fix synthetic property is not var due to Nullable on parameter
Synthetic property is var when it have setter. The latter is set up
in property when its parameter type is equal to getter return type. In
case of using @Nullable, parameter type of setter is not equal to
return type of getter, because the latter is flexible type. So to fix
this verification should occur using not null types

#KT-39076 Fixed
2020-07-06 17:52:37 +03:00
Pavel Punegov
48c5f48af0 Ignore test in Native, see #KT-38859 2020-07-06 17:33:12 +03:00
Ilya Goncharov
cb3d7349a3 [Gradle, JS] Deprecation of frontend plugin
^KT-40048 fixed
2020-07-06 17:30:31 +03:00
Natalia Selezneva
56afd763dc Minor: add debug log messages 2020-07-06 15:53:28 +03:00
Natalia Selezneva
6c0d91837c Load file attributes for last modified files under try-catch
This should avoid exceptions from initialization of GradleBuildRootsManager.EP

EA-232521 Fixed
2020-07-06 15:52:43 +03:00
Ilya Goncharov
03bc61c80a [Gradle, JS] Add test on public package json inside archives (jar and klib) 2020-07-06 15:23:33 +03:00
Ilya Goncharov
f76a1f0e86 [Gradle, JS] jsJar dependsOn PublicPackageJsonTask
But package.json included into jar only if public npm dependencies exists
2020-07-06 15:23:33 +03:00
Ilya Goncharov
5c968acb13 [Gradle, JS] Simplify creation of public package json task 2020-07-06 15:23:33 +03:00
Ilya Goncharov
a2d5cda716 [Gradle, JS] Output file of public package json as var for changing it 2020-07-06 15:23:33 +03:00
Ilya Goncharov
a4ad3d88c6 [Gradle, JS] Remove duplicate of reporting js compiler statistic 2020-07-06 15:10:16 +03:00
Vladimir Dolzhenko
974dfbc9ab Advance bootstrap to 1.4.20-dev-1680 2020-07-06 12:04:11 +02:00
Vladimir Ilmov
a2040f01bf Body elements resolution in KotlinDebuggerCache added / analyzeWithContentAndGetResult
While we trying to find an inlined SourcePosition, the body should be
resolved KotlinPositionManager.getLambdaOrFunIfInside / InlineUtil.isInlinedArgument
to make shure the lambda is an argument for a call.

 #KT-39309 fixed
 #KT-39435 fixed
2020-07-06 11:33:50 +02:00
Dmitriy Novozhilov
a0f8ada285 [FIR-TEST] Unmute failing diagnostic tests 2020-07-06 12:11:57 +03:00
Igor Yakovlev
4707f4fc3f Change signature does not make doubled refactoring for java usages
Fixed #KT-22170
2020-07-06 11:54:36 +03:00
Dmitry Gridin
7b9fad00a1 Rename KotlinLikeLangLineIndentProvider to KotlinLangLineIndentProvider
Relates to #KT-22211
2020-07-06 14:51:29 +07:00
Dmitry Petrov
b75de60afb Minor: mute failing test 2020-07-06 10:47:10 +03:00
Mikhail Zarechenskiy
d8f701ee61 Add test for obsolete issue
#KT-39588 Obsolete
2020-07-05 18:17:44 +03:00
Vladimir Dolzhenko
03d5fe8d6c Add dispatchAllInvocationEvents to editor actions in perf tests 2020-07-04 23:33:02 +02:00
Vladimir Dolzhenko
a830c69a30 Regenerate TypingIndentationTestBaseGenerated 2020-07-04 22:25:09 +02:00
Vladimir Krivosheev
75b1cf8a23 Explicitly specify id of KotlinNonJvmSourceRootConverterProvider
IDEA 2020.3 uses `id` from extension definition to avoid creating instance of converter without need.
2020-07-04 15:38:15 +02:00
Vyacheslav Karpukhin
6ecd2e57fb Created bunch 203 2020-07-04 02:11:18 +02:00
Vladimir Dolzhenko
357746e344 Do not force FULL analysis for PARTIAL_FOR_COMPLETION for the current open file
Relates to #KT-38687
2020-07-03 22:57:22 +02:00
Vladimir Dolzhenko
51375ed278 PluginStartupListener clean up
Relates to #KT-39968
2020-07-03 22:30:15 +02:00
Vladimir Dolzhenko
0b2e15d20c PluginStartupListener clean up
Relates to #KT-39968
2020-07-03 22:05:43 +02:00
Mikhail Zarechenskiy
01f2b0e26b Fix test data about JsExport
It allows only for top-level declarations, plus JsName is needed to
 avoid error about method redeclaration
2020-07-03 21:23:29 +03:00
Mikhail Zarechenskiy
9a08085146 Fix redundant semicolon inspection before soft keywords
Fixes few tests:
 - RedundantSemicolon.testBetweenSoftModifierKeywordAndDeclaration
 - RedundantSemicolon.testBetweenSoftModifierKeywordAndDeclaration2
 - RedundantSemicolon.testBetweenSoftModifierKeywordAndDeclaration3

 This bug was introduced in 741ebeb7b8
2020-07-03 21:23:29 +03:00
Mikhail Zarechenskiy
a0ecfce7b7 Update test data: add correct error 2020-07-03 21:23:29 +03:00
Nikolay Krasko
87a520fc30 202: Overcome failure in PathManager.getHomePath() because of the wrong dir
Stacktrace:

java.lang.RuntimeException: Could not find installation home path. Please reinstall the software.
  at com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:106)
  at com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:76)
  at com.intellij.openapi.application.PathManager.getPreInstalledPluginsPath(PathManager.java:248)
  at com.intellij.ide.plugins.DescriptorListLoadingContext.<init>(DescriptorListLoadingContext.java:57)
  at com.intellij.ide.plugins.DescriptorListLoadingContext.createSingleDescriptorContext(DescriptorListLoadingContext.java:61)
  at com.intellij.ide.plugins.PluginManagerCore.registerExtensionPointAndExtensions(PluginManagerCore.java:1397)
  at com.intellij.core.CoreApplicationEnvironment.registerExtensionPointAndExtensions(CoreApplicationEnvironment.java:266)
  at org.jetbrains.kotlin.cli.jvm.compiler.CoreApplicationEnvironmentCompatKt.registerExtensionPointAndExtensionsEx(coreApplicationEnvironmentCompat.kt:17)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerApplicationExtensionPointsAndExtensionsFrom(KotlinCoreEnvironment.kt:534)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createApplicationEnvironment(KotlinCoreEnvironment.kt:505)
  at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.getOrCreateApplicationEnvironmentForProduction(KotlinCoreEnvironment.kt:465)
  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:92)
  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
  at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76)
  at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45)
  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227)
  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit$default(CLITool.kt:225)
  at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:214)
  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:262)
  at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:63)
2020-07-03 21:21:23 +03:00
Dmitriy Dolovov
d63728afe5 [Commonizer] Use 'index:Int' instead of Name for addressing type parameters 2020-07-03 22:27:58 +07:00
Mikhail Zarechenskiy
0ee7306d9c Fix coercion to Unit when variable already have other constraints
Don't add `Unit` if variable has an upper constraint T <: A.

 It's impossible to coerce variable T to Unit as constraint system will
 be always contradictory: T := Unit => Unit should be subtype of A

 #KT-39900 Fixed
2020-07-03 17:54:14 +03:00
Dmitry Petrov
026f54f3d8 Fix Kapt3 tests
Nullability annotations are no longer generated on private fields,
so line numbers in generated java sources changed.
2020-07-03 17:51:30 +03:00
Dmitry Petrov
761e47264a JVM_IR: fix property reference generation for inline class primary val 2020-07-03 17:51:30 +03:00
Vladimir Dolzhenko
1450cf5f63 Fix KOTLIN_BUNDLED registration
#KT-39968 Fixed
2020-07-03 14:46:40 +00:00
Dmitry Gridin
d1455d0d22 KotlinOptimizeImportsRefactoringHelper: should remove unused directives by pointer
#KT-39899 Fixed
#EA-209827 Fixed
2020-07-03 14:29:46 +00:00
Dmitry Gridin
62e252ec26 Inline refactoring: should support set/get operator
#KT-17378 Fixed
2020-07-03 21:11:58 +07:00
Toshiaki Kameyama
e31ea0c243 ReplaceWith: suggest to replace for 'get/set' operator functions
#KT-15944 Fixed
2020-07-03 21:10:24 +07:00
Dmitriy Novozhilov
82b6ecfa64 [FIR-TEST] Add test for KT-39075 2020-07-03 17:09:29 +03:00
Dmitriy Novozhilov
59bedaaa55 [FIR] Rename FirElvisCall to FirElvisExpression
FirElvisCall is not a FirCall, so FirElvisExpression is more
  convenient name
2020-07-03 17:09:29 +03:00
Dmitriy Novozhilov
1db2ba51d2 [FIR] Don't pass flow from inplace lambdas throw when and elvis expressions
#KT-39080 Fixed
2020-07-03 17:09:29 +03:00
Dmitriy Novozhilov
1429cba2d4 [FIR] Fix CCE in postponed lambda resolution 2020-07-03 17:09:28 +03:00
Dmitriy Novozhilov
8311c1f0e2 [FIR] Fix projection of Comparable supertype for ILT
#KT-39048 Fixed
2020-07-03 17:09:28 +03:00
Dmitriy Novozhilov
a882a9dff5 [FIR] Create scope for type parameter as scope for intersection of bounds
Before change we've created composite scope for all bounds, which
  is incorrect, because intersection of all bounds may be less than
  all bounds (see test in commit)

#KT-39032 Fixed
2020-07-03 17:09:28 +03:00
Jinseong Jeon
44d0af8597 FIR2IR: handle 'this' as reference to outer object 2020-07-03 12:53:57 +03:00
Ilya Muradyan
1798542db7 Fix and enable embedded tests in scripting-ide-services 2020-07-03 12:21:45 +03:00
Ilya Muradyan
e88bef4275 Fix jar-dependent test in scripting-ide-services 2020-07-03 12:21:45 +03:00
Mikhail Zarechenskiy
d51bb2c053 Add compatibility resolve when variable has "bad" intersection type
#KT-39468 Fixed
2020-07-03 12:18:28 +03:00
Ivan Kylchik
92a51b9794 [FIR] Add illegal underscore check in BaseFirBuilder 2020-07-03 12:06:49 +03:00
Ivan Kylchik
cc4b50fdc1 [FIR] Add illegal underscore diagnostic 2020-07-03 12:06:47 +03:00
Ivan Kylchik
54945b7fbc Extract illegal underscore check function to ParseUtils 2020-07-03 12:06:45 +03:00
Ivan Kylchik
d0f6997e6d [FIR] Fix some of fir spec tests for real-literals
#KT-38336 Fixed
2020-07-03 12:06:44 +03:00
Dmitry Petrov
17c15cfe0a JVM, JVM_IR: update bytecode listing testData for inline classes 2020-07-02 22:39:06 +03:00
Dmitry Petrov
6e0bb0b468 JVM: no nullability annotations for inline class '-impl' methods
Specialized generated methods for inline classes (toString-impl,
hashCode-impl, equals-impl, etc) are inaccessible from Java, and thus
don't require nullability annotations.
2020-07-02 22:39:06 +03:00
Dmitry Petrov
ea042eb6c4 JVM_IR: no nullability annotations for inline class '-impl' methods
Specialized generated methods for inline classes (toString-impl,
hashCode-impl, equals-impl, etc) are inaccessible from Java, and thus
don't require nullability annotations.
2020-07-02 22:39:06 +03:00
Dmitry Petrov
a238d6a890 JVM_IR: no annotations on parameters of 'property$annotations' methods 2020-07-02 22:39:06 +03:00
Dmitry Petrov
8da988b18e JVM_IR: Mangle primary val getter of inline class if required
TODO fix reflection
2020-07-02 22:39:06 +03:00
Dmitry Petrov
62d2581faf JVM_IR: Don't generate annotations on generated inline class members 2020-07-02 22:39:05 +03:00
Dmitry Petrov
dc4b9d3887 JVM_IR: Don't mangle internal constructor-impl for inline classes 2020-07-02 22:39:05 +03:00
Ilya Kirillov
5cfac8fa3f FIR IDE: introduce symbol pointers for restoring symbols in another read action
fix pointer
2020-07-02 22:25:06 +03:00
Ilya Kirillov
f88ebed1a3 FIR IDE: move types to its own package 2020-07-02 22:25:06 +03:00
Ilya Kirillov
5f548fc459 FIR IDE: add creating stdlib symbols by fqName tests 2020-07-02 22:25:06 +03:00
Ilya Kirillov
799a49649c FIR IDE: introduce symbol modality 2020-07-02 22:25:06 +03:00
Ilya Kirillov
75a96f0153 FIR IDE: add info about varargs to parmater symbol 2020-07-02 22:25:05 +03:00
Ilya Kirillov
f10f6c6360 FIR IDE: introduce package symbol 2020-07-02 22:25:05 +03:00
Ilya Kirillov
18d46a86ae FIR IDE: add identity weak map based cache for KtSymbolByFirBuilder 2020-07-02 22:25:05 +03:00
Ilya Kirillov
a26063b3f8 FIR IDE: rename Invalidatable -> ValidityOwner 2020-07-02 22:25:05 +03:00
Ilya Kirillov
226d514788 FIR IDE: rename reference classes to KtFir*Reference for consistency 2020-07-02 22:25:05 +03:00
Ilya Kirillov
66933ea2fe FIR IDE: use withValidityAssertion instead of explicit check in FirAnalysisSession 2020-07-02 22:25:04 +03:00
Ilya Kirillov
8368284817 FIR IDE: introduce KtType 2020-07-02 22:25:04 +03:00
Ilya Kirillov
c44756bbfd FIR IDE: add tests for building kt symbols by PSI 2020-07-02 22:25:04 +03:00
Ilya Kirillov
8a52954bf8 FIR IDE: introduce symbol provider 2020-07-02 22:25:03 +03:00
Ilya Kirillov
20b93507ab FIR IDE: use symbols for reference resolve 2020-07-02 22:25:03 +03:00
Ilya Kirillov
749afbd141 FIR IDE: use symbols for call resolve 2020-07-02 22:25:03 +03:00
Ilya Kirillov
82866176fb FIR IDE: introduce symbol API 2020-07-02 22:25:03 +03:00
Alexander Udalov
ba948cda38 Report warning on characters which can cause problems on Windows
As soon as we fix KT-17438, this warning will be turned into an error.
2020-07-02 21:19:28 +02:00
Alexander Udalov
181965f6e8 IR: inline namedIrModulePhase and namedIrFilePhase phase builders
Construct NamedCompilerPhase directly instead. Only use phase builders
where the code becomes easier to read.
2020-07-02 21:19:28 +02:00
Alexander Udalov
15a969b3ba IR: refactor performByIrFile a little
Take a list of phases instead of the CompositePhase, to make stacktraces
nicer and avoid quadratic time of phase construction.
2020-07-02 21:19:28 +02:00
Alexander Udalov
4475325ffa IR: refactor PhaseBuilders a little
- use named classes to improve stacktraces
- reorder parameters to make the code shorter
- use explicit types to improve IDE resolve in usages
2020-07-02 21:19:27 +02:00
Alexander Udalov
7997d4afd3 IR: do not use AnyNamedPhase where there is Context parameter 2020-07-02 21:19:27 +02:00
Alexander Udalov
ef58f1e72e IR: simplify phaser code a little
- merge NamedCompilerPhase, SameTypeNamedPhaseWrapper,
  AbstractNamedPhaseWrapper and inherit it from SameTypeCompilerPhase
- inline some functions to simplify stacktraces
- reformat and fix inspections
2020-07-02 21:19:27 +02:00
Stanislav Erokhin
74ce26cdc2 Fix 1.4-M2 ChangeLog.md 2020-07-02 22:16:59 +03:00
Vyacheslav Gerasimov
18d71c7907 Build: Encode build number in teamcity build url 2020-07-02 22:05:35 +03:00
Vyacheslav Gerasimov
8e1269cc32 Build: Add hacky workaround for retrying PublishToMavenRepository tasks
It's supposed to help with `Caused by: org.apache.http.NoHttpResponseException: api.bintray.com:443 failed to respond`
2020-07-02 22:05:35 +03:00
Dmitriy Dolovov
3bb234b17c [Commonizer] Clean-up CirTypeSignature usages 2020-07-03 00:22:44 +07:00
Dmitriy Dolovov
ffd0c69698 [Commonizer] Use ClassId instead of FqName for addressing classes and TAs 2020-07-03 00:22:38 +07:00
Ilya Kirillov
57aefbcd57 FIR IDE: migrate to 201 2020-07-02 19:34:37 +03:00
Mads Ager
1124887aa0 [JVM_IR] Fix stepping behavior for assignments to local variables. 2020-07-02 17:29:07 +02:00
Vladimir Dolzhenko
543efffa5c Turn off stability check for PerformanceTypingIndentationTest 2020-07-02 17:13:10 +02:00
Igor Yakovlev
89d5c030dc Improve incremental analisys for nested blocks 2020-07-02 17:52:40 +03:00
Toshiaki Kameyama
efdeb7b449 Introduce "Add '== true'" quick fix for TYPE_MISMATCH
#KT-39930 Fixed
2020-07-02 19:31:43 +07:00
Dmitriy Novozhilov
5bf18c09bb Advance bootstrap to 1.4.20-dev-1530 2020-07-02 15:19:24 +03:00
Natalia Selezneva
a73dac75d4 Optimize KotlinScriptDependenciesClassFinder
Do not call processDirectories for all package prefixes checking inner classes

^KT-39796 Fixed
2020-07-02 15:14:02 +03:00
Mikhail Glukhikh
f46970219f [FIR2IR] Simplify elvis conversion 2020-07-02 15:10:52 +03:00
Mikhail Glukhikh
68b84722c4 [FIR2IR] Simplify generateWhen 2020-07-02 15:10:52 +03:00
Mikhail Glukhikh
24c8eb43a2 [FIR2IR] Don't build stub FirWhen for converting elvis expression 2020-07-02 15:10:52 +03:00
Mikhail Glukhikh
6229d2e215 [FIR2IR] Extract generateWhen & toIrWhenBranch 2020-07-02 15:10:52 +03:00
Mikhail Glukhikh
31765a4abc [FIR2IR] Move visitElvis & visitWhen close to one another 2020-07-02 15:10:52 +03:00
Dmitriy Novozhilov
f4d5070a7b [FIR-TEST] Mute BB test due to KT-39659 2020-07-02 15:10:52 +03:00
Dmitriy Novozhilov
a7ed9c7dc5 [FIR] Add conversion of FirElvisCall to backend IR 2020-07-02 15:10:52 +03:00
Dmitriy Novozhilov
102c9c08d0 [FIR] Resolve elvis call as special synthetic call
Before that commit we desugared `a ?: b` as

when (val elvis = a) {
    null -> b
    else -> elvis
}

It was incorrect, because `a` should be resolved in dependent mode,
  but when it was `elvis` initializer it was resolved in independent
  mode, so we can't infer type for `a` in some complex cases
2020-07-02 15:10:51 +03:00
Dmitriy Novozhilov
b49b3245af [FIR] Add special node for elvis call
#KT-39074
2020-07-02 15:10:51 +03:00
Dmitriy Novozhilov
648953085f [FIR] Replace kotlin/Throwable with java/lang/Throwable in JvmMappedScope
#KT-39044 Fixed
2020-07-02 15:10:51 +03:00
Dmitriy Novozhilov
624b9306f0 [FIR] Resolve LHS of type operator call in independent context
#KT-39046 Fixed
2020-07-02 15:10:51 +03:00
Jinseong Jeon
c9e423bf64 FIR deserializer: fix parameter shift for constructor of inner classes and enums
#KT-39837 Fixed
2020-07-02 13:34:39 +03:00
Georgy Bronnikov
8e24256f95 JVM_IR: avoid descriptors when tracking inline properties
Preparing to use wrapped properties in InlineCodegen.
2020-07-02 12:46:58 +03:00
Georgy Bronnikov
385d522d27 JVM_IR: do not use descriptor in isCompiledToJvmDefault 2020-07-02 12:45:26 +03:00
Vsevolod Tolstopyatov
3270c7e016 Introduce CancellationException
#KT-39126 Fixed
2020-07-02 11:01:28 +03:00
Natalia Selezneva
5ec110c33f *.gradle.kts: catch exceptions during GradleBuildRootManager initialization
^KT-39317 Fixed
2020-07-02 08:48:05 +03:00
Natalia Selezneva
c7c7ffb0e0 *.gradle.kts: get java home from build environment instead of execution settings
Note that getting GradleExecutionSettings may lead to write action
because it link javaHome with existing sdks

^KT-39317
2020-07-02 08:48:05 +03:00
Steven Schäfer
5cdf053c8e Coroutines: Fix RedundantLocalsEliminationMethodTransformer
- Take control flow into account when collecting usage information
- Don't remove stores to local variables
2020-07-02 00:49:28 +02:00
Alexander Gorshenev
3113281e2d Adapted fake override checker to inheritance from friend module internal interfaces 2020-07-01 20:29:48 +03:00
Mikhail Glukhikh
07feb2185b Fix exception in FirExposedVisibilityChecker 2020-07-01 19:30:50 +03:00
Ilmir Usmanov
697c8637ee For all int-like typed variables, use int as field type and coerce
it during spill-unspill.
Coerce int to boolean, otherwise, VerifyError is thrown on android
Completely rewrite SpilledVariableFieldTypesAnalysis... again,
but this time use BasicInterpreter
This way, the analysis both does not use SourceInterpreter and
is in line with the rest on analyses.
2020-07-01 17:26:47 +02:00
Alexander Udalov
e7f33ac051 IR: do not inherit IrFunctionReference from IrFunctionAccessExpression
To avoid the diamond hierarchy and to allow refactoring the IR element
hierarchy from interfaces to classes, improving performance of visitors
and transformers.
2020-07-01 13:03:56 +02:00
Alexander Udalov
d4605f5816 IR: add type parameter to IrMemberAccessExpression and some subclasses
This is needed to get rid of the diamond hierarchy:

                 IrMemberAccessExpression
                 /                       \
                /                         \
IrFunctionAccessExpression     IrCallableReference
                \                      /
                 \                    /
                   IrFunctionReference

In the subsequent commit, IrFunctionReference no longer inherits from
IrFunctionAccessExpression; the more precise type of `val symbol:
IrFunctionSymbol` is now carried via the generic type argument.

This will help to refactor IR element hierarchy from interfaces to
classes, improving performance of visitors and transformers.
2020-07-01 13:03:56 +02:00
Alexander Udalov
d794c9dc4d IR: remove non-supertype usages of abstract impl classes
Work with the corresponding base interfaces instead. This change will
help in moving the IR element hierarchy from interfaces to classes,
should the need arise.

There's a possible change in behavior in
`CallAndReferenceGenerator.applyCallArguments`, which however doesn't
seem to break anything: IrPropertyReferenceImpl can now also be handled
by this method.
2020-07-01 13:03:56 +02:00
Alexander Udalov
ccac23f5b2 IR: make mapOptimized non-inline, rename to transformIfNeeded
This seems to have no effect on performance, however it clearly shows
that this method is a hotspot now with regard to own CPU samples.
Furthermore, it somewhat decreases the bytecode size at call sites and
might actually allow the HotSpot to inline those methods earlier and
hopefully deoptimize less frequently.
2020-07-01 13:03:56 +02:00
Alexander Udalov
6a699c9384 IR: minor, remove accept from some interfaces 2020-07-01 13:03:56 +02:00
Jinseong Jeon
1e3019798a FIR2IR: discard fake overrides for property accessors according to base visibility 2020-07-01 13:59:42 +03:00
Nikita Bobko
6985c5fd2a 202: Fix KotlinJpsBuildTest tests
Test failure was caused by "replace custom source root types to a special
'unknown' type and back on plugin unload/load (IDEA-235292)" in intellij.

We override `getModuleSourceRootPropertiesSerializers` in `KotlinModelSerializerService`
by inheriting from `KotlinCommonJpsModelSerializerExtension`
2020-07-01 11:31:23 +03:00
Nikita Bobko
4e65b2fb9e Refactoring: mark const strings with const keyword 2020-07-01 11:31:23 +03:00
Nikita Bobko
31e45d4f4c 202: Fix some ParameterInfoTestGenerated
Speaking strictly:
* `ParameterInfoTestGenerated$WithLib1.testUseJavaFromLib`
* `ParameterInfoTestGenerated$WithLib2.testUseJavaSAMFromLib`
* `ParameterInfoTestGenerated$WithLib3.testUseJavaSAMFromLib`
2020-07-01 11:31:23 +03:00
Nikita Bobko
cbc57351f5 202: Fix SlicerLeafGroupingTestGenerated tests 2020-07-01 11:31:22 +03:00
Nikolay Krasko
0d71b7ac2c 202: Add fastutil jar to tests dependencies 2020-07-01 11:31:22 +03:00
Nikolay Krasko
ca7169b84f 202: Disable ignored plugins check in compiler environment
Stacktrace:

java.lang.NullPointerException
  	at java.io.Reader.<init>(Reader.java:78)
  	at java.io.InputStreamReader.<init>(InputStreamReader.java:113)
  	at com.intellij.ide.plugins.PluginManagerCore.getBrokenPluginVersions(PluginManagerCore.java:207)
  	at com.intellij.ide.plugins.PluginManagerCore.createLoadingResult(PluginManagerCore.java:825)
  	at com.intellij.ide.plugins.DescriptorListLoadingContext.createSingleDescriptorContext(DescriptorListLoadingContext.java:61)
  	at com.intellij.ide.plugins.PluginManagerCore.registerExtensionPointAndExtensions(PluginManagerCore.java:1397)
  	at com.intellij.core.CoreApplicationEnvironment.registerExtensionPointAndExtensions(CoreApplicationEnvironment.java:266)
  	at org.jetbrains.kotlin.cli.jvm.compiler.CoreApplicationEnvironmentCompatKt.registerExtensionPointAndExtensionsEx(coreApplicationEnvironmentCompat.kt:17)
  	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerApplicationExtensionPointsAndExtensionsFrom(KotlinCoreEnvironment.kt:534)
  	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createApplicationEnvironment(KotlinCoreEnvironment.kt:505)
  	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.getOrCreateApplicationEnvironmentForProduction(KotlinCoreEnvironment.kt:465)
  	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:92)
  	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
  	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
  	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
  	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
  	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76)
  	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45)
  	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227)
  	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit$default(CLITool.kt:225)
  	at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:214)
  	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:262)
  	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
2020-07-01 11:31:22 +03:00
Nikita Bobko
ef562598ea 202: Fix MultiFileJvmBasicCompletionTestGenerated
It was broken by 4bef803e1b5994e9ea9731acfb5095a94b1b1383 in intellij
2020-07-01 11:31:21 +03:00
Nikita Bobko
3187bb2aa4 202: Fix KotlinMavenImporterTest#testJDKImport test
Test failure was caused by 8e1ab882641db695e3b70085d14a59e1e8e9f579 +
b79ca6e3a855b9d74dba129583d7ed25ecd2f552 in intellij
2020-07-01 11:31:21 +03:00
Nikita Bobko
5c95c48c90 202: Fix GradleFacetImportTest#testJDKImport test
Test failure was caused by 8e1ab882641db695e3b70085d14a59e1e8e9f579 +
b79ca6e3a855b9d74dba129583d7ed25ecd2f552 in intellij
2020-07-01 11:31:21 +03:00
Nikita Bobko
536c4bbab1 202: Fix KotlinEvaluateExpressionTestGenerated.SingleBreakpoint
Now `getTreeEvaluation` returns `CompletableFuture<PsiElement>` not `PsiElement` as it was in 201
2020-07-01 11:31:20 +03:00
Nikita Bobko
046030e301 202: Fix "Module 'foo': No SDK defined" in tests
Fixes several tests in 202:
* NewMultiplatformProjectImportingTest
* KaptImportingTest
* ...

This failure was caused by b79ca6e3a855b9d74dba129583d7ed25ecd2f552 in intellij
2020-07-01 11:31:20 +03:00
Nikita Bobko
8fb82c2cb7 202: Fix missing formatting in nJ2K tests
Formatting in nJ2K tests (actually it still works in IDE) was broken by
dee00ac38946b8a8a5165dffd083e67c85935723 in intellij
2020-07-01 11:31:20 +03:00
Nikita Bobko
264094861d 202: Fix null passed to @NotNull in PomModelImpl
Fixes `AdditionalResolveDescriptorRendererTestGenerated#testAnonymousObjectInClassParameterInitializer`
and others
2020-07-01 11:31:19 +03:00
Vladimir Dolzhenko
853503d75f Force perform FULL analysis to avoid redundant analysis for the current open file
#KT-38687 Fixed
2020-07-01 08:22:58 +00:00
Sergey Rostov
1a82c94979 revert accidentally committed project.xml 2020-07-01 10:36:40 +03:00
Mikhail Zarechenskiy
d9fc71b8c0 Advance bootstrap to 1.4.20-dev-1515 2020-07-01 10:11:13 +03:00
Denis Zharkov
3ce980fd88 Fix incremental compilation for calls to inner classes from supertypes
The problem became actual after 8c2baf0704
2020-07-01 06:55:52 +03:00
Mikhail Zarechenskiy
6b81cc8b77 Update test data as stdlib now isn't pre-release 2020-06-30 22:59:23 +03:00
Mikhail Zarechenskiy
94dcff5bab Advance bootstrap to 1.4.20-dev-1508 2020-06-30 21:48:30 +03:00
Mikhail Zarechenskiy
f37f89a151 Set KotlinCompilerVersion.IS_PRE_RELEASE = false
Since master is 1.4.20 now and branch 1.4.0 is 1.4-RC

 #KT-39860 Fixed
2020-06-30 21:01:45 +03:00
Mikhail Bogdanov
b5b5c8aebc Check target for -Xjvm-default modes
#KT-39925 Fixed
2020-06-30 19:47:06 +02:00
Dmitriy Dolovov
3e42b9d527 [Commonizer] Remove unused property from CirFunction 2020-07-01 00:12:03 +07:00
Nikolay Krasko
21fa2bf98c Switch to 201 platform 2020-06-30 19:53:18 +03:00
Nikolay Krasko
50863b6985 Fix using swing ComboBox and wrong bunching 2020-06-30 19:53:17 +03:00
Nikolay Krasko
2c1b01fcf6 Setup standalone environment in BuiltInsSerializer
Main change is in calling setupIdeaStandaloneExecution()
2020-06-30 19:53:17 +03:00
Nikolay Krasko
3b2e1cfa39 Show TeamCity user for agent builds 2020-06-30 19:53:17 +03:00
Dmitry Gridin
86fe10ba44 AddDefaultConstructorFix: fix testData
#KT-20718
2020-06-30 23:22:08 +07:00
Toshiaki Kameyama
7be5410877 Add a quick fix for NO_CONSTRUCTOR error on 'expect' annotation entry
#KT-20718 Fixed
2020-06-30 23:22:08 +07:00
Mikhail Glukhikh
d846a22e33 [FIR] Introduce & use FirTypeRef.coneType 2020-06-30 18:49:06 +03:00
Toshiaki Kameyama
0392fe75fc Convert to block body: specify non-nullable type when body expression is platform type and overriden method is non-nullable type
#KT-12222 Fixed
2020-06-30 22:47:13 +07:00
Dmitry Petrov
d37b616e1f JVM_IR: Fix enum classes ABI
1. Enum entry fields don't have nullability annotations.

2. Enum class special methods (values, valueOf) are not 'final'
(although they probably should be, javac generates corresponding
methods without ACC_FINAL flag).

3. Enum class special methods don't have nullability annotations.

4. Don't generate synthetic accessor for enum entry class constructor.

KT-37019 KT-37020 KT-37021
2020-06-30 18:24:25 +03:00
Stanislav Erokhin
f753824429 Advance bootstrap version to 1.4.20-dev-1401 2020-06-30 17:56:11 +03:00
Ilmir Usmanov
7536da788c Minor. Update test 2020-06-30 16:54:36 +02:00
Jinseong Jeon
34174d6e7d FIR deserializer: load annotations for property and fields, along with use-site targets 2020-06-30 17:28:22 +03:00
Mikhail Bogdanov
3580c7c28c Write proto flag about compatibility mode
There is no any special aim for this flag now.
  But it could be useful in future in case of compatibility mode deprecation
2020-06-30 14:59:01 +02:00
Vladimir Dolzhenko
f372a0fe6c Force full analysis even if incremental analysis is available but existed is erroneous 2020-06-30 12:53:34 +00:00
Konstantin Tskhovrebov
343e645282 Rename and refactor kmm plugin packages, task names, ids and etc. 2020-06-30 15:28:39 +03:00
Vladimir Dolzhenko
48a9226e1c Fix copy-paste from KTS files
#KT-37517 Fixed
2020-06-30 12:24:31 +00:00
Toshiaki Kameyama
0a230905ae Remove redundant spread operator: don't report if overloaded functions cannot be resolved
#KT-38282 Fixed
2020-06-30 19:16:22 +07:00
Ilya Kirillov
f179b39c70 Wizard: fix project template list size 2020-06-30 15:10:55 +03:00
Aleksei Cherepanov
b9b068ff63 Fix FirMultiModuleResolveTestGenerated tests 2020-06-30 14:16:52 +03:00
Sergey Igushkin
8ba131290a Fixup for 1f5fa5eb7 – adjust error message 2020-06-30 13:14:03 +03:00
Sergey Igushkin
1f5fa5eb7c Add back empty stub implementations of KotlinGradleSubplugin (KT-39809)
* If a KotlinGradleSubplugin implements
 KotlinCompilerPluginSupportPlugin, don't apply it as a legacy plugin

* Add the legacy KotlinGradleSubplugin implementations back so that
 when there's JAR hell with META-INF/services in the old artifacts
 pointing to the classes, loading the plugins with ServiceLoader (legacy
 implementation) from the new artifacts would not fail.

* There's a corner case for plugins not in kotlin-gradle-plugin
 If a newer and older version of such a subplugin is used with an older
 version of the Kotlin Gradle plugin, the latter will find the META-INF
 entries and will try to load the subplugins from the new version. With
 the original fix for KT-39809, this would result in silently ignored
 empty stub implementations.

 Given that the Kotlin Gradle plugin can now check if a subplugin
 supports the new API, it's OK to keep the old entries and make the
 stub implementations throw a build error when called, so that improper
 plugin versions are not ignored and are clearly reported.

 Note that this is only necessary for the subplugins not bundled in the
 kotlin-gradle-plugin module, as those will always be in sync with the
 Kotlin version.

Issue #KT-39809 Fixed
2020-06-30 12:51:51 +03:00
Sergey Igushkin
cb936dd82e Fix internals with symlinked friend paths (KT-35341)
The friend paths converted to canonical paths didn't match absolute
paths in the compiler code in case of symlinked directories.

This fixes a regression.

Issue #KT-35341 Fixed
2020-06-30 12:51:50 +03:00
kvirolainen
5b1d019bb0 Added Incomplete destructuring inspection
#KT-21223 Fixed
2020-06-30 11:47:27 +02:00
Sergey Igushkin
e6bca819d4 Remove kotlin.native.linkFromSources, expose tasks' sources
* Drop the deprecated mode in the Kotlin/Native link
tasks using sources rather than the intermediate
compiled klib.

* Remove the `allSources` and `commonSources`
properties from the KotlinNativeCompilation, use the
tasks' properties instead.
2020-06-30 12:27:14 +03:00
Mads Ager
c3b5b21845 [JVM] Extend stepping tests with <clinit> stepping.
In addition, made the stepping information for constructor calls
consistent across JVM_IR and JVM. For JVM_IR that stepping behavior
is consistent for enum constructor calls in <clinit> for JVM it
is not.
2020-06-30 11:18:29 +02:00
Ilya Kirillov
2693664aa7 FIR IDE: unmute tests after introducing fake element kinds 2020-06-30 11:55:59 +03:00
Ilya Kirillov
9baced20c4 FIR IDE: find FIR element by PSI one only if FIR have a real source
Also, add a check that there is only one element with the same real source
2020-06-30 11:55:58 +03:00
Ilya Kirillov
5acdad29ec FIR: change source of existing type refs in DataClassMembersGenerator to avoid sources clash 2020-06-30 11:55:57 +03:00
Ilya Kirillov
650f2dd713 FIR: consider source of FirSingleExpressionBlock as a fake one 2020-06-30 11:55:56 +03:00
Ilya Kirillov
1c564e1bd6 FIR: add ImplicitTypeRef to the control flow fir element sources 2020-06-30 11:55:56 +03:00
Ilya Kirillov
94967bcd00 FIR: introduce element kind for source elements
It is needed for FIR IDE to determine if FIR element was built by PSI
or it is generated one
2020-06-30 11:55:53 +03:00
Dmitriy Novozhilov
f6e653b242 [FIR] Fix compilation broken in 309050d9 2020-06-30 11:43:46 +03:00
Dmitriy Novozhilov
309050d956 [FIR] Add ExtensionFunctionType attribute
#KT-39034 Fixed
2020-06-30 11:30:19 +03:00
Dmitriy Novozhilov
1d3c0f56a9 [FIR] Save type attributes in substitution 2020-06-30 11:30:19 +03:00
Dmitriy Novozhilov
25fd5cd4ac [FIR] Save type attributes in ConeKotlinType.withNullability 2020-06-30 11:30:19 +03:00
Dmitriy Novozhilov
840d3975cc [FIR] Add computing type attributes for deserialized types 2020-06-30 11:30:19 +03:00
Dmitriy Novozhilov
cfa250957a [FIR] Fix creating type attributes for intersection types 2020-06-30 11:30:18 +03:00
Jinseong Jeon
fab9ee47f9 FIR deserializer: proper annotation loading for value parameter of property setter 2020-06-30 11:01:03 +03:00
Toshiaki Kameyama
9308525d93 Add receiver of kotlin.text.toPattern to standard Kotlin injections
#KT-39231 Fixed
2020-06-30 14:26:37 +07:00
Vyacheslav Karpukhin
787d22c93e Created bunch 203 2020-06-30 03:41:51 +02:00
Egor Zhdan
09a111239e Stabilize ProjectTaskRunner registration order 2020-06-29 23:11:54 +02:00
Vyacheslav Karpukhin
866e5397d9 New ultimate modules 2020-06-29 23:11:54 +02:00
Ilmir Usmanov
ed80b431f0 Restore refined int-type analysis 2020-06-29 21:42:30 +02:00
Alexander Gorshenev
8920e68584 Muted .IncrementalJsKlibCompilerRunnerTestGenerated.ClassHierarchyAffected.testMethodRemoved
until we have full fledged fake override support in klib
2020-06-29 21:58:32 +03:00
Alexander Gorshenev
41a472693a Updated extraHelp test data for the new flags 2020-06-29 21:58:32 +03:00
Alexander Gorshenev
bf419bc243 Compute correct signature for fake override properties with type parameters 2020-06-29 21:58:32 +03:00
Alexander Gorshenev
d90c383287 Fine tuned fake override validator for internals 2020-06-29 21:58:32 +03:00
Alexander Gorshenev
e08b800eb9 Treat internals as publics for fake override construction 2020-06-29 21:58:31 +03:00
Alexander Gorshenev
e61960f333 Fake override construction fallback mode 2020-06-29 21:58:31 +03:00
Alexander Gorshenev
de79e3bec3 Added -Xdisable-fake-override-validator 2020-06-29 21:58:31 +03:00
Ilmir Usmanov
f127a0f593 Add flag to disable new spilled variable type analysis 2020-06-29 20:50:43 +02:00
Mikhail Zarechenskiy
d7df6e1e0c Avoid references to DeprecatedSinceKotlin to fix JPS build 2020-06-29 21:49:01 +03:00
Ilmir Usmanov
28e6028af4 Minor. Add test 2020-06-29 20:13:40 +02:00
Ilmir Usmanov
da12532669 Ignore fake inliner variables in merge operation
since they are not read and just markers.
 #KT-39863 Fixed
2020-06-29 20:13:37 +02:00
Mikhail Zarechenskiy
b0b8d40b71 Update ApiTest.testIrStdlib for JS, an addition to 9be8c5b5 2020-06-29 21:09:19 +03:00
Dmitry Petrov
e4198466b8 JVM_IR: No nullability annotations on static lambda instances 2020-06-29 19:32:03 +03:00
Dmitry Petrov
eefa621c56 JVM_IR KT-37006: InlineOnly property accessors are private in bytecode 2020-06-29 19:08:58 +03:00
Alexander Udalov
b94a4d9fc3 Render more information on inner classes in bytecode listing tests 2020-06-29 17:33:39 +02:00
Vyacheslav Gerasimov
4bb670e667 Build: Use project kotlin-reflect in fir tree generator
To avoid unstable dependency substitution depending on local version
2020-06-29 18:17:09 +03:00
Vyacheslav Gerasimov
1ef68dfffd Build: Fix kotlin-test-js-ir:commonMainSources to copy only sources
Copying previous build result with sources leads to unstable task inputs
2020-06-29 18:17:08 +03:00
Vyacheslav Gerasimov
5198020c29 Build: Fix kotlin-stdlib related errors during jps build import 2020-06-29 18:17:08 +03:00
Vyacheslav Gerasimov
63b7350046 Build: Use sources from kotlin mpp source set in sourcesJar helper 2020-06-29 18:17:08 +03:00
Vyacheslav Gerasimov
77a8cf4e66 Build: Use attributes to resolve test dependencies in jps build mode 2020-06-29 18:17:08 +03:00
Igor Yakovlev
a32f901ab9 Make property initializer modification is OutOfBlock change
Fixed #KT-38762
2020-06-29 18:05:05 +03:00
Mikhail Zarechenskiy
507a718632 Update tests for completion after adding DeprecatedSinceKotlin 2020-06-29 17:41:05 +03:00
Mikhail Zarechenskiy
87014f816c Update ApiTest.testStdlib for JS, an addition to 9be8c5b5 2020-06-29 17:04:42 +03:00
Mikhail Glukhikh
d798071e06 IrConstTransformer: drop unnecessary argument existence check 2020-06-29 16:31:24 +03:00
Jinseong Jeon
c3fc524c0d FIR: handle named arguments in annotations properly 2020-06-29 16:23:03 +03:00
Mikhail Glukhikh
4f36697737 [FIR2IR] Mute 2 BB tests failing due to signature clashing 2020-06-29 16:08:26 +03:00
Mikhail Glukhikh
6cb3687d5d [FIR2IR] Replace 'throw AssertionError()' with error() / assert() {...} 2020-06-29 16:08:15 +03:00
Mikhail Glukhikh
69ec8f2d89 [FIR2IR] Allow to get cached symbols in fake override generator 2020-06-29 16:08:14 +03:00
Mikhail Glukhikh
c4d41f48a3 [IR] Allow Fir2Ir symbols in function factory 2020-06-29 16:08:12 +03:00
Mikhail Glukhikh
a6234eb261 [FIR2IR] Don't compose signatures for private declarations 2020-06-29 16:08:11 +03:00
Mikhail Glukhikh
19d115778b [IR] Allow fast reference path in SymbolTable for wrapped descriptors 2020-06-29 16:08:10 +03:00
Mikhail Glukhikh
90f9b9c1c9 [FIR2IR] Unmute 6 fixed BB tests 2020-06-29 16:08:09 +03:00
Mikhail Glukhikh
2d5e6bb90b [FIR2IR] Introduce lazy properties 2020-06-29 16:08:08 +03:00
Mikhail Glukhikh
efd614194b [FIR2IR] Make Fir2IrBindableSymbol public API 2020-06-29 16:08:06 +03:00
Mikhail Glukhikh
ca5e560f1f [FIR2IR] Introduce lazy constructors 2020-06-29 16:08:05 +03:00
Mikhail Glukhikh
fcabd02fe8 [FIR] Take class expect flag into account in its substitution scope 2020-06-29 16:08:00 +03:00
Mikhail Glukhikh
c1609ed490 [FIR] Make expect class members also expect 2020-06-29 16:07:50 +03:00
Mikhail Glukhikh
2fefa682b7 [FIR2IR] Do not compose signature for local class members 2020-06-29 16:07:49 +03:00
Mikhail Glukhikh
9a0e763761 [FIR2IR] Require classId from parent class for fake overrides 2020-06-29 16:07:48 +03:00
Mikhail Glukhikh
34a2196295 FirClassSubstitutionScope: extract SubstitutedData & reorder functions 2020-06-29 16:07:43 +03:00
Mikhail Glukhikh
bf009a4949 [FIR2IR] Handle delegating constructor call type arguments properly 2020-06-29 16:07:30 +03:00
Mikhail Glukhikh
2cffbadbd5 [FIR2IR] Use overridden symbol when handling delegating constructor call 2020-06-29 16:07:29 +03:00
Mikhail Glukhikh
456508a332 IR SymbolTable: don't allow unbound symbols in declare by signature only 2020-06-29 16:07:27 +03:00
Mikhail Glukhikh
7243d04f58 [FIR2IR] Simplification of property building in lazy class 2020-06-29 16:07:26 +03:00
Mikhail Glukhikh
a8db7b3ba6 [FIR2IR] Simplification of function building in lazy class 2020-06-29 16:07:25 +03:00
Mikhail Glukhikh
f7be373711 Add extra parent checks in Fir2IrLazyClass 2020-06-29 16:07:24 +03:00
Ivan Kylchik
13f7b6a22e Create separate constructor for ir interpreter with only ir builtins
By introducing this constructor, ir interpreter will no longer find ir
exceptions in module and so interpreter is creating faster for fir2ir
goals
2020-06-29 15:27:26 +03:00
Ivan Kylchik
de2b20482a Allow IrConstTransformer to visit and evaluate vararg elements 2020-06-29 15:27:25 +03:00
Ivan Kylchik
6fa03297f9 Allow IrConstTransformer to visit annotations of all declarations 2020-06-29 15:27:25 +03:00
Ivan Kylchik
c87b12ec2f Speed up fir2ir constant evaluation
This fix extract IrConstTransformer object to a common variable and all
files then use it
2020-06-29 15:27:24 +03:00
Mikhail Zarechenskiy
032fdd63d9 Ignore codegen test for Android
There is no such method as java.util.List.stream
2020-06-29 15:26:20 +03:00
Leonid Startsev
6ea0c37e52 Update test data with new package name after 901d8f3e7a 2020-06-29 15:09:30 +03:00
Mikhail Zarechenskiy
6efa7a51c6 Fix priority for "add import" action wrt DeprecatedSinceKotlin 2020-06-29 14:25:09 +03:00
Mikhail Zarechenskiy
beca7fca30 Fix completion order & presentation wrt to DeprecatedSinceKotlin 2020-06-29 14:25:09 +03:00
Mikhail Zarechenskiy
bcaa635a4e Fix parameter info presentation with regard to DeprecatedSinceKotlin 2020-06-29 14:25:09 +03:00
Mikhail Zarechenskiy
9be8c5b527 Update test data about built-ins 2020-06-29 14:25:09 +03:00
Mikhail Zarechenskiy
b7df9ec05a Implement equals/hashCode as this class previously was a data one
Fixes duplicated diagnostics in tests
2020-06-29 14:25:08 +03:00
Mikhail Zarechenskiy
a2da00eb49 Prohibit using DeprecatedSinceKotlin outside kotlin subpackage 2020-06-29 14:25:08 +03:00
Mikhail Zarechenskiy
790433984b Prohibit using DeprecatedSinceKotlin annotation without arguments 2020-06-29 14:25:08 +03:00
Mikhail Zarechenskiy
67100d5ebe Reject values of DeprecatedSince.. that are not parseable as a version 2020-06-29 14:25:07 +03:00
Mikhail Zarechenskiy
5d88058928 Place DeprecatedSinceKotlin annotation under 1.4 version 2020-06-29 14:25:06 +03:00
Mikhail Zarechenskiy
2f55a3fa0d Add various test for DeprecatedSinceKotlin annotation 2020-06-29 14:23:26 +03:00
Mikhail Zarechenskiy
0f2c96c64d Don't perform additional lookups for DeprecatedSinceKotlin annotation
There is no need to check it as `DeprecatedSinceKotlin` can be used
 only along with `Deprecated` annotation
2020-06-29 14:23:22 +03:00
Mikhail Zarechenskiy
158013ef3a Remove message and replaceWith parameters from DeprecatedSinceKotlin 2020-06-29 14:22:33 +03:00
Mikhail Zarechenskiy
60c51476f2 Introduce declaration checker for DeprecatedSinceKotlin annotation
- DeprecatedSinceKotlin annotation should only be applicable when
   there's `@Deprecated` annotation on the same declaration
 - Deprecation level shouldn't be specified in the relevant
   `@Deprecated` annotation
 - Check that warningSince <= errorSince <= hiddenSince
2020-06-29 14:22:32 +03:00
Alexander Udalov
0aaf29c045 Introduce DeprecatedSinceKotlin annotation
This annotation will be used in the standard library to prevent the new
compiler from reporting deprecation diagnostics in case an older API
version is used (where the declaration was not deprecated yet).

 #KT-23575 Fixed
2020-06-29 14:22:29 +03:00
Dmitriy Dolovov
b2022144e6 [Commonizer] Fast-pass for library fragments absent for some targets
^KT-39897
2020-06-29 16:40:59 +07:00
Dmitriy Novozhilov
ee22488ab2 [FIR] Cleanup FIR modules. Part 8 (types package) 2020-06-29 12:19:06 +03:00
Dmitriy Novozhilov
2c3fe8b8ec [FIR] Cleanup FIR modules. Part 7 (scopes package) 2020-06-29 12:19:06 +03:00
Dmitriy Novozhilov
c6124f6d56 [FIR] Cleanup FIR modules. Part 6 (transformers package) 2020-06-29 12:19:05 +03:00
Dmitriy Novozhilov
e817f919c2 [FIR] Cleanup FIR modules. Part 5 (body.resolve package) 2020-06-29 12:19:05 +03:00
Dmitriy Novozhilov
285b6d28af [FIR] Cleanup FIR modules. Part 4 (providers and resolve packages) 2020-06-29 12:19:05 +03:00
Dmitriy Novozhilov
1d90302848 [FIR] Cleanup FIR modules. Part 3 (inference package) 2020-06-29 12:19:05 +03:00
Dmitriy Novozhilov
1766c22f6f [FIR] Cleanup FIR modules. Part 2 (dfa package) 2020-06-29 12:19:04 +03:00
Dmitriy Novozhilov
604c68b3a0 [FIR] Cleanup FIR modules. Part 1 (calls package) 2020-06-29 12:19:04 +03:00
Dmitriy Novozhilov
1ac0e8449b [FIR] Move FirJavaTypeRef to fir.jvm module 2020-06-29 12:19:04 +03:00
Dmitriy Novozhilov
fd1de9b298 [FIR] Fix typo in FirCloneableSymbolProvider 2020-06-29 12:19:03 +03:00
Dmitriy Novozhilov
57b9baac53 [FIR] Get rid of FirSession.inferenceContext
Leave only FirSession.typeContext
2020-06-29 12:19:03 +03:00
Dmitriy Novozhilov
43bb60addb [FIR] Remove workaround for KT-39659 2020-06-29 12:19:03 +03:00
Dmitriy Novozhilov
7834284bec [FIR] Support deserialization of value parameter annotations
There are still some problems, see KT-39837
2020-06-29 12:19:03 +03:00
Dmitriy Novozhilov
2b2f9b3386 [FIR] Remove delegate specific methods from abstract inference session 2020-06-29 12:19:02 +03:00
Dmitriy Novozhilov
9c6ed2ea02 [FIR] Complete delegate calls in default inference session 2020-06-29 12:19:02 +03:00
Dmitriy Novozhilov
dbbb999952 [FIR] Support builder (coroutine) inference
#KT-37431 Fixed
2020-06-29 12:19:02 +03:00
Dmitriy Novozhilov
6a9504f26a [FIR-TEST] Add coroutines diagnostic tests from old FE to FIR test suite 2020-06-29 12:19:02 +03:00
Dmitriy Novozhilov
d0affc6c6a [FIR] Rename ResolverParts.kt to ResolutionStages.kt 2020-06-29 12:19:01 +03:00
Dmitriy Novozhilov
de1b5cd056 [FIR] Add extracting @Exact and @NoInfer attributes from annotations
(cherry picked from commit e4c8c14e3e)
2020-06-29 12:19:01 +03:00
Dmitriy Novozhilov
7ab3dd04a0 [FIR] Add attributes for @Exact and @NoInfer
(cherry picked from commit e43932f147)
2020-06-29 12:19:01 +03:00
Dmitriy Novozhilov
ac51e5dbd1 [FIR] Add workaround for KT-19306 2020-06-29 12:19:00 +03:00
Dmitriy Novozhilov
3f5db6b86e [FIR] Add ConeAttributes to ConeKotlinType
(cherry picked from commit f76befa84e)
2020-06-29 12:19:00 +03:00
Dmitriy Novozhilov
e76f3f93f6 [FIR] Move ArrayMap to cones module
(cherry picked from commit 407d1365bd)
2020-06-29 12:19:00 +03:00
Abduqodiri Qurbonzoda
d3fb9cc5f3 Deprecate with error mixed Int/FP contains operator for ranges KT-22423 2020-06-29 12:18:19 +03:00
Vladimir Dolzhenko
ab20b3e083 Add InterruptedException handler to CancellableSimpleLock
#EA-220650 Fixed
2020-06-29 08:47:53 +00:00
Vladimir Dolzhenko
a9444c386d Use actual import list on PlainTextPaste
#EA-225256 Fixed
2020-06-29 08:47:52 +00:00
Dmitry Gridin
30f98e6730 Inline refactoring: shouldn't lose return type information
#KT-26705 Fixed
2020-06-29 07:55:21 +00:00
Dmitry Gridin
c3b726f10a Inline refactoring: should add explicit type argument for parameters
#KT-17402 Fixed
2020-06-29 07:55:20 +00:00
Dmitry Gridin
45234c9784 Inline refactoring: fix case with introduction of variable to return
#KT-39818 Fixed
2020-06-29 07:55:20 +00:00
Andrey Uskov
f4e9acb233 Escape arguments when Gradle plugin launches out of process compilation
#KT-39755 Fixed
2020-06-28 11:38:04 +03:00
Yunir Salimzyanov
90dae320c3 Specify full name of parametrized flaky test to synchronize it on TeamCity
KTI-239
2020-06-27 13:29:18 +03:00
Yunir Salimzyanov
b795e50e61 Add logic to synchronize muted tests on teamcity with database flaky tests
KTI-239
2020-06-27 13:29:18 +03:00
Yunir Salimzyanov
a382bef144 Extract classes and related functions of muteWithDatabase to separate module 2020-06-27 13:29:18 +03:00
Yunir Salimzyanov
4474077963 Create separate module for muting tests logic 2020-06-27 13:29:17 +03:00
Georgy Bronnikov
5e115c48b3 Unmute FIR test 2020-06-27 00:25:34 +03:00
Shagen Ogandzhanian
8a393ec041 Update dukat dependency to 0.5.4 2020-06-26 21:05:21 +02:00
Leonid Startsev
901d8f3e7a Rename several core entities as a part of kx.serialization abi change 2020-06-26 20:31:23 +03:00
Leonid Startsev
5208bbcd21 Support new ContextSerializer signature 2020-06-26 20:31:22 +03:00
Toshiaki Kameyama
7ea1700b78 Convert lambda to reference: support generic function call
#KT-14578 Fixed
#KT-14395 Fixed
2020-06-26 20:30:39 +03:00
Dmitry Petrov
2137a4b1e5 JVM, JVM_IR: no nullability annotations on private and synthetic methods
NB it looks like it doesn't cover all cases, e.g., some synthetic
methods generated for suspend functions.
2020-06-26 18:51:35 +03:00
Georgy Bronnikov
5684e694b5 JVM_IR: handle diamond inheritance for Java fields 2020-06-26 18:46:41 +03:00
Anton Bannykh
da79f93c61 JS IR: per-module .js generation support 2020-06-26 17:55:33 +03:00
Anton Bannykh
deb5dc1057 Don't merge files into a single module 2020-06-26 17:55:33 +03:00
Anton Bannykh
5239ab477c Lowerings apply to a list of modules 2020-06-26 17:55:33 +03:00
Anton Bannykh
9a1d9814de Simpify phase building 2020-06-26 17:55:33 +03:00
Anton Bannykh
2e68526b44 Merge ES6 pipeline 2020-06-26 17:55:32 +03:00
Anton Bannykh
a1c9ee1013 Mute failing ES6 phases 2020-06-26 17:55:32 +03:00
Alexey Trilis
955087868a KT-39843 Update project wizard templates after replacing kotlin.browser with kotlinx.browser
#KT-39843 Fixed
2020-06-26 17:54:02 +03:00
Denis Zharkov
66e53305bf FIR: Leave only one composite-like scope implementation 2020-06-26 16:52:10 +03:00
Denis Zharkov
09bb755088 FIR: Pass scope to FirSpecificTypeResolverTransformer as data 2020-06-26 16:52:10 +03:00
Denis Zharkov
cea38771f1 FIR: Unbound TypeResolver from IterableScope 2020-06-26 16:52:10 +03:00
Denis Zharkov
b607cecc2b FIR: Clear JavaTypeParameterStack
- Remove unused method
- Rename method to make it findable through "Find usages"
2020-06-26 16:52:10 +03:00
Denis Zharkov
f3e4e9b162 FIR: Make qualifier have only one static scope
It's more correct as that's how it works in FE 1.0
2020-06-26 16:52:10 +03:00
Denis Zharkov
a017109d7d FIR: Use static scope for importing from non-object classes 2020-06-26 16:52:10 +03:00
Denis Zharkov
396c6377f8 FIR: Do not check statics in MemberScopeTowerLevel
Type scopes should not contain them anymore
2020-06-26 16:52:10 +03:00
Denis Zharkov
9668a60151 FIR: Explicitlty separate static and member scopes
For Java, they have rather different semantics considering "overrides"
and obtaining functions/properties from supertypes

See the Java statics implementation
2020-06-26 16:52:10 +03:00
Denis Zharkov
e058c578a8 FIR: Minor. Make method private 2020-06-26 16:52:10 +03:00
Denis Zharkov
24d7d208a0 FIR: Extract Java class rendering in tests 2020-06-26 16:52:10 +03:00
Denis Zharkov
9b5b882dcb Add "*.jar binary" to .gitattributes 2020-06-26 16:52:10 +03:00
Ilya Goncharov
be2d6b99f6 [Gradle, JS] Add test on changing of default value for generating externals 2020-06-26 16:26:13 +03:00
Ilya Goncharov
4bfcb4b041 [Gradle, JS] Use common projectName fun 2020-06-26 16:26:13 +03:00
Ilya Goncharov
89c1af4feb [Gradle, JS] Add tests on changing generating externals for npm deps 2020-06-26 16:26:13 +03:00
Ilya Goncharov
891071e074 [Gradle, JS] Add assertSingleFileExists 2020-06-26 16:26:13 +03:00
Ilya Goncharov
405412f6c1 [Gradle, JS] Use generateExternalsIntegrated instead of full build 2020-06-26 16:26:13 +03:00
Ilya Goncharov
f584fb1576 [Gradle, JS] Add test on integrated dukat task 2020-06-26 16:26:13 +03:00
Ilya Goncharov
1a9f236a60 [Gradle, JS] Add tests on Separate Dukat integration 2020-06-26 16:26:12 +03:00
Ilya Goncharov
007970ded8 [Gradle, JS] Add independent peer npm dependency to test
^KT-39842 fixed
2020-06-26 16:20:45 +03:00
Ilya Goncharov
bd05b447c0 [Gradle, JS] Ignore peer dependencies in yarn resolution
^KT-39842 fixed
2020-06-26 16:20:35 +03:00
Dmitry Petrov
9468670980 Minor: update testData with nullability annotations 2020-06-26 15:17:23 +03:00
Dmitry Petrov
64e47265e1 JVM, JVM_IR: no nullability annotations on lateinit backing fields 2020-06-26 15:08:23 +03:00
Toshiaki Kameyama
e822e871f5 KT-39532 Support intention to convert reference to lambda and vice versa for adapted references (#3495)
* Convert lambda to reference: support a function which has default parameters/unit return type/suspendability

#KT-39532 Fixed
2020-06-26 14:21:17 +03:00
Mikhail Zarechenskiy
a87b25d10e Don't silently ignore argument mismatch for provide delegate
#KT-39816 Fixed
2020-06-26 14:03:49 +03:00
Mikhail Zarechenskiy
ea5fef76d1 Fix ambiguity on reference inside blocks of special functions
#KT-37058 Fixed
2020-06-26 14:03:49 +03:00
Mikhail Zarechenskiy
c2c139ef4f Fix adaptation for references with default values after varargs
After vararg argument it's possible to pass values only by name, so
 here we modulate this behavior

 #KT-37721 Fixed
2020-06-26 14:03:48 +03:00
Mikhail Zarechenskiy
c5a2ab2512 Callable reference adaptation should have dependency on API version 1.4
#KT-38069 Fixed
2020-06-26 14:03:47 +03:00
Mikhail Zarechenskiy
bc40669598 Prohibit functional interface constructor references
#KT-36706 Fixed
2020-06-26 14:03:47 +03:00
Ilya Gorbunov
e3050cd997 Minor tweaks in js api dump run configuration
- parallel build
- clean test results before running tests again
2020-06-26 13:53:49 +03:00
Ilya Gorbunov
94ab50a21a Fixup stdlib-js api dump
Some strange effect related to loading types from kotlin.reflect.
2020-06-26 13:52:05 +03:00
Ilya Kirillov
366a75e222 Wizard: update versions of used libraries for 1.4-M3
#KT-39503 fixed
#KT-39503 fixed
2020-06-26 12:19:35 +03:00
Ilya Kirillov
35d5936829 Wizard: add info about used Kotlin version to project test importing failure 2020-06-26 12:19:34 +03:00
Dmitriy Novozhilov
7ea17f0d31 Revert "[FIR] Move ArrayMap to cones module"
This reverts commit 407d1365
2020-06-26 11:47:20 +03:00
Dmitriy Novozhilov
0b29a3e5c1 Revert "[FIR] Add ConeAttributes to ConeKotlinType"
This reverts commit f76befa8
2020-06-26 11:47:08 +03:00
Dmitriy Novozhilov
76550d3c5d Revert "[FIR] Add attributes for @Exact and @NoInfer"
This reverts commit e43932f1
2020-06-26 11:46:59 +03:00
Dmitriy Novozhilov
c0634217e1 Revert "[FIR] Add extracting @Exact and @NoInfer attributes from annotations"
This reverts commit e4c8c14e
2020-06-26 11:46:50 +03:00
Pavel Kirpichenkov
59e63f549b Add completion highlighting tests for heavy Kotlin files
#KT-37219 In Progress
2020-06-26 11:13:07 +03:00
Pavel Kirpichenkov
5c70f973a5 Force resolution of file annotations before element analysis
^KT-37219 In Progress
2020-06-26 11:13:07 +03:00
Dmitriy Novozhilov
e4c8c14e3e [FIR] Add extracting @Exact and @NoInfer attributes from annotations 2020-06-26 10:54:51 +03:00
Dmitriy Novozhilov
e43932f147 [FIR] Add attributes for @Exact and @NoInfer 2020-06-26 10:54:51 +03:00
Dmitriy Novozhilov
f76befa84e [FIR] Add ConeAttributes to ConeKotlinType 2020-06-26 10:54:51 +03:00
Dmitriy Novozhilov
407d1365bd [FIR] Move ArrayMap to cones module 2020-06-26 10:54:50 +03:00
Matts966
36102504a1 Update ReadMe.md 2020-06-26 09:41:57 +02:00
Matts966
20ed42dd38 Update deprecated doc about mac build environment requirements 2020-06-26 09:41:57 +02:00
Toshiaki Kameyama
2fd3af73eb Convert reference to lambda: fix it works correctly when referenced function has default argument
#KT-17222 Fixed
#KT-24138 Fixed
#KT-39532
2020-06-26 10:20:29 +03:00
Mikhail Zarechenskiy
bc34f7f7f5 Add test for obsolete issue
#KT-26345 Obsolete
2020-06-26 07:45:25 +03:00
Abduqodiri Qurbonzoda
a04f70fb36 Fix min/maxByOrNull function samples 2020-06-26 07:16:01 +03:00
Mikhail Zarechenskiy
684ca5029f Add tests for obsolete issues
#KT-37734 Obsolete
 #KT-39824 Obsolete
2020-06-26 06:24:59 +03:00
shiraji
9844607d0f Make string literals clickable
#KT-35732 Fixed
#KT-32403 Fixed
2020-06-25 22:40:39 +02:00
Igor Yakovlev
f06e116bf7 Improved equals for light decompiled declarations 2020-06-25 23:19:54 +03:00
Igor Yakovlev
27c139926c LightClass improved isInheritor check for cases when resolve is failed
Fixed #KT-37210
2020-06-25 23:17:09 +03:00
Guillaume Darmont
e72a06bdf4 Add specific highlight for Enum class
#KT-39844 Fixed
2020-06-25 21:53:19 +02:00
Dmitry Petrov
3f266aafb4 JVM: no nullability annotations on private and synthetic fields 2020-06-25 22:31:12 +03:00
Victor Petukhov
cbd8b58d5c Commit trace for callable reference's LHS with reserved syntax like foo?::bar?::bar to avoid the lack of diagnostics reporting
^KT-35075 Fixed
2020-06-25 20:44:58 +03:00
Ilmir Usmanov
1ee8e615fc Reuse value is ISTORE if expected type is the same, otherwise, create
new value
2020-06-25 18:51:15 +02:00
Ilmir Usmanov
c21820c615 Revert "Revert "Fix merging two reference values""
This reverts commit 1cccceabb9.
2020-06-25 18:51:13 +02:00
Ilmir Usmanov
a6f14c206b Revert "Revert "Revert "Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline""""
This reverts commit 447308dcfc.
2020-06-25 18:51:11 +02:00
Kristoffer Andersen
b95d3e711e [JVM IR] KT-36985: $default respects @Deprecated
$default dispatch methods gains @Deprecated if the original function
with default arguments has it.
2020-06-25 18:43:45 +03:00
Ilya Gorbunov
034623f82a Fix top level import quick fix test for JS
There's no longer any JS-only top level function that is not imported
by default, so I used a common non-imported top level function.
2020-06-25 18:36:04 +03:00
Ilya Gorbunov
448e0ceae1 Drop quickfix tests that relied on removed native annotation 2020-06-25 18:36:04 +03:00
Ilya Gorbunov
8dfcebf542 Expose KTypeProjection.STAR constant in a field
#KT-30083
2020-06-25 18:25:24 +03:00
Ilya Gorbunov
53cbcfac5a Validate arguments of KTypeProjection constructor
#KT-34596 Fixed
2020-06-25 18:25:24 +03:00
Ilya Gorbunov
d41e8ed4ad Annotate KTypeProjection factory methods with JvmStatic
#KT-30084 Fixed
2020-06-25 18:25:24 +03:00
Ilya Chernikov
e8659d4b37 Fix initializer error arizing on scripting annotation creation
also fixes tests in main-kts
2020-06-25 17:21:38 +02:00
Vladimir Dolzhenko
3585f80c67 Fix 201 compilation
Relates to #KT-17926
2020-06-25 17:15:13 +02:00
Toshiaki Kameyama
12cd3785b0 Move statement: move parameters/arguments with a comment correctly
#KT-34705 Fixed
#KT-34707 Fixed
#KT-34587 Fixed
2020-06-25 15:45:25 +02:00
Raluca Sauciuc
9c8904f165 Restore KotlinExplicitMovementProvider in as40 2020-06-25 15:06:27 +02:00
Norbert Nogacki
990903e4e2 Show documentation for a class if the constructor has no docs
#KT-17926 Fixed
2020-06-25 14:42:03 +02:00
Mikhail Glukhikh
699829ccb3 Make FIR multi-module tests from IDE regular FIR compiler resolve tests 2020-06-25 12:35:25 +03:00
Ivan Kylchik
79691feb8f Fix fir load compiled kotlin tests after introducing const deserializer 2020-06-25 12:30:24 +03:00
Ivan Kylchik
027d177c15 Remove IGNORE_FIR from tests that are using unsigned constants 2020-06-25 12:30:23 +03:00
Ivan Kylchik
c80cf0f34c Remove IGNORE_FIR from ranges tests 2020-06-25 12:30:21 +03:00
Ivan Kylchik
70f0f357fa Remove IGNORE_FIR from stepped ranges tests 2020-06-25 12:30:19 +03:00
Ivan Kylchik
6c6b7c8b84 Implement constant deserializer for fir
This deserializer is uniform loader, that is responsible for loading
all constants. For example, Math.E, UInt.MAX_VALUE or Float.MIN_VALUE.
2020-06-25 12:30:19 +03:00
Kirill Shmakov
b62e22cb01 Fix Android app in template project 2020-06-25 11:54:23 +03:00
Ivan Kylchik
895c32e21c Create separate source set for interpreter map generator
A separate source set is needed so that the generator no longer depends
on the generated code
2020-06-25 10:45:19 +03:00
Ilya Gorbunov
643d339496 Advance bootstrap to 1.4.20-dev-1080 2020-06-25 02:37:39 +03:00
Vladimir Ilmov
d6483ace94 (UltraLightClasses) fix for processing stubs for Deprecation.HIDDEN annotation fast-path 2020-06-25 00:39:34 +02:00
Mikhail Zarechenskiy
a5ae1b38b0 Don't skip constraints from equations with the kind equal
The problem was that we didn't incorporate T == Foo into K <: Inv<out T>.
 It happened because of optimisation that isn't applicable here as we
 already have projection in the initial type

 #KT-39777 Fixed
2020-06-24 23:36:59 +03:00
Toshiaki Kameyama
ab34f8c738 Add indent before accessor for extension property (KT-33131)
#KT-33131 Fixed
2020-06-24 21:42:02 +02:00
Alexander Udalov
c6a481190a JVM: optimize type mapping for primitive types 2020-06-24 19:26:59 +02:00
Alexander Udalov
64f7c3f498 IR: do not use descriptors in IrTypeSystemContext.getPrimitiveType
Also optimize getPrimitiveType and getPrimitiveArrayType. Convert
PrimitiveType to Kotlin to leverage the switch over string optimization,
which is not possible in Java 6 (which is used to compile
'descriptors').
2020-06-24 19:26:59 +02:00
Alexander Udalov
7013becda5 IR: remove IrBuiltInOperator, use IrFunctionImpl instead
It seems that this is no longer needed. This change in particular helps
to avoid megamorphic interface call on IrValueParameter.accept, which
happens a lot because there are usually many value parameters.
2020-06-24 19:26:55 +02:00
Alexander Udalov
988226a90e IR: optimize FqNameEqualityChecker.checkViaDeclarations 2020-06-24 19:16:12 +02:00
Alexander Udalov
014d855449 IR: minor, make all overrides in IrElementTransformerVoid final 2020-06-24 19:16:11 +02:00
Alexander Udalov
3c90e25cb4 IR: optimize IrType.isNullable, do not use DFS
DFS is not justified for type usages. In contrast to type hierarchies,
traversing the type usage naively with recursion has linear, not
exponential, complexity.
2020-06-24 19:16:11 +02:00
pavlospt
597bc061e2 Add Kotlin Data Class, Sealed Class and Annotation file templates
#KT-20775 Fixed
2020-06-24 16:25:51 +02:00
Toshiaki Kameyama
2162c39ab3 Quick doc: show default parameter value
#KT-19069 Fixed
2020-06-24 16:20:21 +02:00
Ilya Gorbunov
33150a0809 KT-38817 capitalize uses title case for the first char where available
This unifies its behavior with new capitalize overload with Locale.

Co-authored-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2020-06-24 16:45:09 +03:00
Ilya Gorbunov
9e2f95233c Promote capitalize/decapitalize with Locale to stable
Relates to KT-28933
2020-06-24 16:45:08 +03:00
Ivan Kylchik
e34246faec Fix fir2ir text tests after introducing const evaluator 2020-06-24 16:13:02 +03:00
Ivan Kylchik
8044b47984 Create internalName extension method that returns fqName as jvm internal 2020-06-24 16:13:02 +03:00
Ivan Kylchik
ddd03373cc Allow to interpret toString method from Any class for ONLY_BUILTINS mode
This change aims to support string concatenation operation with const
properties
2020-06-24 16:13:02 +03:00
Ivan Kylchik
6f4f7dd090 Remove coroutines from ir interpreter 2020-06-24 16:13:01 +03:00
Ivan Kylchik
f028d6c898 Move interpreter files to separate module 2020-06-24 16:13:01 +03:00
Ivan Kylchik
64aa0ec5c8 Add new module for ir interpreter 2020-06-24 16:13:01 +03:00
Ivan Kylchik
49124709b8 Remove all usages of descriptors from interpreter 2020-06-24 16:13:01 +03:00
Ivan Kylchik
e4f88e83fe Get rid of compile time check in generator for ir builtins map
These checks are unnecessary because we use all methods from given
classes
2020-06-24 16:13:01 +03:00
Ivan Kylchik
2534b15553 Remove descriptors.jvm dependency from common backend module
Common backend should not depend on JVM parts
2020-06-24 16:13:00 +03:00
Ivan Kylchik
8f6a1b418d Add method to evaluate constant expressions in ir module for fir2ir 2020-06-24 16:13:00 +03:00
Ivan Kylchik
fa221af1b1 Move IrConstTransformer.kt to evaluate package 2020-06-24 16:13:00 +03:00
Ivan Kylchik
932ce71093 Rename method checkForError to replaceIfError
This name better reflects the point of this method.
a.replaceIfError(b) will return b instead of a in case a is an error
expression
2020-06-24 16:13:00 +03:00
Ivan Kylchik
b71c74c6ef Remove descriptor usages in Primitive.kt 2020-06-24 16:13:00 +03:00
Ivan Kylchik
0c6d485c9c Rename ReturnLabel.NEXT to ReturnLabel.REGULAR
This name better describe that this label mean: execution was finished
regular and there is no need to make special processing
2020-06-24 16:13:00 +03:00
Ivan Kylchik
9377d274a8 Drop ExecutionResult class implementations and make it regular class
There was 2 implementations that I managed to combine
2020-06-24 16:12:59 +03:00
Ivan Kylchik
c386cbeb54 Move checkNullability function in State.kt file 2020-06-24 16:12:59 +03:00
Ivan Kylchik
e57de9a08f Mark most of classes and functions from interpreter package as internal
Main goal is to avoid ambiguity because some names, that are used by
interpreter, can be found in other modules
2020-06-24 16:12:59 +03:00
Ivan Kylchik
27c52f54ca Remove IGNORE_FIR from tests that are passing after constant folding 2020-06-24 16:12:59 +03:00
Ivan Kylchik
f20e878d35 Add constant folding after FIR2IR processing 2020-06-24 16:12:59 +03:00
Ivan Kylchik
f2045b857b Add fix for interpretation const val
After FIR2IR processing getter doesn't has body, but has initializer.
On the other hand common IR has body for const val getter
2020-06-24 16:12:59 +03:00
Ivan Kylchik
af6ed5ca43 Change toIrConst extension function logic
For now this function check not value, but type. By ir type it create
right ir const
2020-06-24 16:12:59 +03:00
Ivan Kylchik
3155f56d8a Change the way of receiving fields
Before that, interpreted values for fields were taken by backing
field's symbol. For now, they will be taken by property's symbol.
It was done because not all properties contain backing field. For
example, Throwable class in FIR2IR.
2020-06-24 16:12:58 +03:00
Ivan Kylchik
8644c48b28 Prevent interpretation of call expression with continue/break statement
Example: foo("" + continue)
2020-06-24 16:12:58 +03:00
Ivan Kylchik
d90aba60cc Implement correct type checks and casts taking into account erased types 2020-06-24 16:12:58 +03:00
Ivan Kylchik
7a19906705 Change all usages of descriptors in interpreter to usages of ir symbols 2020-06-24 16:12:58 +03:00
Ivan Kylchik
db5046af85 Add support in interpreter for jvm static fields in primitive classes 2020-06-24 16:12:58 +03:00
Ivan Kylchik
a3c77eca08 Make interpreter maps of enum and object declarations non static
Instead of this just create interpreter once per module handling
2020-06-24 16:12:58 +03:00
Ivan Kylchik
ff830cc744 Make state property mutable in Variable class
This change allow to remove copy method from State interface
2020-06-24 16:12:57 +03:00
Ivan Kylchik
848ca70de1 Change keys in static maps of enums and objects from String to IrSymbol 2020-06-24 16:12:57 +03:00
Ivan Kylchik
224d56ec15 Allow compile time calculations inside object declaration 2020-06-24 16:12:57 +03:00
Ivan Kylchik
1c498660dc Create ir compile time checker
This checker is suppose to return true if ir node can be computed
in compile time
2020-06-24 16:12:57 +03:00
Ivan Kylchik
19495e40f7 Remove unnecessary getAllTypeArguments method from Stack class 2020-06-24 16:12:57 +03:00
Ivan Kylchik
99d823da8a Remove unnecessary getThisAsReceiver function from Utils.kt file 2020-06-24 16:12:57 +03:00
Ivan Kylchik
c6240face0 Add test for generation builtins map for interpreter 2020-06-24 16:12:57 +03:00
Ivan Kylchik
1103de4bd5 Prepare ir interpreter for receiving ir bodies in separate map
This change will be useful when starts work with jvm klib
2020-06-24 16:12:56 +03:00
Ivan Kylchik
9542eb36ec Support interpretation of String's plus method and its extension version 2020-06-24 16:12:56 +03:00
Ivan Kylchik
94e36411fa Support interpretation for inner class 2020-06-24 16:12:56 +03:00
Ivan Kylchik
0c1f2edbf2 Get rid of abstract and fake override checks in ir call interpretation
For now interpreter will find necessary method for interpretation in
one step instead of checking is this method abstract or fake override
2020-06-24 16:12:56 +03:00
Ivan Kylchik
80d83f8703 Change check for Wrapper method
For now method is wrapper if its receiver is Wrapper and
method itself isn't inline only
2020-06-24 16:12:56 +03:00
Ivan Kylchik
38822c3bf8 Implement correct interpretation of toList function 2020-06-24 16:12:56 +03:00
Ivan Kylchik
ba8147cd47 Allow lambda to be used in built in calculation
Primary use case to allow lambda null check
2020-06-24 16:12:55 +03:00
Ivan Kylchik
5f61f6f3a5 Simplify interpretation for java methods with names other in kotlin 2020-06-24 16:12:55 +03:00
Ivan Kylchik
2e0d4c9af1 Add correct interpretation for unsigned arrays in vararg method handler 2020-06-24 16:12:55 +03:00
Ivan Kylchik
30f2affb93 Add support for local function that are declared and called immediately 2020-06-24 16:12:55 +03:00
Ivan Kylchik
296f343cab Change conditions for saving type arguments into stack
For now all type arguments are saved. This is necessary for several
reason:
1. ir type operator call need to get right type argument class
2. if class is local then information about type argument cannot be lost
2020-06-24 16:12:55 +03:00
Ivan Kylchik
a095309e10 Allow local declaration interpretation
By local declaration is meant local functions and local objects
2020-06-24 16:12:55 +03:00
Ivan Kylchik
2c93c46b84 Implement do while loop 2020-06-24 16:12:55 +03:00
Ivan Kylchik
1e82975a7c Replace explicit returnLabel call to check call inside try interpreter 2020-06-24 16:12:54 +03:00
Ivan Kylchik
a14e8e4c28 Implement cache for enum entries and objects 2020-06-24 16:12:54 +03:00
Ivan Kylchik
0b0550f562 Remove useless Intrinsic interface
Moved all its methods inside sealed class
2020-06-24 16:12:54 +03:00
Ivan Kylchik
eb3ac74c3f Move out intrinsic evaluation from interpreter class 2020-06-24 16:12:54 +03:00
Ivan Kylchik
6eae77572a Move stack trace inside Stack class 2020-06-24 16:12:54 +03:00
Ivan Kylchik
e00dc76645 Simplify constructor interpretation
Unified case with secondary and primary constructors
2020-06-24 16:12:53 +03:00
Ivan Kylchik
cf63a5f52b Replace some casts to Primitive with corresponding extension calls 2020-06-24 16:12:53 +03:00
Ivan Kylchik
5791ecd4f7 Remove redundant suspend modifiers 2020-06-24 16:12:53 +03:00
Ivan Kylchik
cb0eb008f8 Implement correct access to stack
Rewrote work with data and implement Stack class that work over Frame
2020-06-24 16:12:53 +03:00
Ivan Kylchik
06e6c7cdf5 Implement interpretation for object with overridden methods 2020-06-24 16:12:53 +03:00
Ivan Kylchik
fe7abb7132 Remove unnecessary code about handling KotlinNullPointerException
This part of code was necessary because jvm threw
KotlinNullPointerException, but js expected NullPointerException.
2020-06-24 16:12:53 +03:00
Ivan Kylchik
2f41eef797 Replace throw of interpreter errors by throw of InterpreterException 2020-06-24 16:12:53 +03:00
Ivan Kylchik
aed78f3c9b Bound commands limit and throw interpreter exception upon exceeding 2020-06-24 16:12:52 +03:00
Ivan Kylchik
be42ae470d Simplify extraction logic of receiver in ir call interpreter 2020-06-24 16:12:52 +03:00
Ivan Kylchik
2189fe5796 Add suspend modifier to getNextLabel method in Label interface 2020-06-24 16:12:52 +03:00
Ivan Kylchik
fd51a9a085 Change signature in getArgsForMethodInvocation method 2020-06-24 16:12:52 +03:00
Ivan Kylchik
30e352ea27 Move Variable data class to separate file 2020-06-24 16:12:52 +03:00
Ivan Kylchik
ef4e4881b7 Implement spread operator interpretation 2020-06-24 16:12:52 +03:00
Ivan Kylchik
c9e5b6a234 Unify value arguments interpretation 2020-06-24 16:12:52 +03:00
Ivan Kylchik
520f2455b3 Create and implement ExecutionResult interface to use as return status
This is replacement for Code enum class that was returned from
methods of interpreter earlier
2020-06-24 16:12:51 +03:00
Ivan Kylchik
77978637a8 Move all classes from State.kt into separate files 2020-06-24 16:12:51 +03:00
Ivan Kylchik
530252eea8 Move State.kt in separate package 2020-06-24 16:12:51 +03:00
Ivan Kylchik
7e7a5fe736 Add reference to sub class in Complex class
This is replacement for instance field
2020-06-24 16:12:51 +03:00
Ivan Kylchik
ad7055b8a0 Move additional stack filling in ExceptionState class 2020-06-24 16:12:51 +03:00
Ivan Kylchik
900e78b39b Add hashCode, equals and toString methods from String in builtin map 2020-06-24 16:12:51 +03:00
Ivan Kylchik
82acf7deb6 Change getting function receiver for method with multiple overridden 2020-06-24 16:12:50 +03:00
Ivan Kylchik
0400a62014 Improve receivers search in data pool 2020-06-24 16:12:50 +03:00
Ivan Kylchik
b6cf17af1b Save context of inline and local functions 2020-06-24 16:12:50 +03:00
Ivan Kylchik
28d6752315 Change usages of IrFunctionImpl to more common IrSimpleFunction 2020-06-24 16:12:50 +03:00
Ivan Kylchik
c45993b2b1 Implement interpretation for return statements with labels 2020-06-24 16:12:50 +03:00
Ivan Kylchik
5c845da18a Implement interpretation for unsigned numbers 2020-06-24 16:12:50 +03:00
Ivan Kylchik
b175f46315 Implement interpretation of Char and Long classes from js stdlib 2020-06-24 16:12:50 +03:00
Ivan Kylchik
2310a04e4e Add toString, hashCode and equals primitives methods in ir builtin map 2020-06-24 16:12:49 +03:00
Ivan Kylchik
00366197f8 Implement interpretation of Enum class hashCode method 2020-06-24 16:12:49 +03:00
Ivan Kylchik
6a9f4cf8b7 Change interpretCall to be able to interpret data class copy method 2020-06-24 16:12:49 +03:00
Ivan Kylchik
bab4407c0a Implement interpretation for destructing declaration 2020-06-24 16:12:49 +03:00
Ivan Kylchik
ff6e06aa14 Implement regular expression interpretation 2020-06-24 16:12:49 +03:00
Ivan Kylchik
4d80d17b23 Implement interpretation for expect enum class 2020-06-24 16:12:49 +03:00
Ivan Kylchik
731fb9bc70 Make ir interpreter to work with minimal dependence on ir lowerings 2020-06-24 16:12:48 +03:00
Ivan Kylchik
4c1727b82e Move intrinsic handling inside IrInterpreter class 2020-06-24 16:12:48 +03:00
Ivan Kylchik
27e2faa778 Implement enum interpretation 2020-06-24 16:12:48 +03:00
Ivan Kylchik
d6a45dfe75 Implement instance of check in compile time 2020-06-24 16:12:48 +03:00
Ivan Kylchik
0a70277240 Make stack trace from exceptions more precise
Additional information is retrieved from original stack trace when
exception happened during wrapper invocation.
2020-06-24 16:12:48 +03:00
Ivan Kylchik
18d29f7d98 Make possible to create arrays with their constructors 2020-06-24 16:12:47 +03:00
Ivan Kylchik
aca889a95b Add inc, dec methods in ir builtins map and remove toString and equals 2020-06-24 16:12:47 +03:00
Ivan Kylchik
169a2f361c Add support for cause field in exceptions 2020-06-24 16:12:47 +03:00
Ivan Kylchik
6af47ad7b3 Implement basic stack trace reporting if unhandled exception appear 2020-06-24 16:12:47 +03:00
Ivan Kylchik
66dbd1af34 Mark all IrInterpreter methods as suspend
This change is used to get rid of unhandled StackOverflowError and
to be able to manually throw it.
2020-06-24 16:12:47 +03:00
Ivan Kylchik
2985e8bcd3 Clean up code of ir builtins map generator 2020-06-24 16:12:47 +03:00
Ivan Kylchik
cbc9c19faf Add methods for message and clause from Throwable in ir builtins map 2020-06-24 16:12:46 +03:00
Ivan Kylchik
d9279bff73 Introduce ExceptionState class responsible for all kind of exceptions 2020-06-24 16:12:46 +03:00
Ivan Kylchik
be3eb98fbd Introduce new Common state that represent common object
This is a replacement for Complex, that are now an abstract class.
2020-06-24 16:12:46 +03:00
Ivan Kylchik
4345294ac1 Add all methods from Any class in ir builtins map 2020-06-24 16:12:46 +03:00
Ivan Kylchik
d03937cdb6 Pop return value after implicit coercion to unit 2020-06-24 16:12:46 +03:00
Ivan Kylchik
792ae8d272 Get rid of dynamic cast interpretation 2020-06-24 16:12:46 +03:00
Ivan Kylchik
3ccf542b38 Rework object and companion object interpretation
For now object value or fun can be interpreter only if they are
marked explicitly. Annotation for all object is restricted and if
whole class is marked with CompileTimeAnnotation this doesn't
mean that companion object is computable.
2020-06-24 16:12:46 +03:00
Ivan Kylchik
0ef34dcf53 Implement class cast interpretation 2020-06-24 16:12:45 +03:00
Ivan Kylchik
a25896bf6a Implement string concatenation interpretation 2020-06-24 16:12:45 +03:00
Ivan Kylchik
0839e7afdc Describe default behaviour for Any class methods
We are talking about such methods as equals, hashCode and toString.
2020-06-24 16:12:45 +03:00
Ivan Kylchik
a6cc7cdc23 Rewrite exception handler to catch null pointer exception in js ir
For now null check works as !! operator called in jvm.
So it throw KotlinNullPointerException, but js ir require
NullPointerException
2020-06-24 16:12:45 +03:00
Ivan Kylchik
5209f4a9c0 Add not null (!!) operator in ir builtins map 2020-06-24 16:12:45 +03:00
Ivan Kylchik
bb119280be Interpret basic interpretation for try catch block 2020-06-24 16:12:45 +03:00
Ivan Kylchik
b5778e6de5 Implement interpretation for lambdas and anonymous functions 2020-06-24 16:12:45 +03:00
Ivan Kylchik
4fdfdb9b4c Implement StringBuilder interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik
06ee4ac21f Implement List and MutableList interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik
9555497d5d Implement arrayOf symbols interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik
4dc1e587b4 Implement vararg interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik
45555d681d Add methods from arrays classes in ir builtins map 2020-06-24 16:12:44 +03:00
Ivan Kylchik
3ab7c263d0 Implement continue statement interpretation 2020-06-24 16:12:44 +03:00
Ivan Kylchik
c4cc858b84 Extract ir function interpretation in separate method
This modification will be used to get exception stack trace
2020-06-24 16:12:44 +03:00
Ivan Kylchik
f99829ce5e Implement trim function interpretation in compile time 2020-06-24 16:12:43 +03:00
Ivan Kylchik
178b2a07ae Move all interpreter methods inside IrInterpreter class 2020-06-24 16:12:43 +03:00
Ivan Kylchik
f8cb637712 Change IrInterpreter to modify tree structure into the flat one
This modification is necessary to implement right control flow
2020-06-24 16:12:43 +03:00
Ivan Kylchik
0a76da99cf Implement equalTo function for descriptors 2020-06-24 16:12:43 +03:00
Ivan Kylchik
dd93deddd7 Add while loop support in interpreter 2020-06-24 16:12:43 +03:00
Ivan Kylchik
c2a70b4e57 Add rangeTo entry in builtins map 2020-06-24 16:12:43 +03:00
Ivan Kylchik
34a59f5b85 Add abstract classes and interfaces support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik
b1dc403182 Add branches support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik
dcd8a4a4c7 Add variables support in interpreter 2020-06-24 16:12:42 +03:00
Ivan Kylchik
aca7a49214 Add some sort of correct calculation with const modifier 2020-06-24 16:12:42 +03:00
Ivan Kylchik
a20269bcdd Extract some methods to utils 2020-06-24 16:12:42 +03:00
Ivan Kylchik
11e808715b Rethink main goal of stack frame 2020-06-24 16:12:42 +03:00
Ivan Kylchik
c3600ba114 Implement interpreter that can evaluate simple fun
For now working cases are: create simple object using primary
constructor, invoke its method, invoke superclass method,
load/save fields. Return values from compile time function can be
only primitives for now.
2020-06-24 16:12:42 +03:00
Ivan Kylchik
a582d88cf4 Create simple stack model for interpreter 2020-06-24 16:12:41 +03:00
Ivan Kylchik
f6373a647e Create simple interpreter that evaluate constant values 2020-06-24 16:12:41 +03:00
Ivan Kylchik
a27a07ce81 Create generator for map with builtin operations 2020-06-24 16:12:41 +03:00
Dmitry Petrov
e9570d6efd Minor: update testData 2020-06-24 16:04:38 +03:00
Toshiaki Kameyama
6b2c87020b Replace explicit parameter with 'it': do not suggest when lambda is directly under "when" or "if"
Relates to #KT-35320
2020-06-24 14:55:30 +02:00
Georgy Bronnikov
daab07ea38 JVM_IR: use MetadataSource for local delegated properties 2020-06-24 14:41:01 +03:00
Alexey Trilis
593684ecb6 Fix testdata after changing API of kotlin.browser and kotlin.dom 2020-06-24 13:38:29 +03:00
Toshiaki Kameyama
e6edab1c82 Quick doc: do not show nullability annotations
#KT-37132 Fixed
2020-06-24 10:45:57 +02:00
Toshiaki Kameyama
e8aa14a283 Method sepatators: show separator between companion object and function
#KT-24352 Fixed
2020-06-24 10:05:27 +02:00
Ilya Chernikov
5942446274 [minor] clean up main-kts-dependencies 2020-06-23 21:56:04 +02:00
Ilya Chernikov
4c34e9dd03 Move main-kts cache test to out-of-process compilation
to avoid clashes with coroutine debugger when running
tests from IntelliJ
2020-06-23 21:56:04 +02:00
Ilya Chernikov
879e22f274 Fix coroutines core shading in main-kts 2020-06-23 21:56:04 +02:00
Gia Thuan Lam
83b52bb109 Enable Input Redirection for KotlinRunConfiguration
#KT-28854 Fixed

(cherry picked from commit 6e55010767b1c1a7c8d23d337bdbd5824dfa2906)
2020-06-23 21:04:09 +02:00
Ilya Goncharov
69e8abfe3c Fix test data for new project wizard in Project Templates 2020-06-23 21:07:35 +03:00
Dmitry Petrov
4e92c79bc4 JVM_IR: don't generate nullability annotations on synthetic declarations
Fixes KT-36993 and some other related issues.
2020-06-23 20:51:48 +03:00
Dmitry Petrov
d477d9eb43 JVM_IR KT-37005: no delegates for @InlineOnly funs in multifile facades 2020-06-23 20:22:41 +03:00
Dmitry Petrov
5bfec7f6bc JVM: don't generate nullability annotations on property delegate fields
Such fields are private, so these annotations are redundant.

They were incorrect, anyway (property type was used instead of delegate
type).
2020-06-23 20:18:42 +03:00
Mikhail Bogdanov
af3bda51ec Fix compilation on mixed hierarchies in compatibility mode 2020-06-23 18:59:04 +02:00
Mikhail Bogdanov
41511898a1 Deprecate DefaultImpl methods in compatibility mode 2020-06-23 18:59:04 +02:00
Mikhail Glukhikh
39740ce440 [FIR2IR] Drop decl. parent set in lazy class (it should be set before) 2020-06-23 19:06:08 +03:00
Mikhail Glukhikh
d08f91bf35 [FIR2IR] Introduce & use lazy function for external class functions 2020-06-23 19:06:08 +03:00
Mikhail Glukhikh
6d07af63cf [FIR2IR] Count IrErrorTypes as not equal for purpose of overriding
This prevents possible type checking exceptions
2020-06-23 19:06:08 +03:00
Mikhail Glukhikh
d02d423d45 [FIR2IR] Introduce additional built-in symbols prepared in advance
This commit allow to avoid possible conflicts between descriptor-based
and signature-based symbols,
because BE sometimes (e.g. in DeclarationStubGenerator)
creates descriptor-based symbol without checking signature-based
2020-06-23 19:06:07 +03:00
Mikhail Glukhikh
a791a38538 FIR mangler: support definitely not-null types (for Java) 2020-06-23 19:06:07 +03:00
Mikhail Glukhikh
987cf5ef5f Drop unused Fir2IrVisitor.fakeOverrideMode 2020-06-23 19:06:07 +03:00
Mikhail Glukhikh
0622be14a5 [FIR2IR] Introduce creation of Fir2Ir lazy classes 2020-06-23 19:06:07 +03:00
Ilya Goncharov
5e9291bd8a Fix test data for new project wizard 2020-06-23 18:56:16 +03:00
Ilya Goncharov
e6539eade5 Fix new project wizard css support for karma 2020-06-23 18:26:51 +03:00
Dmitry Gridin
b657d60bd6 Suggest Create Class before Create File
#KT-37528 Fixed
2020-06-23 13:29:09 +00:00
Natalia Selezneva
bcd3921bae Fix freeze during loading script configurations through legacy scripting API
Do not wrap the whole configuration loading process into readAction
^KT-39771 Fixed
2020-06-23 16:04:24 +03:00
Alexander Udalov
05e8546bdb Skip unresolved JvmStatic/JvmField annotations in builtins
This is needed to implement KT-30084 and KT-30083 after bootstrap.
2020-06-23 13:55:08 +02:00
Dmitry Gridin
abfc74c8b2 Add regression test
#KT-30131 Fixed
2020-06-23 18:05:17 +07:00
Dmitriy Dolovov
d8fa617bfd Minor. Fix typo in text printed to users 2020-06-23 17:27:14 +07:00
Dmitry Gridin
99f958c8c4 Inline refactoring: should remove redundant Unit
#KT-19443 Fixed
2020-06-23 10:25:54 +00:00
Dmitry Gridin
af24ce5e03 RedundantUnitExpressionInspection: support lambdas
#KT-39772 Fixed
2020-06-23 10:25:53 +00:00
Dmitry Gridin
4ac7dc0744 RedundantUnitExpressionInspection: make isRedundantUnit public 2020-06-23 10:25:53 +00:00
Dmitry Gridin
360a5bf348 Inline refactoring: improve resolve
#KT-39705 Fixed
#KT-19459 Fixed
2020-06-23 10:25:52 +00:00
Dmitry Gridin
5ad94daaa5 ImportOptimizer: cleanup code
#KT-31331
2020-06-23 09:48:07 +00:00
Dmitry Gridin
2610dedcbd KotlinUnusedImportInspection: support unresolved references
#KT-31331 Fixed
2020-06-23 09:48:07 +00:00
Dmitry Gridin
10c62b8d77 ImportOptimizer: add cases for unresolved references
Part of #KT-31331
2020-06-23 09:48:06 +00:00
Dmitry Gridin
4de582564c ImportOptimizer: basic support for removing unresolved imports
#KT-32409 Fixed
Part of #KT-31331
2020-06-23 09:48:05 +00:00
Dmitry Gridin
8faced9192 KotlinImportOptimizer: replace LinkedHashMap with HashMap and BodyResolveMode.FULL with BodyResolveMode.PARTIAL 2020-06-23 09:48:05 +00:00
Dmitry Gridin
383fa2d111 ImportOptimizer: cleanup code 2020-06-23 09:48:04 +00:00
Mikhail Zarechenskiy
e7cee9c6e1 Fix coercion to Unit with equal Nothing constraint
#KT-39669 Fixed
2020-06-23 11:47:39 +03:00
Mikhail Zarechenskiy
a06c8786df Fix overload ambiguity after smartcast to nullable Nothing
#KT-39544 Fixed
2020-06-23 11:34:19 +03:00
Dmitry Gridin
9313073971 LineIndentProvider: temporarily disable before elvis operator
#KT-39716 Fixed
2020-06-23 15:17:47 +07:00
Ilya Goncharov
793ada08a9 cssSettings -> cssSupport 2020-06-23 11:08:30 +03:00
Ilya Goncharov
538cf8af56 Fix test with css case 2020-06-23 11:08:30 +03:00
Ilya Goncharov
4ad95dbe0c Fix browser settings for webpack tasks 2020-06-23 11:08:30 +03:00
Jinseong Jeon
856ac76c8f FIR2IR: handle type alias inside GetClassCall 2020-06-23 09:46:47 +03:00
Ilya Gorbunov
29d3d07636 Remove stdlib-js-ir and kotlin-test-js-ir from coreLibs projects
They do not produce their own deployable artifacts,
their output is merged into stdlib-js and kotlin-test-js.

Remove coreLibsDist task, because now projects can't be dist'ed
selectively.
2020-06-23 01:52:38 +03:00
Ilya Gorbunov
b2e70f9c21 Fix stdlib-js-ir-for-tests build
Exclude kotlinx.browser and kotlinx.dom packages
2020-06-23 01:52:36 +03:00
Georgy Bronnikov
4ecb228d50 IR: handle enhanced nullability in TypeTranslator 2020-06-22 22:06:01 +03:00
Igor Yakovlev
b21cabe671 Separate decompiled declarations light representations from LightClasses
Fixed #KT-39457
2020-06-22 21:17:12 +03:00
Vladimir Ilmov
40ec794c66 (UltraLightClasses) fast-path for Deprecated.HIDDEN annotation 2020-06-22 15:58:25 +02:00
Ilya Goncharov
852e860743 Update test data
#KT-39770 fixed
2020-06-22 16:45:00 +03:00
Ilya Goncharov
c2e97a7287 Kind and css support to single platform JS
#KT-39770 fixed
2020-06-22 16:45:00 +03:00
Ilya Goncharov
5676d31a1c Add CSS support to new project wizard
#KT-39770 fixed
2020-06-22 16:45:00 +03:00
Ilya Goncharov
b8aff0660c Refactor aligning for css support
#KT-39770 fixed
2020-06-22 16:44:59 +03:00
Ilya Goncharov
c9c20bb34c Add enabling css into wizard
#KT-39770 fixed
2020-06-22 16:44:59 +03:00
Dmitry Petrov
e9231b5624 JVM: Generate object and companion object INSTANCE fields as @NotNull 2020-06-22 16:28:00 +03:00
Andrei Klunnyi
558dfc6d9a KT-36801 IDE: Unsupported language version values 2020-06-22 13:01:42 +00:00
Alexander Gorshenev
2b2fce5949 Fix for KT-37761. Don't use mmap. It causes more troubles than it produce benefits 2020-06-22 14:53:25 +03:00
Dmitriy Novozhilov
be2ac3bb4f [FIR] Fix completing bodies of property setters with delegates 2020-06-22 12:29:26 +03:00
Dmitriy Novozhilov
8ce28cb509 [FIR] Add transformBody to FirFunction 2020-06-22 12:29:26 +03:00
Ilya Gorbunov
23dc75fb87 Remove kotlin.coroutines.experimental package descriptions 2020-06-22 12:29:26 +03:00
Ilya Gorbunov
9d111b9451 Update API dumps 2020-06-22 12:29:25 +03:00
Ilya Gorbunov
6c8ff25e5d Drop deprecated jsClass top level and extension functions
Introduce internal toplevel jsClass in js-ir source set instead.
It is needed for JS-IR backend.
2020-06-22 12:29:25 +03:00
Ilya Gorbunov
696701d377 Drop deprecated MutableMap property delegation operator 2020-06-22 12:29:25 +03:00
Ilya Gorbunov
7632910ffd Drop deprecated CollectionAssertions.kt
Remove incorrect import from callByWithEmptyVarArg test
2020-06-22 12:29:25 +03:00
Ilya Gorbunov
5550dc93a1 Remove hidden Random.Companion
It was never released as stable since 1.3. Was provided for binary
compatibility with 1.3 prereleases.
2020-06-22 12:29:25 +03:00
Ilya Gorbunov
b55729957e Drop previously deprecated API
- common and JS org.junit.Test from kotlin.test
- kotlin.Synchronized/Volatile from K/JS
- JS 'native' annotation
2020-06-22 12:29:25 +03:00
Ilya Gorbunov
e9c4f531eb Increase deprecation level for previously deprecated API
- unsupported common exceptions
- common 'synchronized'
- jquery API
- experimental kotlin.time API
- js Math object
- DefaultAsserter constructor-like fun
2020-06-22 12:29:24 +03:00
Jinseong Jeon
67044f22ed FIR serializer: regard property accessors with modifiers as non-default 2020-06-22 12:25:47 +03:00
Svyatoslav Kuzmich
bbfc1a10ad [JS] Fix stack trace capturing from secondary constructors KT-37563 2020-06-22 12:03:59 +03:00
Svyatoslav Kuzmich
6792779281 [JS IR] Fix stack trace capturing in secondary constructors (KT-37563)
Call captureStack in primary constructors and generated factories
2020-06-22 11:50:14 +03:00
Svyatoslav Kuzmich
dfdc1e9c4f [IR] Add IrRawFunctionReference 2020-06-22 11:50:14 +03:00
Roman Artemev
2c3d8feb26 [KLIB IC] Fix dirty declaration detector
- make kjs-stdlib be compiled correctly in IC mode
2020-06-22 11:30:40 +03:00
Roman Artemev
cc818025df [KLIB IC] Add test about incremental kotlin-js-stdlib-klib recompliation 2020-06-22 11:30:40 +03:00
Dmitry Petrov
a493b21c7c JVM_IR: Deprecation cycle for companion object instance visibility 2020-06-19 20:41:54 +03:00
Vladimir Ilmov
230f2f5ce0 (CoroutineDebugger) fix for debugger agent for 1.3.6 version and up 2020-06-19 18:58:46 +02:00
Yaroslav Chernyshev
c638043aee [Gradle, CocoaPods] Improved CocoaPods Integration features with tests 2020-06-19 18:36:46 +03:00
Ilya Gorbunov
130987fa1e Provide flatMapIndexed operation
- similar to flatMap, but transform function takes index and element

#KT-36894
2020-06-19 17:55:15 +03:00
Abduqodiri Qurbonzoda
db93462bcf Initial template for flatMapIndexed operation
#KT-36894
2020-06-19 17:54:47 +03:00
Sergey Igushkin
d9fea52344 Fix compilation of DukatCompilationResolverPlugin after rebase 2020-06-19 17:48:22 +03:00
Sergey Igushkin
f7b660b573 (minor) Fixes for review KT-MR-1290 2020-06-19 17:31:51 +03:00
Sergey Igushkin
10cae9bc5d Fixes for task configuration avoidance in Gradle Kotlin/JS support 2020-06-19 17:31:45 +03:00
Sergey Igushkin
0b7d8c51cb Move kotlinOptions out of the tasks 2020-06-19 17:30:12 +03:00
Sergey Igushkin
19ac036ec5 Rework ScriptingGradleSubplugin for the new subplugins API 2020-06-19 17:30:11 +03:00
Sergey Igushkin
cb5aa64a95 Rework AndroidSubplugin for the new subplugins API 2020-06-19 17:30:10 +03:00
Sergey Igushkin
48153c53ca Rework SamWithReceiverSubplugin for the new subplugins API 2020-06-19 17:30:10 +03:00
Sergey Igushkin
120f77416b (minor) Suppress a warning about property initialized with ctor param 2020-06-19 17:30:09 +03:00
Sergey Igushkin
66a59df7de Rework ExampleSubplugin for the new subplugins API 2020-06-19 17:30:09 +03:00
Sergey Igushkin
a2e4b52747 Rework SerializationSubplugin for the new subplugins API 2020-06-19 17:30:08 +03:00
Sergey Igushkin
98fc4ab2e1 Rework NoArgSubplugin for the new subplugins API 2020-06-19 17:30:07 +03:00
Sergey Igushkin
f2bc391bdd Rework AllOpenSubplugin for the new subplugins API 2020-06-19 17:30:07 +03:00
Sergey Igushkin
e8a303650c Rework Gradle subplugins application in Kotlin/Native 2020-06-19 17:30:06 +03:00
Sergey Igushkin
06a3376368 Refactor the Kotlin Android plugin to make it compliant with TCA
Also simplify some of the APIs and move some others which are only used
by kapt to the kapt's codebase.
2020-06-19 17:30:06 +03:00
Sergey Igushkin
4dbc6803ba Refactor the kapt Gradle plugin to use the new plugins API and TCA 2020-06-19 17:30:05 +03:00
Sergey Igushkin
96ed30a449 Introduce new API for Kotlin compiler support Gradle plugins
The old API was too specific for the Kotlin internal use cases and
leaked some abstractions due to the missing target-compilation project
model. One of such leaking abstractions was the Gradle tasks being
exposed to the subplugin, which required the tasks to instantiate
in order for the subplugin to apply. This violated task configuration
avoidance, so the old API could never work in compliance with TCA.

Introduce the new KotlinCompilerPluginSupportPlugin API that uses the
compilations instead of the tasks and is TCA-compliant.
2020-06-19 17:30:05 +03:00
Sergey Igushkin
0b2d96c1ef Refactor Kotlin classes registration for java-library plugin 2020-06-19 17:30:04 +03:00
Sergey Igushkin
58dd0fa3d2 Use TCA-compliant Gradle APIs in the JS part of the Kotlin Gradle plugin 2020-06-19 17:29:59 +03:00
Sergey Igushkin
58e9b3ae0e Use TCA-compliant Gradle APIs in the Kotlin Gradle plugin 2020-06-19 17:28:40 +03:00
Sergey Igushkin
84287d77ca Add Java tasks to relevant compilation APIs 2020-06-19 17:28:39 +03:00
Sergey Igushkin
1749cb9129 (minor) Initialize compilations with the precise target type 2020-06-19 17:28:39 +03:00
Sergey Igushkin
f4e4baa253 Add TaskProvider property for Kotlin compile tasks in compilations 2020-06-19 17:28:37 +03:00
Pavel Kirpichenkov
1ebb116056 Revert "Invalidate library caches on OOCBM with enabled resolution anchors"
This reverts commit 91b371789e.
^KT-39734 Open
2020-06-19 17:18:45 +03:00
Denis Zharkov
f1955c84aa FIR: Remove ignoreFrontendIR from GenerateInRangeExpressionTestData
It's unnecessary anymore since all tests are fixed
2020-06-19 17:15:56 +03:00
Sergey Rostov
6e9efefd2a gradle scripts: fix isFirstLoadActual and notification typos 2020-06-19 17:04:01 +03:00
Sergey Rostov
9f4569e5a1 gradle scripts: custom notification wording gradle with default scripting support (gradle older then 6.0) 2020-06-19 16:37:59 +03:00
Sergey Rostov
37fbc75008 gradle scripts: "link project" action implementation 2020-06-19 16:37:21 +03:00
Sergey Rostov
d6fc830c24 gradle scripts: temporary disable irrelevant actions when script configuration was not received during import 2020-06-19 16:37:21 +03:00
Dmitriy Novozhilov
a7675c16d5 [FIR] Fix problems with renaming invocationKind and field in FirAnonymousFunction 2020-06-19 16:28:07 +03:00
Mikhail Zarechenskiy
9c8e979308 Fix compatibility resolve for references with multiple outer candidates
#KT-39533 Fixed
2020-06-19 16:21:24 +03:00
Mikhail Bogdanov
58183b774d Fix test data 2020-06-19 15:07:36 +02:00
Alexey Trilis
99d844dcfb Deprecate kotlin.browser and kotlin.dom packages and provide
replacements in packages kotlinx.dom and kotlinx.browser

KT-39330 Fixed
2020-06-19 16:01:40 +03:00
Ilya Chernikov
16100843b2 Add classpaths from all plugin classloaders to the console scripts 2020-06-19 14:56:00 +02:00
Ilya Chernikov
b5ecab31f5 Load script configuration under read action - avoid possible exception 2020-06-19 14:56:00 +02:00
Dmitriy Novozhilov
bd8eaad885 [FIR-TEST] Update cfg dumps in some tests
One of previous commit changed order for those graphs, but i didn't
  find which one
2020-06-19 15:53:11 +03:00
Dmitriy Novozhilov
d01817ce14 Rename InvocationKind to EventOccurrencesRange 2020-06-19 15:53:11 +03:00
Dmitriy Novozhilov
1dfccf1416 [FIR] Rename edge kinds of control flow graph 2020-06-19 15:53:10 +03:00
Dmitriy Novozhilov
f0cc3a32d9 [FIR-TEST] Update testdata due to KT-39711 2020-06-19 15:53:10 +03:00
Dmitriy Novozhilov
64c9a83862 [FIR-TEST] Update testdata due to KT-39709 2020-06-19 15:53:10 +03:00
Dmitriy Novozhilov
a317c8a803 [FIR-TEST] Update testdata due to unresolved KT-36056 2020-06-19 15:53:09 +03:00
Dmitriy Novozhilov
26458875d5 [FIR] Add checker for uninitialized properties 2020-06-19 15:53:09 +03:00
Dmitriy Novozhilov
25621d699b Add methods for combine InvocationKind's
There is two methods added -- `or` and `and`

`or` is used by CFA for combining two kinds that came from different
edges of control flow graph

`and` is analog of `+` operator for invocation kinds
2020-06-19 15:53:08 +03:00
Dmitriy Novozhilov
4078b4b6f9 [FIR] Prepare ControlFlowAnalysisDiagnosticComponent 2020-06-19 15:53:07 +03:00
Dmitriy Novozhilov
c9bc5884dd [FIR] Add more utils for traversing control flow graph 2020-06-19 15:53:07 +03:00
Dmitriy Novozhilov
faa0f07d09 [FIR] Add utility flags to EdgeKind 2020-06-19 15:53:07 +03:00
Dmitriy Novozhilov
5ecbf8b7cd [FIR] Add CFGNodeWithCfgOwner to detect subgraphs in CFA 2020-06-19 15:53:06 +03:00
Dmitriy Novozhilov
05ee436db0 [FIR] Introduce FirControlFlowGraphOwner node 2020-06-19 15:53:06 +03:00
Dmitriy Novozhilov
8a81a09fd0 [FIR] Assume that when without branches is not exhaustive. KT-39621 2020-06-19 15:53:05 +03:00
Dmitriy Novozhilov
4e2e05e689 [FIR-TEST] Check control flow graph in old frontend diagnostic tests 2020-06-19 15:53:05 +03:00
Dmitriy Novozhilov
12ed8c3bb4 [FIR-TEST] Update CFG dumps according to new nodes order 2020-06-19 15:53:04 +03:00
Dmitriy Novozhilov
4e6542a646 [FIR] Add Stub kind for CFG
Edges of stub graphs shouldn't be completed
2020-06-19 15:53:04 +03:00
Dmitriy Novozhilov
1a0df97961 [FIR] Pop and complete graph only after adding last edge to it 2020-06-19 15:53:03 +03:00
Dmitriy Novozhilov
3765c5119f [FIR] Cache nodes in sorted order in CFG 2020-06-19 15:53:02 +03:00
Dmitriy Novozhilov
b5cceb8995 [FIR-TEST] Add validation of control flow graph nodes order 2020-06-19 15:53:02 +03:00
Dmitriy Novozhilov
2f8e95dace [FIR-TEST] Add validation for completed graph in diagnostic tests 2020-06-19 15:53:01 +03:00
Dmitriy Novozhilov
9f55d4f3cd [FIR-TEST] Mute test failing due to KT-39614 2020-06-19 15:53:01 +03:00
Dmitriy Novozhilov
87859b0faa [FIR] Introduce new algorithm for building CFG for declarations 2020-06-19 15:53:00 +03:00
Dmitriy Novozhilov
950bbfe3a5 [FIR] Add kind for back edges in CFG 2020-06-19 15:53:00 +03:00
Dmitriy Novozhilov
34be9e3569 [FIR] Add controlFlowGraph references to value parameters 2020-06-19 15:52:59 +03:00
Dmitriy Novozhilov
65fae3bb0c [FIR] Fix problem with local classes in anonymous objects 2020-06-19 15:52:58 +03:00
Dmitriy Novozhilov
5b64c0cfe2 [FIR] Add different states for CFG and some assertions for graph modification 2020-06-19 15:52:57 +03:00
Dmitriy Novozhilov
1261f62afb [FIR] Extract CFGNode and it's inheritors to separate file 2020-06-19 15:52:56 +03:00
Dmitriy Novozhilov
3a4f53682f [FIR] Don't convert non-local functions without name as FirAnonymousFunction 2020-06-19 15:52:56 +03:00
Natalia Selezneva
44f6a5adcd Filter only valid roots in KotlinScriptDependenciesClassFinder
ClassFinder should return only valid roots,
but in allScriptsDependenciesClassFiles may contain old roots
because they are persistently saved in the storage.
This may cause exception after IDE restart
2020-06-19 15:43:07 +03:00
Natalia Selezneva
d119298232 Add registry key to hide new Load Script Configurations action 2020-06-19 15:43:07 +03:00
Natalia Selezneva
b43014a097 Do not start gradle import if it is already in progress 2020-06-19 15:43:07 +03:00
Natalia Selezneva
66e23c9767 Floating notification shouldn't be shown during import
It depends on up to date check that is correct only after all caches are updated after import
2020-06-19 15:43:06 +03:00
Dmitriy Dolovov
59183a8142 [Commonizer] Replace j.u.HashMap by g.t.THashMap to reduce memory usage 2020-06-19 19:36:06 +07:00
Dmitriy Dolovov
70ea53315d [Commonizer] Intern duplicated CirContainingClassDetails instances 2020-06-19 19:18:13 +07:00
Dmitriy Dolovov
63d549dfa1 [Commonizer] Intern duplicated CirFunctionModifiers instances 2020-06-19 19:18:07 +07:00
Dmitriy Dolovov
68e1acd2cb [Commonizer] More detailed progress logging 2020-06-19 19:18:01 +07:00
Dmitriy Dolovov
6410aed1b4 Minor. Replace computeIfAbsent() by getOrPut() 2020-06-19 19:17:55 +07:00
Dmitriy Dolovov
6393667dda [Commonizer] Rework preparation of CIR cache in TypeCommonizerTest 2020-06-19 19:17:49 +07:00
Dmitriy Dolovov
5cad8a793c [Commonizer] Rework CommonizedGroup API to make it more usable 2020-06-19 19:17:43 +07:00
Dmitriy Dolovov
63575582c4 [Commonizer] Reduce memory consumption during approximation phase
^KT-39320
2020-06-19 19:17:33 +07:00
Ilya Chernikov
d5ffc7416d Clean-up and improve sam-with-receiver test with scripts 2020-06-19 14:08:19 +02:00
Ilya Chernikov
0ade8140f7 Add serialization plugin test with main-kts 2020-06-19 14:08:19 +02:00
Ilya Chernikov
dbb47cf48e Implement non-transitive dependencies resolving in main-kts 2020-06-19 14:08:19 +02:00
Ilya Chernikov
cd1bf563cd Add error reporting on the options parsing errors in scripting
also report standard parsing warnings
also fix language version test, since it is not possible anymore
  to use version 1.0
2020-06-19 13:20:58 +02:00
Mathias Quintero
f0bc52222d Fix annotation construction with array literals
Turns out the issue happens to be that ArrayValue uses a list of values which needs to be translated to an array of the percise type before it is used by callBy

This also addresses handling of arguments after a vararg in an annotation
2020-06-19 13:20:57 +02:00
Efeturi Money
8cb4f59114 Explicitly handle array annotation args in scripting pre-processing
#KT-35411 fixed
2020-06-19 13:20:57 +02:00
Ilya Muradyan
743abea690 Don't create default importing scopes for REPL snippets
Default scopes should be created only once, for the first snippet.
All following snippets should not create new default importing scopes.
#KT-35651 fixed
2020-06-19 13:03:25 +02:00
Ilya Muradyan
c3cbfe34c4 Allow not to create default importing scopes 2020-06-19 13:03:24 +02:00
Ilya Muradyan
53b31a20ca Refactor REPL IDE services testing configuration and add new tests 2020-06-19 13:03:24 +02:00
Ilya Muradyan
94de114894 Support selective filtering of implicits for extensions resolution in REPL 2020-06-19 13:03:23 +02:00
Ilya Muradyan
017f640f26 Allow skipping extensions resolution for implicit receivers 2020-06-19 13:03:23 +02:00
Mikhail Bogdanov
e93bcc55ae Revert "Deprecate DefaultImpl methods in compatibility mode"
This reverts commit 6c9c2a28
2020-06-19 12:58:46 +02:00
Mikhail Bogdanov
8bc4407be0 Fix compilation 2020-06-19 12:54:19 +02:00
Mikhail Bogdanov
6c9c2a287d Deprecate DefaultImpl methods in compatibility mode 2020-06-19 12:23:05 +02:00
Mikhail Bogdanov
9c0b96af71 Report error on missed specialization in compatibility mode
#KT-39603 Fixed
2020-06-19 11:57:36 +02:00
Mikhail Bogdanov
a150e7b6e5 Don't forget about extension parameter in methodSignatureMapping.kt 2020-06-19 11:57:36 +02:00
Mikhail Bogdanov
929bb0e8d1 Move common logic from CodegenTestCase to KotlinBaseTest 2020-06-19 11:57:36 +02:00
Mikhail Bogdanov
9d48ecfac3 Make proper check for defaults on delegation to DefaultImpls 2020-06-19 11:57:36 +02:00
Mikhail Bogdanov
b8f0ad2111 Generate nullability annotations on this receiver in DefaultImpls. Don't generate nullability annotations in private methods
#KT-36969 Fixed
2020-06-19 11:57:35 +02:00
Mikhail Bogdanov
5bdf3d5757 Don't generate compatibility stubs for @JvmDefaultWithoutCompatibility 2020-06-19 11:57:35 +02:00
Mikhail Bogdanov
477cca3c99 Add JvmDefaultWithoutCompatibility annotation 2020-06-19 11:57:35 +02:00
Dmitriy Novozhilov
a98ad79d86 [FIR-TEST] Add option to run modularized tests with checkers 2020-06-19 12:40:02 +03:00
Dmitriy Novozhilov
7a8908a75b [FIR-TEST] Change main module of [JPS] Fast FIR tests task
It's needed to correctly run FIR spec tests
2020-06-19 12:40:01 +03:00
Roman Artemev
a0cccdf75c [JS IR] Make backend work with new shared boxes 2020-06-19 12:23:15 +03:00
Roman Artemev
596c3d1af8 [JS IR] Implement shared box intrinsics translator 2020-06-19 12:23:15 +03:00
Roman Artemev
4c878c27a9 [JS IR] Introduce intrinsics to create shared boxes 2020-06-19 12:23:15 +03:00
Dmitry Savvinov
5b48845dfa Check for native-shared source-sets properly during facet import
Otherwise they are detected as common source-sets, thus getting
K2MetadataCompilerArguments (instead of FakeK2NativeCompilerArguments),
and the 'applyCompilerArgumentsToFacets' will fail due to check on
javaClass equality

^KT-39657 Fixed
2020-06-19 12:15:50 +03:00
Ilya Goncharov
ce553f1211 [Gradle, JS] Add webpackConfig for karma
#KT-39654 fixed
2020-06-19 11:38:51 +03:00
Ilya Goncharov
48a4e08d60 [Gradle, JS] Disable css support by default
#KT-39654 fixed
2020-06-19 11:38:31 +03:00
Denis Zharkov
efee0dae94 FIR: Simplify JvmBinaryAnnotationDeserializer
Currently, it's anyway created one per class
2020-06-19 10:21:09 +03:00
Denis Zharkov
0bc2642634 FIR: Add clarification to the workaround for KT-39659 2020-06-19 10:21:09 +03:00
Denis Zharkov
429b2a9705 FIR: Optimize deserialized annotations loading 2020-06-19 10:21:09 +03:00
Denis Zharkov
260e2d0dc3 FIR: Add dependency for :core:descriptors.runtime to modularized tests
Otherwise NoClassDefFoundError happens on JPS
2020-06-19 10:21:09 +03:00
Jinseong Jeon
6a28558d43 FIR deserializer: rename a callable kind that represents all "others" 2020-06-19 10:21:09 +03:00
Jinseong Jeon
12181e55c0 FIR deserializer: signature-aware annotation loading for constructors 2020-06-19 10:21:09 +03:00
Jinseong Jeon
955c7a1e5b FIR2IR: handle deserialized class reference inside GetClassCall 2020-06-19 10:21:09 +03:00
Jinseong Jeon
781bfa20e8 FIR deserializer: fix conversion of class literal inside annotation array value. 2020-06-19 10:21:09 +03:00
Jinseong Jeon
b076bec07f FIR deserializer: signature-aware annotation loading for functions 2020-06-19 10:21:09 +03:00
Ilya Kirillov
11a680d7d8 Wizard: group project templates into the categories on the first step
#KT-39700 fixed
2020-06-19 09:29:41 +03:00
Ilya Kirillov
bfedeed2c1 Wizard: use new icons in UI 2020-06-19 09:29:40 +03:00
Ilya Kirillov
7df0dd5032 Wizard: fix ui constants 2020-06-19 09:29:39 +03:00
Abduqodiri Qurbonzoda
6e5b94f695 Update js public api dump 2020-06-19 08:39:48 +03:00
Abduqodiri Qurbonzoda
c923b2e139 Deprecate contains, indexOf, lastIndexOf functions of Float/DoubleArray #KT-28753 2020-06-19 08:39:47 +03:00
Abduqodiri Qurbonzoda
97c688057d Compare floating point values asList elements in total order #KT-28753 2020-06-19 08:39:47 +03:00
Toshiaki Kameyama
ba5e643cb2 Redundant qualifier name: fix false positive with same name variable
#KT-39200 Fixed
2020-06-19 12:08:36 +07:00
Abduqodiri Qurbonzoda
bf26d87ee9 Update js public api dump 2020-06-19 04:53:54 +03:00
Abduqodiri Qurbonzoda
16b62b8e65 Introduce minWithOrNull and maxWithOrNull extension functions #KT-38854 2020-06-19 04:53:53 +03:00
Abduqodiri Qurbonzoda
194791a168 Introduce minByOrNull and maxByOrNull extension functions #KT-38854 2020-06-19 04:53:51 +03:00
Abduqodiri Qurbonzoda
846a7823ad Introduce minOrNull and maxOrNull extension functions #KT-39064 2020-06-19 04:53:49 +03:00
simon.ogorodnik
a8cd8ad8f8 [FIR] Fix testData after changing anonymous object name 2020-06-19 01:52:02 +03:00
Vladimir Ilmov
b100fd526f (CoroutineDebugger)(Test) local variable removed from generated code 2020-06-19 00:32:19 +02:00
Vyacheslav Gerasimov
5724c47bcf Build: Fix uri parsing on windows in publication repo configuration 2020-06-19 00:35:55 +03:00
Ilmir Usmanov
542f1b8709 Minor. Update tests 2020-06-18 17:53:47 +02:00
Ilya Goncharov
932cf21776 [Gradle, JS] Allow to change destDir only for separate task and name it destinationDir
#KT-38331 fixed
2020-06-18 18:51:30 +03:00
Ilya Goncharov
7386408e94 [Gradle, JS] AbstractDukatTask -> DukatTask
#KT-38331 fixed
2020-06-18 18:51:08 +03:00
Ilya Goncharov
49dd839131 [Gradle, JS] DukatTask -> IntegratedDukatTask
#KT-38331 fixed
2020-06-18 18:50:53 +03:00
Ilya Goncharov
46be588f27 [Gradle, JS] Add task for separate usage of Dukat with project npm dependencies
#KT-38331 fixed
2020-06-18 18:50:36 +03:00
Ilya Gorbunov
606fad64ad Leave StringBuilder.append/insert with non-nullable String parameter
Leave these methods as hidden in order to preserve binary compatibility.

#KT-39504
2020-06-18 18:45:43 +03:00
Pavel Kirpichenkov
91b371789e Invalidate library caches on OOCBM with enabled resolution anchors
Without forced clean stale references to declarations from source-dependent libraries
can be accessed after invalidation, i.e. resolved references can point to incorrect PSI.
TBD: more granular invalidation.

KT-24309
2020-06-18 18:27:28 +03:00
Alexander Udalov
204871a7ab Update bootstrap to 1.4.20-dev-772 2020-06-18 16:18:59 +02:00
Ilya Matveev
754a74ac4a [Gradle, native] Allow parallel in-process compiler execution
This commit allows parallel in-process execution of the K/N compiler
that was prohibited by 254a978a06.

Issue #KT-38991 fixed
2020-06-18 14:18:00 +00:00
Ilya Matveev
03bb9138ad [klib] Create ZipFileSystem from a Path instead of an URI
Calling FileSystems.newFileSystem(URI, ...) throws a
FileSystemAlreadyExistsException if a ZipFileSystem for this
URI is already created. We still can use a single instance
of ZipFileSystem by calling FileSystems.getFileSystem. In
this case we use reference counting to determine when this
instance can be safely closed.

But we cannot count references if the same ZipFileSystem is used
from different class loaders. This patch fixes this issue by
creating a file system from Path instead of an URI. Contract of
FileSystemProvider.newFileSystem(Path, ...) doesn't imply throwing
FileSystemAlreadyExistsException.

Issue #KT-37443 fixed
2020-06-18 14:17:59 +00:00
Natalia Selezneva
bf1ad44af9 Run partial import only for specified build root 2020-06-18 17:14:47 +03:00
Natalia Selezneva
5fe47ffbec Workaround for bug in GradleInstallationManager.resolveGradleVersion()
Wrong gradle version when wrapper is used
fixed in 201
2020-06-18 17:14:47 +03:00
Natalia Selezneva
7a47994498 Get gradle version and gradle home from corresponding BuildModel after import
GradleProjectSettings that were used, are updated after KotlinDslListener is called,
so it isn't correct to check if kotlinDslModels are supported using it.
Also GradleScriptDefinitionsContributor should use gradle home from BuildModel, not from settings for the same reasons.

^KT-39104 Fixed
2020-06-18 17:14:46 +03:00
Victor Petukhov
ece61915de NI: clean calls in coroutine inference before the second analysis of += only for right side
^KT-39660 Fixed
2020-06-18 17:09:59 +03:00
Vyacheslav Gerasimov
1f66049a1e Build: Fix plugin marker publication to a remote repository 2020-06-18 16:57:39 +03:00
Igor Chevdar
2fd657b768 [box-tests] Fixed test for K/N 2020-06-18 18:44:11 +05:00
Yan Zhulanow
8b5f2f9474 Fix duplicate stepping filter adding on plugin start-up (KT-38628)
Review KT-CR-1301.
2020-06-18 22:32:34 +09:00
Yan Zhulanow
235b9b9269 Add kotlin-stdlib-js and kotlin-test-js to IDE artifact dependencies 2020-06-18 22:32:34 +09:00
Pavel Kirpichenkov
470fef94fb Use bound resolution facade in DeprecationResolver usages
Resolution facade should be used consistently with direct usages of frontend components.
Otherwise they can start processing descriptors from foreign resolvers which leads to memory leaks.

Plain resolution API with provided facade is not suitable as-is for compiled declarations in KotlinIndicesHelper though.
Resolution facade for module sources contained in helper can't handle decompiled
sources from PSI indices (leads to "ModuleInfo not contained in resolver" errors).
That's why "hacked" resolve via import references should be used there.

#KT-39642 Fixed
2020-06-18 14:24:17 +03:00
Jinseong Jeon
82ef6bf96c FIR2IR: honor user-contributed members in data class if any 2020-06-18 14:23:52 +03:00
Mikhail Glukhikh
b839a91050 Mute 3 FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:39:48 +03:00
Mikhail Glukhikh
d009c90e3a Revert "Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect"
This reverts commit 3768af4f
2020-06-18 13:24:38 +03:00
Mikhail Glukhikh
3768af4f92 Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:21:35 +03:00
Mikhail Zarechenskiy
d44a7ff8f9 Add test for obsolete issue
The issue was fixed in df1595e

 #KT-39630 Fixed
2020-06-18 13:05:42 +03:00
Yan Zhulanow
559561ca6b Add missing intellij-core dependency for sam-with-receiver tests 2020-06-18 19:01:44 +09:00
Yan Zhulanow
713a305f45 Update change data for IrTextTestCaseGenerated
Reason of changes: 098469eb85
2020-06-18 19:01:06 +09:00
Ilya Gorbunov
ec5a04a6c7 Update public jvm API dump after introduction of javaType
See 9e37b62f62
2020-06-18 12:44:23 +03:00
Mikhail Zarechenskiy
a067d138e9 Enable test for new inference after df1595e4
Follow up KT-37149
2020-06-18 12:41:27 +03:00
Mikhail Zarechenskiy
df1595e4bc Fix SAM conversions for derived classes
#KT-39535 Fixed
 #KT-37149 Fixed
2020-06-18 12:36:30 +03:00
Georgy Bronnikov
ee6d432ced Add forgotten test files 2020-06-18 12:22:53 +03:00
Igor Chevdar
cf6eb138ce [box-tests] Turned on a test for JS_IR 2020-06-18 13:17:38 +05:00
Igor Chevdar
2bf73ccfe5 [IR] Supported extension receivers in SAM conversions 2020-06-18 13:17:38 +05:00
Ilya Muradyan
8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Ilya Muradyan
573c60ed6b Add missing recordLookup implementations 2020-06-18 09:51:16 +02:00
Ilya Muradyan
7526ff9484 Compare lookups without respect to their order 2020-06-18 09:51:16 +02:00
Igor Chevdar
3634ad2d54 Added a test 2020-06-18 12:44:48 +05:00
Igor Chevdar
ecf9727568 [IR] Supported IrEnumEntry
Fixes https://youtrack.jetbrains.com/issue/KT-38996
2020-06-18 12:44:48 +05:00
Ilya Gorbunov
e13a38a758 Fix OnlyInputType usage in tests where it can be invisible 2020-06-18 09:34:13 +03:00
Jinseong Jeon
9e9ca4953f FIR2IR: coerce to Unit when "when" expr is not effectively exhaustive 2020-06-18 09:23:32 +03:00
Vladimir Ilmov
62dcfcde79 (CoroutineDebugger) -core jar has precedence over -debug
#KT-39412 fixed
 #KT-39648 fixed
2020-06-17 23:48:09 +02:00
Dmitry Petrov
4739adb6dc KT-36992 Do not generate annotations on synthetic accessors
Also, do not generate nullability annotations on synthetic methods.
2020-06-17 23:54:51 +03:00
Steven Schäfer
03651f1dd4 IR: Fix inner class type parameters in IrTypeSystemContext 2020-06-17 22:10:00 +03:00
Alexander Udalov
650469024e Fix expected FQ name in JavaTypeTest.nestedTypes 2020-06-17 19:47:45 +02:00
Alexander Udalov
2be94d9d2f Fix compilation of stdlib when JDK_16 points to JDK 8+ 2020-06-17 19:46:18 +02:00
Georgy Bronnikov
c015463926 IR: remove field fake overrides 2020-06-17 20:02:26 +03:00
Georgy Bronnikov
1bb3f60bad IR: use super qualifier in Java field accesses 2020-06-17 20:02:26 +03:00
Georgy Bronnikov
36f22dafc5 IR: remove field fake override usage
Still a problem: Java static fields.
2020-06-17 20:02:26 +03:00
Ilya Gorbunov
41131e46d7 Shadow addSuppressed member with an extension
#KT-38777
2020-06-17 19:45:15 +03:00
Ilya Gorbunov
95625d0fae Do not place copyrights in stdlib api dump .kt files 2020-06-17 19:45:15 +03:00
Ilya Gorbunov
2fe222e8e7 Add SKIP_DCE_DRIVEN directive in JS-IR tests
Otherwise they fail with a compiler exception:
"An operation is not implemented: SAM conversion"
2020-06-17 19:45:15 +03:00
Ilya Gorbunov
de6154980d Make ReadOnlyProperty and PropertyDelegateProvider fun interfaces 2020-06-17 19:45:15 +03:00
Ilya Gorbunov
d2ea108123 Make Comparator fun interface in Common and JS 2020-06-17 19:45:15 +03:00
Ilya Gorbunov
388e619d90 Increase memory for Kotlin compile daemon to 2200M 2020-06-17 19:37:03 +03:00
Ilya Gorbunov
f3a2ff8646 Advance bootstrap to 1.4.20-dev-710 2020-06-17 19:37:03 +03:00
Alexander Udalov
117aae8a6b Use experimental javaType in full reflect where it's not supported yet
#KT-22936 Fixed
 #KT-34344 Fixed
2020-06-17 18:33:08 +02:00
Alexander Udalov
9e37b62f62 Support KType.javaType in stdlib
#KT-32241 Fixed
2020-06-17 18:33:08 +02:00
Dmitry Savvinov
55595fe2c6 Make sure that commonizer is enabled before adding -no-default-libs argument
^KT-39632 Fixed
2020-06-17 17:51:29 +03:00
Vladimir Ilmov
db127bb414 (CoroutineDebugger) fails to start in gradle mode
#KT-39634 fixed
2020-06-17 15:35:10 +02:00
Sergey Rostov
3d86e92bf5 gradle.kts standalone scripts: show actions inside single notification 2020-06-17 14:30:18 +03:00
Sergey Rostov
64b1cc7fd4 gradle.kts legacy: out of project script notification 2020-06-17 14:30:18 +03:00
Sergey Rostov
cc95c16ac2 minor: rename GradleScriptNotificationProvider 2020-06-17 14:30:18 +03:00
Sergey Rostov
bc16fbf438 gradle.kts: check gradle version before loading from fs cache 2020-06-17 14:30:18 +03:00
Sergey Rostov
7d31d7f20c default scripting support: remove notifications after script definitions update 2020-06-17 14:30:18 +03:00
Sergey Rostov
b9fda902fb gradle.kts: update notification only after caches updated 2020-06-17 14:30:17 +03:00
Sergey Rostov
ce20196006 GradleScriptConfigurationsImportingFeature 2020-06-17 14:30:17 +03:00
Sergey Rostov
631e68c99a gradle.kts postponed loading: hide notifaction right after click on action 2020-06-17 14:30:17 +03:00
Sergey Rostov
ace7ae19b4 gradle.kts standalone scripts: load configuration after switching without prompt 2020-06-17 14:30:17 +03:00
Sergey Rostov
07654b4c0e gradle.kts, minor: cleanup & simplify code 2020-06-17 14:30:17 +03:00
Sergey Rostov
b2e629dceb gradle.kts legacy: don't start loading without prompt on first opening 2020-06-17 14:30:17 +03:00
Sergey Rostov
0234678804 gradle.kts: update notifications when scripting support was changed 2020-06-17 14:30:17 +03:00
Sergey Rostov
caa5aadc98 GradleBuildRootsManager: check gradle version change in gradle-wrapper.properties 2020-06-17 14:30:17 +03:00
Sergey Rostov
463908f6f4 scriptConfigurationsNeedToBeUpdatedBalloon registry key 2020-06-17 14:30:17 +03:00
Sergey Rostov
cc67ac631f GradleBuildRootsManager: update notifications in corner cases
- notification for all visible editors should be updates on each change,
since it may depend on last modified ts.
- notifications should be updated only for active editors, not all opened
- we should recheck it on editor activation too
- analyzer should be restarted on roots update only
2020-06-17 14:30:16 +03:00
Sergey Rostov
a150014e74 GradleBuildRootsManager: implement getScriptFirstSeenTs 2020-06-17 14:30:16 +03:00
Sergey Rostov
b543588ccd GradleScriptNotifications: suggest to import and link gradle project 2020-06-17 14:30:16 +03:00
Sergey Rostov
9096d21fcd GradleScriptNotifications: extract and fix i18n strings 2020-06-17 14:30:16 +03:00
Sergey Rostov
632e88459e GradleBuildRootsManager: fix for autoload 2020-06-17 14:30:16 +03:00
Sergey Rostov
de7d82e42b GradleScriptNotifications: typo in code 2020-06-17 14:30:16 +03:00
Sergey Rostov
6f0bd6c122 GradleBuildRoot: ability to detect if file was existed before import 2020-06-17 14:30:16 +03:00
Sergey Rostov
7384c89ddd GradleBuildRootsManager, minor: fix notifications 2020-06-17 14:30:16 +03:00
Sergey Rostov
fd9b14ed29 GradleBuildRoot: require LastModifiedFiles explicitly 2020-06-17 14:30:16 +03:00
Sergey Rostov
2ed68643cb GradleBuildRoot: remove classes nesting 2020-06-17 14:30:15 +03:00
Sergey Rostov
d8892ced9d gradle.kts: standalone scripts support (without ui and persistence) 2020-06-17 14:30:15 +03:00
Sergey Rostov
5ed7abd15d scripting: drop ManualConfigurationLoading and kotlin.gradle.scripts.useIdeaProjectImport registry flag 2020-06-17 14:30:15 +03:00
Sergey Rostov
69dc963f97 LastModifiedFiles: fix concurrency 2020-06-17 14:30:15 +03:00
Sergey Rostov
19cc9c81dc GradleBuildRoot: std scripts under project roots should be treated as new 2020-06-17 14:30:15 +03:00
Sergey Rostov
7b1b50499d GradleBuildRoot: add projects from settings
Fir the cases when they are missed absent in imported data
2020-06-17 14:30:15 +03:00
Sergey Rostov
a3750b6419 GradleBuildRoot: extract GradleBuildRootsLocator for testing 2020-06-17 14:30:15 +03:00
Victor Petukhov
c0f4ee7dc9 Revert "Add missing definitelyDoesNotContainName methods"
This reverts commit b74692e9
2020-06-17 13:16:16 +03:00
Victor Petukhov
447308dcfc Revert "Revert "Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline"""
This reverts commit 5567033b
2020-06-17 13:02:40 +03:00
Ilmir Usmanov
1cccceabb9 Revert "Fix merging two reference values"
This reverts commit 85e2392f
2020-06-17 13:02:40 +03:00
Ilmir Usmanov
d9821412d0 Do not generate fields for unused suspend lambda parameters
This also allows us to not spill them in the lambda.
But, disable this optimization for local named functions.

 #KT-16222 In progress
2020-06-17 12:00:25 +02:00
Ilya Chernikov
a292eb865b Add script definition for extension scripts and...
IDE consoles.
2020-06-17 09:37:24 +02:00
Dmitriy Dolovov
1329030281 IDE perf tests for K/N: Re-enable PerformanceNativeProjectsTest 2020-06-17 12:03:39 +07:00
Dmitriy Dolovov
10e5dc1f63 IDE perf tests for K/N: Add assertion on failed Gradle project import 2020-06-17 12:03:33 +07:00
Dmitriy Dolovov
d9e5407ecb IDE perf tests for K/N: Switch to 1.4-M2 2020-06-17 12:03:27 +07:00
Dmitriy Dolovov
439808952d [Commonizer] Fix incorrect merging KLIB dependencies
^KT-39609
2020-06-17 11:38:27 +07:00
Victor Petukhov
901b794af3 Use lexical scope from trace during checking suspend context if the analysis of engaged parent function isn't completed
^KT-39461 Fixed
2020-06-16 22:00:04 +03:00
Dmitry Petrov
02f6a03ff7 JVM_IR: fix nullability annotations on synthetic marker parameters
Synthetic marker parameters (of type
Lkotlin/jvm/internal/DefaultConstructorMarker;) don't have annotations
(including nullability annotations).

Also, for constructor accessors corresponding parameter should be
nullable (since we pass 'null' as an argument there).

KT-36966
2020-06-16 21:29:52 +03:00
Ilya Chernikov
2656eeb164 NI: Optimize some potential hot places 2020-06-16 20:13:58 +03:00
Mikhail Glukhikh
d385a9b29e Add more detailed exception message in KtExpression.isUsedAsExpression 2020-06-16 19:17:29 +03:00
Jinseong Jeon
f64f9c2144 FIR: inherit property accessor modifiers from property and vice versa 2020-06-16 19:17:27 +03:00
Mikhail Glukhikh
6f957c7b31 Provide more accurate clash check in JsDeclarationTable 2020-06-16 19:17:26 +03:00
Mikhail Glukhikh
aaacbaaaec Add KDoc to ObsoleteDescriptorBasedAPI 2020-06-16 19:17:24 +03:00
Mikhail Glukhikh
a035404c96 Mark IrSymbolBase/IrPublicSymbolBase.descriptor as obsolete API 2020-06-16 19:17:22 +03:00
Mikhail Glukhikh
3297237f3d Drop ObsoleteDescriptorBasedAPI in ClassGenerator (module-wide) 2020-06-16 19:17:20 +03:00
Mikhail Glukhikh
175e94c0aa Revert kotlinx-serialization-compiler-plugin OptIn dependency 2020-06-16 19:17:18 +03:00
Mikhail Glukhikh
fe61530357 Declare IrGeneratorContext.builtIns as obsolete descriptor-based API 2020-06-16 19:17:16 +03:00
Mikhail Glukhikh
ab5cb13dae Rename: DescriptorBasedIr -> ObsoleteDescriptorBasedAPI 2020-06-16 19:17:14 +03:00
Mikhail Glukhikh
cbbb497edf Make descriptor-based API in ir:tree more granular 2020-06-16 19:17:12 +03:00
Mikhail Glukhikh
c4b24548cb IrValidator: report errors without rendering descriptors 2020-06-16 19:17:11 +03:00
Mikhail Glukhikh
293df7bd50 [IR BE common] Use Descriptor-based IR only in CheckIrElementVisitor 2020-06-16 19:17:10 +03:00
Mikhail Glukhikh
63394858ac Minor typo fix 2020-06-16 19:17:08 +03:00
Mikhail Glukhikh
e787dbf374 [IR.serialization.jvm] Use Descriptor-based IR in JvmIrLinker only 2020-06-16 19:17:06 +03:00
Mikhail Glukhikh
1c2fbb61fe [IR] Introduce & use declaration-based SymbolTable.withReferenceScope 2020-06-16 19:17:04 +03:00
Mikhail Glukhikh
7a0f986823 [IR] Introduce & use DescriptorBasedIr OptIn 2020-06-16 19:17:03 +03:00
Mikhail Glukhikh
67158caf73 FunctionGenerator: use owner instead of descriptor 2020-06-16 19:17:01 +03:00
Mikhail Glukhikh
41306d25fd JsDeclarationTable: drop descriptors in assertion 2020-06-16 19:16:59 +03:00
Nikolay Krasko
8e8710efec Minor: replace println() with logger 2020-06-16 18:34:40 +03:00
Victor Petukhov
982cbf1148 NI: clear calls info in coroutine inference before the second analysis of += right side
^KT-39376 Fixed
2020-06-16 18:26:59 +03:00
Nikolay Krasko
d3d3b41dea Disable all verification tasks if special option is passed 2020-06-16 18:16:27 +03:00
Ilya Chernikov
74c697af92 Fix SamWithReceiver tests for scripts, add tests...
that use new script definition and ability to load
annotations from script definition
2020-06-16 17:11:33 +02:00
Ilya Chernikov
8fb41e4562 Process compiler plugins and options in scripting compiler
#KT-37766 fixed
2020-06-16 17:11:33 +02:00
Ilya Chernikov
a72eeb800d [minor] Add serialization plugin to kotlin paths 2020-06-16 17:11:33 +02:00
Dmitry Gridin
060b2eaf27 Increase warm-up, test iterations in PerformanceTypingIndentationTest 2020-06-16 20:50:43 +07:00
Mikhail Glukhikh
ca15c33a62 [FIR] Make light tree consistent with raw FIR for empty init case 2020-06-16 15:07:01 +03:00
Ilya Muradyan
9db9e2ad57 Fix build error messages 2020-06-16 13:34:40 +02:00
Yunir Salimzyanov
71f53d49ca Revert: Bootstrap: 1.4.20-dev-498 2020-06-16 13:14:15 +03:00
Mikhail Glukhikh
d9b4e24b29 Exclude JS API dumps from FIR consistency tests 2020-06-16 12:39:26 +03:00
Ilya Goncharov
7b89717092 [Gradle, JS] Add task requirements only after evaluated 2020-06-16 11:57:33 +03:00
Ilya Goncharov
aaf3410708 [Gradle, JS] Break Task Configuration Avoidance to get all required NPM dependencies 2020-06-16 11:57:33 +03:00
Ilya Goncharov
48ec104a34 [Gradle, JS] Store npm dependencies by compilation 2020-06-16 11:57:33 +03:00
Ilya Goncharov
4080bd1325 [Gradle, JS] Move tranform from requiredNpmDependencies to TasksRequirements 2020-06-16 11:57:33 +03:00
Ilya Goncharov
8f156f3609 [Gradle, JS] Extract TasksRequirements.kt 2020-06-16 11:57:33 +03:00
Ilya Goncharov
e51874d46a [Gradle, JS] Use set in task requirements 2020-06-16 11:57:33 +03:00
Ilya Goncharov
464c8eb77a [Gradle, JS] Add kotlin-js-test-runner to dependencies by default 2020-06-16 11:57:33 +03:00
Ilya Goncharov
4a52596344 [Gradle, JS] Remove devServer from common part of legacy 2020-06-16 11:57:32 +03:00
Ilya Goncharov
1f5012684b [Gradle, JS] Force full configuring of NPM tasks in idea import 2020-06-16 11:57:32 +03:00
Ilya Goncharov
aab4fd7225 [Gradle, JS] Use unique representation for npm dependency 2020-06-16 11:57:32 +03:00
Ilya Goncharov
92c224b616 [Gradle, JS] Fix NpmDependency toString 2020-06-16 11:57:32 +03:00
Ilya Goncharov
1a81f02377 [Gradle, JS] Add tools npm dependencies as input to package json task 2020-06-16 11:57:32 +03:00
Ilya Goncharov
d0c0ddd7e5 [Gradle, JS] Move initialization of RequiresNpmDepends in project resolver 2020-06-16 11:57:32 +03:00
Ilya Goncharov
3283a10561 [Gradle, JS] Define compilation on constructor of RequiresNpmDepends 2020-06-16 11:57:32 +03:00
Ilya Goncharov
db42b5b062 [Gradle, JS] Get npm dependencies in compilation npm resolver 2020-06-16 11:57:32 +03:00
Ilya Goncharov
49710c9509 [Gradle, JS] Remove task oriented taskRequirements 2020-06-16 11:57:31 +03:00
Ilya Goncharov
8f679bf1d3 [Gradle, JS] Tools npm dependencies resolved in task execution 2020-06-16 11:57:31 +03:00
Ilya Goncharov
1ab6a9bc84 [Gradle, JS] No NPM tools configuration 2020-06-16 11:57:31 +03:00
Ilya Goncharov
34aff5953f [Gradle, JS] TaskRequirements inside NodeJsRootExtension 2020-06-16 11:57:31 +03:00
Ilya Goncharov
791dfb78ab [Gradle, JS] Dukat only for main compilation 2020-06-16 11:57:31 +03:00
Ilya Goncharov
99e05b777a [Gradle, JS] PackageJsonDukatExecutor -> DukatExecutor 2020-06-16 11:57:31 +03:00
Ilya Goncharov
10c501d474 [Gradle, JS] DukatExecutor -> DukatRunner 2020-06-16 11:57:31 +03:00
Ilya Goncharov
f5db4b12ba [Gradle, JS] Rename of DukatTaskss 2020-06-16 11:57:31 +03:00
Ilya Goncharov
cf65b1f87a [Gradle, JS] Rename on AbstractDukatTask 2020-06-16 11:57:31 +03:00
Ilya Goncharov
9f45ef8df5 [Gradle, JS] Rename DEFAULT_GENERATE_EXTERNALS 2020-06-16 11:57:30 +03:00
Ilya Goncharov
0f47a38042 [Gradle, JS] Enable Dukat by default with false generateExternals 2020-06-16 11:57:30 +03:00
Ilya Goncharov
f285a31a5a [Gradle, JS] Make default generate kotlin externals as false 2020-06-16 11:57:30 +03:00
Ilya Goncharov
2ca0e37be7 [Gradle, JS] Use default generate externals from property 2020-06-16 11:57:30 +03:00
Ilya Goncharov
eb6e797001 [Gradle, JS] In npm dependency extension use default generate value from properties 2020-06-16 11:57:30 +03:00
Ilya Goncharov
6316949e36 [Gradle, JS] Rename generateKotlinExternals on generateExternals 2020-06-16 11:57:30 +03:00
Dmitry Gridin
85840578ad Increase warm-up, test iterations in PerformanceTypingIndentationTest 2020-06-16 15:20:38 +07:00
Dmitriy Dolovov
af1dd6251e [Commonizer] Fallback for const val properties with different values 2020-06-16 15:04:08 +07:00
Yunir Salimzyanov
ee455abe52 Bootstrap: 1.4.20-dev-498
(cherry picked from commit 51d74d78c6)
2020-06-16 10:30:35 +03:00
Yunir Salimzyanov
3766dbff69 Revert "Bootstrap: 1.4.20-dev-498" 2020-06-16 10:01:58 +03:00
Steven Schäfer
846fc13519 JVM IR: Fix inline class constructor ABI (KT-37013, KT-37015) 2020-06-16 09:23:58 +03:00
Abduqodiri Qurbonzoda
b93c49afae Promote ArrayDeque and MutableList.removeFirst/LastOrNull to stable 2020-06-16 04:13:05 +03:00
Alexander Gorshenev
99c5585790 Allow dynamic types in ir fake override substitution arguments 2020-06-16 02:56:46 +03:00
simon.ogorodnik
1a7b30c13a [FIR] Fix incorrect name in anonymous object class id 2020-06-16 00:01:06 +03:00
simon.ogorodnik
2f89ba9499 [FIR] Fix incorrect referential equals on Name instance 2020-06-16 00:01:06 +03:00
Nikita Bobko
cb8addc4cd 202: Fix NPE in BaseKotlinJpsBuildTestCase.tearDown() 2020-06-15 23:22:20 +03:00
Nikolay Krasko
9cac2e1945 Minor: fix splitting the line 2020-06-15 23:22:20 +03:00
Andrei Klunnyi
1b47d538ae Flaky test fix: MultiFileHighlightingTestGenerated
This commit fixes an issue introduced in
AbstractKotlinCodeVisionProviderTest under a3c881da. Global Registry was
mistakenly used to manipulate the state of KotlinCodeVisionProvider. As
a result MultiFileHighlightingTestGenerated became unstable during the
parallel execution.
2020-06-15 19:15:54 +02:00
Yunir Salimzyanov
51d74d78c6 Bootstrap: 1.4.20-dev-498 2020-06-15 17:36:13 +03:00
Ilya Gorbunov
d5ae06e7ed Add run configuration for stdlib-js ApiTest 2020-06-15 17:18:10 +03:00
Ilya Gorbunov
05f9154bdd Use fixed versions of node.js and npm packages in tests 2020-06-15 17:18:10 +03:00
Ilya Chernikov
d7df249480 Convert contributed descriptors to list...
without this `KDocCompletionTestGenerated,testExtensionsFQLink`, which
most likely point to some broken contract in the test.
2020-06-15 16:08:41 +02:00
Kirill Shmakov
a6feae0fbb Add test for KMM Wizard 2020-06-15 16:21:41 +03:00
Kirill Shmakov
a22fb2c1ba Mention downstream usage of new wizard backend 2020-06-15 16:21:41 +03:00
Mikhail Bogdanov
fe4bb24a3e Don't use labels for caching
Avoid new objects creation
2020-06-15 15:13:10 +02:00
Mikhail Bogdanov
db50afeafe Fix compilation with ASM 8
General rule to use linkedLabel or linkWithLabel
  when label from node is reused in other instructions.
  If label is not linked then it will point to another labelNode when visited

  #KT-39013 Fixed
2020-06-15 15:13:10 +02:00
Dmitriy Novozhilov
1186d1affd [FIR-TEST] Count all ConeKotlinErrorType as error types 2020-06-15 15:32:25 +03:00
Dmitriy Novozhilov
d7ee168dff [FIR] Create error candidate for completion instead of simple error reference 2020-06-15 15:32:25 +03:00
Dmitriy Novozhilov
7c57c4a2fb [FIR] Add FirErrorProperty node 2020-06-15 15:32:24 +03:00
Ilya Gorbunov
535534cf66 Allow shadowing member addSuppressed with extension
#KT-38777
2020-06-15 14:41:48 +03:00
Kristoffer Andersen
f0ff8f202c [JVM IR] Use JVM8 support for unsigned int operations
- unmute tests
- add test to ensure JVM target is respected
- add test to cover smart-casted cases
- implement function matching and replacement
- Switching on uint constants
- introduce lowering for standard library replacements
2020-06-15 14:26:28 +03:00
Dmitry Gridin
c95216dc5d KotlinLikeLangLineIndentProvider: cleanup code
Part of #KT-22211
2020-06-15 16:25:58 +07:00
Dmitry Gridin
01707800c1 KotlinLikeLangLineIndentProvider: improve indent for braces
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:58 +07:00
Dmitry Gridin
9d6ea3c073 KotlinLikeLangLineIndentProvider: fix options for parentheses
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:57 +07:00
Dmitry Gridin
306abc79ed LineIndentProvider: support empty brackets
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:57 +07:00
Dmitry Gridin
d69ce74ca5 KotlinLikeLangLineIndentProvider: remove debug function
Part of #KT-22211
2020-06-15 16:25:57 +07:00
Dmitry Gridin
da5b2cfb64 LineIndentProvider: support inside block body between { and first statement/expression
Part of #KT-22211
2020-06-15 16:25:57 +07:00
Dmitry Gridin
63a0b5bfde KotlinLikeLangLineIndentProvider: support braces in blocks
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:57 +07:00
Dmitry Gridin
447549f20d LineIndentProvider: support declarations with body expression
Part of #KT-22211
2020-06-15 16:25:56 +07:00
Dmitry Gridin
145b2c260b indentationOnNewLine: sort tests
Part of #KT-22211
2020-06-15 16:25:56 +07:00
Dmitry Gridin
f833b4fe63 LineIndentProvider: support elvis operator
Part of #KT-22211
2020-06-15 16:25:55 +07:00
Dmitry Gridin
cf655a829c KotlinLikeLangLineIndentProvider: support options for parentheses
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:55 +07:00
Dmitry Gridin
a8cb6b2ede LineIndentProvider: add options for parentheses
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:55 +07:00
Dmitry Gridin
7c99a6fef4 LineIndentProvider: support catch and finally
Part of #KT-22211
2020-06-15 16:25:54 +07:00
Dmitry Gridin
acc15e5fad LineIndentProvider: fix for do-while
Part of #KT-22211
2020-06-15 16:25:54 +07:00
Dmitry Gridin
7a58a59114 Implement EnterBetweenBracesAndBracketsNoCommitDelegate
Part of #KT-22211
Part of #KT-39353
2020-06-15 16:25:54 +07:00
Dmitry Gridin
e72fb755a0 LineIndentProvider: support control flow constructions
Part of #KT-22211
2020-06-15 16:25:54 +07:00
Dmitry Gridin
201b115ee0 Add hack for KotlinMultilineStringEnterHandler
#KT-34566 Fixed
Part of #KT-22211
2020-06-15 16:25:53 +07:00
Dmitry Gridin
8e7bbf1780 LineIndentProvider: add restriction on position
Part of #KT-22211
2020-06-15 16:25:53 +07:00
Dmitry Gridin
c0d7e565bc add debug info
Part of #KT-22211
2020-06-15 16:25:52 +07:00
Dmitry Gridin
29ceb25f5c LineIndentProvider: support string templates
Part of #KT-22211
Relates to #KT-38248
Relates to #KT-35244
2020-06-15 16:25:17 +07:00
Dmitry Gridin
3a6b9c8d08 init line-indent-provider module
Part of #KT-22211
2020-06-15 16:25:16 +07:00
Dmitry Gridin
9d98240272 Create KotlinLineIndentProvider and delegate it to formatter
#KT-22211
2020-06-15 16:24:31 +07:00
Dmitriy Dolovov
0f10faabbf [Commonizer] More precise approximation of callables 2020-06-15 16:11:49 +07:00
Dmitriy Dolovov
205510863a [Commonizer] Stats collector: support aggregated stats 2020-06-15 16:11:34 +07:00
Dmitriy Dolovov
f7ceacb15c [Commonizer] Update stats collector: report receivers & parameters 2020-06-15 16:11:23 +07:00
Dmitriy Dolovov
077853d2ad Minor. Add words to project dictionary 2020-06-15 16:11:15 +07:00
Dmitriy Dolovov
3b4cef1b56 Minor. Rename excludes list 2020-06-15 16:11:06 +07:00
Anton Bannykh
cbabb4f76a JS stdlib api test: various changes
- Setting -Doverwrite.output=true updates gold data
- Big packages don't get split into chunks
- Unique lines in the API are marked with /*∆*/ and diff test is removed
- Annotations on separate lines and other dump format tweaks
- Test data moved to libraries/stdlib/api/
- Minor visibility fix to Enum members
2020-06-15 11:49:15 +03:00
Denis Zharkov
7b61bf9178 FIR: Add nullability smartcast after !is check
^KT-39072 Fixed
2020-06-15 11:33:42 +03:00
Denis Zharkov
24948a8b3f FIR: Fix incorrect handling bare types when subject is type alias
^KT-39043 Fixed
2020-06-15 11:33:42 +03:00
Vyacheslav Gerasimov
063c973eaa Build: Rename empty marker jar to avoid collision with main jar 2020-06-15 00:32:04 +03:00
Vyacheslav Gerasimov
852dcedb86 Build: Remove marker task dependencies from gradle integration tests 2020-06-14 21:04:34 +03:00
Vyacheslav Gerasimov
5689a2c67a Build: Fix kotlin-jsr223-daemon-local-eval-example test runtime 2020-06-14 20:31:29 +03:00
Vyacheslav Gerasimov
38416e7e30 Build: Fix kotlin-compiler-embeddable test runtime 2020-06-14 20:31:29 +03:00
Vyacheslav Gerasimov
ef48c38eb4 Build: Fix kotlin.kotlin-scripting-jsr223-tes test runtime 2020-06-14 20:31:29 +03:00
Vyacheslav Gerasimov
07e18654d9 Build: Fix tests compilation in kotlin.idea.idea-frontend-fir 2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov
3e3afac407 Build: Fix pom runtime scope for kotlin-klib-commonizer 2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov
a5e9e1e9be Build: Specify Locale.ROOT for humanReadableName generation 2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov
567aabeced Build: Fix kotlin-reflect publication 2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov
b0c9b88485 Build: Disable sha512 checksums generated by maven-publish
They are not handled properly by bintray
https://github.com/gradle/gradle/issues/11412

#KTI-222
2020-06-14 20:31:28 +03:00
Vyacheslav Gerasimov
f9ec4f7d5c Build: Generate human readable project name from gradle project id 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
b4df4e5525 Build: Fix variant resolution ambiguity 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
eeb2f7d3d1 Build: Migrate plugin markers to maven-publish publication 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
da6c2ddb2f Build: Migrate stdlib & kotlin-test to maven-publish publication 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
f4e8c21309 Build: Introduce new software component for publishing
Some of our published modules don't have javaComponent
2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
e3111730ac Build: Extract publishing logic to the KotlinBuildPublishingPlugin 2020-06-14 20:31:27 +03:00
Vyacheslav Gerasimov
40dfb2a438 Build: Add additional configuration lambda to the publish helper 2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
e3f1ddefd0 Build: Add modularJar helper 2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
4925ca2c9a Build: Fix receiver for configure* helpers in commonConfiguration.gradle 2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
9faf088c96 Build: Disable automated publishing setup for kotlin-gradle-plugin
We have our own publishing configured in the `publish` helper which
conflicts with automated publishing of `java-gradle-plugin`
2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
4aa3040550 Build: Use runtimeOnly instead of deprecated runtime
maven-publish plugin uses `runtimeOnly` for runtime scope instead of
`runtime`
2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
8737168d41 Build: Use maven-publish in configurePublishing helper 2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
94b4f4a91a Build: Remove configureJvmProject helper for groovy script
It duplicates allprojects configuration done in root project
2020-06-14 20:31:26 +03:00
Vyacheslav Gerasimov
c2589c7d6d Build: Rename javadocJar for groovy to configureJavadocJar
So it doesn't interfere with javadocJar task accessor
2020-06-14 20:31:25 +03:00
Vyacheslav Gerasimov
d711086be2 Build: Publish Kotlin artifacts with maven-publish plugin 2020-06-14 20:31:25 +03:00
Vyacheslav Gerasimov
b85b733e42 Build: Remove explicit legacy maven plugin application 2020-06-14 20:31:25 +03:00
Vyacheslav Gerasimov
410c5f3e69 Build: Remove artifact configuration out of lazy lambda
It may not be executed leading to misconfiguration
2020-06-14 20:31:25 +03:00
Nikita Bobko
b43ff7fbf9 Don't show KDoc references in Call Hierarchy
^KT-39558 Fixed
2020-06-13 17:52:17 +03:00
Alexey Kudravtsev
a79efd0768 filter out references in javadoc to fix IDEA-185139 A method's call hierarchy shows also references 2020-06-13 17:52:16 +03:00
Georgy Bronnikov
89aa15c419 JVM_IR: implement isCompiledToJvm8OrHigher on IrClass 2020-06-13 12:45:00 +03:00
Georgy Bronnikov
8037baf307 IR: add SourceElement reference to IrClass 2020-06-13 12:44:59 +03:00
Georgy Bronnikov
811e8d0f24 JVM_IR: remove one usage of descriptors from AnnotationCodegen 2020-06-13 12:44:59 +03:00
Georgy Bronnikov
58a9c0c996 JVM_IR: remove descriptor usage from IrTypeMapper 2020-06-13 12:44:59 +03:00
Lilia
c875c30f2c Add changelog for 1.4-M2 2020-06-12 14:17:22 +02:00
Alexander Udalov
2bf31ae3c3 IR: minor reformat of IdSignature 2020-06-11 21:42:45 +02:00
Alexander Udalov
d8aee421ac IR: don't store isPublic as field in IdSignature 2020-06-11 21:42:44 +02:00
Alexander Udalov
3154eca218 IR: use String instead of FqName in IdSignature.PublicSignature
FqName/FqNameUnsafe tend to eagerly compute things like
safe/parent/shortName which take a lot of space.

This change helps to lower strongly reachable memory just before codegen
in JVM IR by about 5% on a relatively big project.
2020-06-11 21:42:44 +02:00
Alexander Udalov
d24e136ba8 Minor, make IdSignature.PublicSignature not a data class 2020-06-11 21:42:44 +02:00
Igor Chevdar
8b37a094fe Added a test on possible name clash for SAM wrappers 2020-06-11 23:00:36 +05:00
Igor Chevdar
66bbd3e102 [IR] Improved tuning of SAM wrapper visibility 2020-06-11 23:00:32 +05:00
Nicolay Mitropolsky
1b1e579cbf 201: Uast: fixing KotlinUastGenerationTest by using system-independent inline unaware asRecursiveLogString 2020-06-11 19:34:55 +03:00
Yunir Salimzyanov
b8597b48f1 Fix removed negation in 9b77c2d
KTI-267
2020-06-11 19:06:49 +03:00
Alexander Udalov
01b6142500 Revert changes from 6e67e1e78d in Gradle integration tests
To fix the JPS build.
2020-06-11 17:26:10 +02:00
Nikolay Krasko
5d827d9b5c AS41: Disable all tests in idea-gradle and idea-gradle-native (KTI-281)
There's some problem with searching for Android SDK

junit.framework.AssertionFailedError: Import failed: The showAndGet() method is for modal dialogs only
java.lang.IllegalStateException: The showAndGet() method is for modal dialogs only
	at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1656)
	at com.android.tools.idea.gradle.project.sync.SdkSync$FindValidSdkPathTask.findValidSdkPath(SdkSync.java:263)
	at com.android.tools.idea.gradle.project.sync.SdkSync$FindValidSdkPathTask.lambda$selectValidSdkPath$0(SdkSync.java:254)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:480)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:124)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:80)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:128)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:184)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	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.defaultDispatchEvent(IdeEventQueue.java:974)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847)
	at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
	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)

	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.TestCase.fail(TestCase.java:227)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemImportingTestCase.handleImportFailure(ExternalSystemImportingTestCase.java:648)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemImportingTestCase.doImportProject(ExternalSystemImportingTestCase.java:639)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemImportingTestCase.importProject(ExternalSystemImportingTestCase.java:465)
	at org.jetbrains.kotlin.idea.codeInsight.gradle.GradleImportingTestCase.importProject(GradleImportingTestCase.kt:234)
	at org.jetbrains.kotlin.ide.konan.gradle.GradleNativeLibrariesInIDENamingTest.testLibrariesNaming(GradleNativeLibrariesInIDENamingTest.kt:35)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.jetbrains.kotlin.test.RunnerFactoryWithMuteInDatabase$createRunnerForTestWithParameters$1$methodInvoker$1.evaluate(muteWithDatabase.kt:236)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.jetbrains.kotlin.test.RunnerFactoryWithMuteInDatabase$createRunnerForTestWithParameters$1.access$runChild$s-1623866647(muteWithDatabase.kt:214)
	at org.jetbrains.kotlin.test.RunnerFactoryWithMuteInDatabase$createRunnerForTestWithParameters$1.runChild(muteWithDatabase.kt:221)
	at org.jetbrains.kotlin.test.RunnerFactoryWithMuteInDatabase$createRunnerForTestWithParameters$1.runChild(muteWithDatabase.kt:214)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:412)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)
2020-06-11 17:44:50 +03:00
Konstantin Tskhovrebov
032d017c4f Revert "Add tests for setup native run gutters."
This reverts commit d61e40e4
2020-06-11 17:28:14 +03:00
Ilya Chernikov
d528d24f83 Optimize AllUnderImportScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov
484d026d2f Optimize resolution scope queries from the synthetic scopes
now required descriptors are queried in advance and passed to the
methods, to avoid multiple same name queries in a row
2020-06-11 16:16:15 +02:00
Ilya Chernikov
a0efd1e323 Optimize scopes handling inside ChainedMemberScope 2020-06-11 16:16:15 +02:00
Ilya Chernikov
3da6ff7ec3 Optimize scopes handling inside LexicalChainedScope 2020-06-11 16:16:14 +02:00
Ilya Chernikov
bf97323301 Optimize data handling inside scopes 2020-06-11 16:16:14 +02:00
Ilya Chernikov
c720fa5793 Optimize LazyScopeAdapter internals 2020-06-11 16:16:14 +02:00
Ilya Muradyan
c2ede13d5a Fix importing scopes problem for scripting REPL
We don't need to add any importing scopes for a snippet if it doesn't
contain import directives. This fix optimizes performance by reducing
importing scopes count.
2020-06-11 16:16:13 +02:00
Ilya Muradyan
b74692e96b Add missing definitelyDoesNotContainName methods
Some implementations of definitelyDoesNotContainName method were
missing that led to performance problems during symbols resolution
using TowerResolver.

Relates to KT-39139.
2020-06-11 16:16:13 +02:00
Ilya Muradyan
262e21fcbc Add overload to comply with the contract
Method getVariableNames() should return all variable names, but in the
inherited implementation it doesn't return resX names which represent
result fields.
2020-06-11 16:16:12 +02:00
Ilya Muradyan
6da22414dc [minor] Fix typo in comment 2020-06-11 16:16:12 +02:00
Toshiaki Kameyama
4d2caa8e76 KT-33211 Quickfix "add parameter" for method references should infer functional type instead of KFunction (#2664)
* "Add parameter to function" quick fix: add function type instead of KFunction for method references

#KT-33211 Fixed

* Support suspend function references
2020-06-11 17:01:07 +03:00
Alexander Udalov
6e67e1e78d Replace appendln with appendLine in project 2020-06-11 13:01:30 +02:00
Natalia Selezneva
d1c88798df Load script definitions only from production source root and libraries
Exclude not connected to current project roots

EA-210662 Fixed
2020-06-11 13:43:57 +03:00
Ilya Kirillov
2d5b50531d FIR IDE: fix AbstractFirLazyResolveTest
It uses fir reference implementations which are not in the classpath
2020-06-11 12:45:41 +03:00
Toshiaki Kameyama
46907f861a Extend Selection: don't select lambda parameters if lambda is multiple lines (#2586)
#KT-29364  Fixed
2020-06-11 12:20:32 +03:00
Toshiaki Kameyama
232be94738 Smart enter: support get() clause (#2630)
#KT-31500 Fixed
2020-06-11 12:16:04 +03:00
Toshiaki Kameyama
cbbdec5898 Change Signature: enable on primary constructor keyword (#2482)
#KT-19744 Fixed
2020-06-11 12:10:12 +03:00
Toshiaki Kameyama
957a927790 KT-15846 'Change lambda expression return type' quick fix does nothing (#3182)
* Change parameter type quickfix: fix it works correctly on property delegate

#KT-15846 Fixed

* Change parameter type quickfix: fix it works correctly when function literal has trailing comments

#KT-15846 Fixed
2020-06-11 12:07:44 +03:00
Denis Zharkov
5ab05e6e47 FIR: Fix incorrect resolution to synthetic property by implicit receiver
When there's an explicit one

^KT-39028 Fixed
2020-06-11 11:31:39 +03:00
Denis Zharkov
293f78efe8 FIR: Correct capturing for type-alias bases arguments
NB: The test data change at testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.fir.kt
is correct: see the relevant non-fir test, the call shouldn't be applicable

^KT-39008 Fixed
2020-06-11 11:31:38 +03:00
Denis Zharkov
bea37569e6 FIR: Fix processOverriddenFunctions implementations 2020-06-11 11:31:36 +03:00
Denis Zharkov
28627e9754 FIR: Minor. Clarify naming for unwrapping overrides 2020-06-11 11:31:35 +03:00
Denis Zharkov
89cbe9bf93 FIR: Pull down FirScope.processOverriddenFunctions 2020-06-11 11:31:33 +03:00
Denis Zharkov
6178cb7206 FIR: Get rid of last usages of FirScope.processOverriddenFunctions 2020-06-11 11:31:32 +03:00
Denis Zharkov
72b09ff323 FIR: Rename FirSuperTypeScope and reuse it for type parameter type
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
2020-06-11 11:31:31 +03:00
Denis Zharkov
0bd2a74542 FIR: Add FirTypeScope
^KT-35495 Relates
2020-06-11 11:31:29 +03:00
Denis Zharkov
38922a84f1 FIR: Do not create synthetic properties for non-Java accessors
^KT-35495 Fixed
2020-06-11 11:01:43 +03:00
Denis Zharkov
6a1f921a5c FIR: Introduce FirScope.processOverriddenFunctions
^KT-35495 In Progress
2020-06-11 11:01:43 +03:00
Denis Zharkov
8447f512b4 Minor. Drop unused FirSyntheticPropertiesScope.synthetic 2020-06-11 11:01:43 +03:00
Jinseong Jeon
ab2a2b3a87 FIR2IR: eager conversion of annotations in Library class and members 2020-06-11 10:57:51 +03:00
Jinseong Jeon
fd32e918d5 FIR deserializer: signature-aware annotation loading for property accessors 2020-06-11 10:57:51 +03:00
Jinseong Jeon
2d55b8db07 FIR deserializer: build property accessors if non-default ones exist 2020-06-11 10:57:51 +03:00
Vladimir Dolzhenko
369c08214b Add quick isCheapEnoughToSearch check to AddFunctionParametersFix 2020-06-11 09:45:21 +02:00
Nikita Bobko
a63f83ab15 Get rid of usages of internal LibraryImpl class
KT-39327
2020-06-10 22:20:53 +03:00
Alex Plate
801c97f456 Use ModuleOrderEntry instead of ModuleOrderEntryImpl
`isProductionOnTestDependency` function was moved from implementation to
interface. The fix is important for the new IJ project model.
2020-06-10 22:19:41 +03:00
Nikolay Krasko
bc20464bad 202: Restrict compatibility for 201 plugin 2020-06-10 18:05:53 +03:00
Vladimir Dolzhenko
76d819f66d Drop typo and fix fir package imports in GenerateTests.kt.192 2020-06-10 17:03:05 +02:00
Mathias Quintero
e45e491718 Add options param to external dependencies resolver API 2020-06-10 16:28:41 +02:00
Mathias Quintero
83087291df Add API to get locations of collected script annotations
#KT-38404 fixed

also:
- Add wrapper class for the location combined with the location id
- Add source code location parameters to external dependency resolvers
- Add tests for locations in annotations
- Add tests for order of annotation resolution for dependencies resolvers
2020-06-10 16:28:41 +02:00
Andrey
1539128c3f Delete module kotlin-build-common included twice (#3459)
kotlin-build-common included twice in includes
2020-06-10 16:39:07 +03:00
Mikhail Zarechenskiy
3921a0ed70 Add test for obsolete issue
#KT-17341 Obsolete
 #KT-32958 Obsolete
2020-06-10 16:00:23 +03:00
Konstantin Tskhovrebov
d61e40e49b Add tests for setup native run gutters. 2020-06-10 15:58:47 +03:00
Konstantin Tskhovrebov
39e1f03cd1 Fix for 192: enable native run gutters only if gradle plugin exists.
Fixed #KT-39465
2020-06-10 15:58:45 +03:00
Vasily Levchenko
25f0e38c73 [inliner] parent fix after copy
this change fix issue with inlining lambda in inline function which(function) inlined from other library.
E.g.

> cat i-lib.kt
class _special_class(val v:Int)
class _special_class1(val v:Int)

class __helper(val v:Int)

inline fun foo(h: __helper): Int {
    val sum = h.op {
        _special_class(it.v)
    }.v
    return sum
}

inline fun __helper.op(block:(_special_class1) -> _special_class) = block(_special_class1(v))

> cat i-main.kt
fun main() {
    val h = __helper(42)
    println(foo(h))
}

Here how the incorrect parent affects debug information:

(lldb) target create "program.kexe"
Current executable set to '/Users/minamoto/ws/kotlin-native/program.kexe' (x86_64).
(lldb) command source -s 0 'i-test.lldb'
Executing commands in '/Users/minamoto/ws/kotlin-native/i-test.lldb'.
(lldb) b i-lib.kt:8
Breakpoint 1: where = program.kexe`kfun:#main(){} + 435 [inlined] foo + 98 at i-main.kt:3, address = 0x00000001000540e3
(lldb) r
Process 70550 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x00000001000540e3 program.kexe`kfun:#main(){} [inlined] foo at i-lib.kt:9:7
   6       inline fun foo(h: __helper): Int {
   7           val sum = h.op {
   8               _special_class(it.v)
-> 9           }.v
              ^
   10          return sum
   11      }
   12
Target 0: (program.kexe) stopped.

the parent of lambda is i-main.kt instead of i-lib.kt, and offsets calculated against wrong file.
Here is behaviour with fix:

(lldb) target create "program.kexe"
Current executable set to '/Users/minamoto/ws/.git-trees/minamoto/debug-info/subprograms-with-missed-scopes/program.kexe' (x86_64).
(lldb) command source -s 0 '/Users/minamoto/ws/kotlin-native/i-test.lldb'
Executing commands in '/Users/minamoto/ws/kotlin-native/i-test.lldb'.
(lldb) b i-lib.kt:8
Breakpoint 1: where = program.kexe`kfun:#main(){} + 337 [inlined] <anonymous>_2 at i-lib.kt:14, address = 0x0000000100054bb1
(lldb) r
Process 70560 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100054bb1 program.kexe`kfun:#main(){} [inlined] <anonymous>_2 at i-lib.kt:8:24
   5
   6       inline fun foo(h: __helper): Int {
   7           val sum = h.op {
-> 8               _special_class(it.v)
                               ^
   9           }.v
   10          return sum
   11      }
Target 0: (program.kexe) stopped.
2020-06-10 14:29:13 +02:00
Vladimir Dolzhenko
163bd34172 Fixed GenerateTests.kt.192 compilation
Relates to #KTI-17
2020-06-10 14:16:55 +02:00
Ilya Goncharov
18914ac9a5 [Gradle, JS] Fix name of publication in both mode 2020-06-10 14:52:35 +03:00
Ilya Goncharov
60d62148e8 [Gradle, JS] Fix isMain in js targets 2020-06-10 14:48:29 +03:00
Ilya Goncharov
b72f7c3021 [Gradle, JS] Remove Native Only isMainCompilation only 2020-06-10 14:48:29 +03:00
Ilya Goncharov
2d068a42f4 [Gradle, JS] Use common isMain for KotlinCompilation 2020-06-10 14:48:29 +03:00
Dmitriy Dolovov
24568058e1 Minor. Remove unused code 2020-06-10 18:41:05 +07:00
Dmitriy Dolovov
84a4644490 [Commonizer] Speed-up serialization of commonized member scopes 2020-06-10 18:15:12 +07:00
Nikolay Krasko
974e01ec70 Fix bunch files after moving plugin.xml 2020-06-10 13:01:20 +03:00
Nikolay Krasko
6babc73320 AS41: Fix problems with initialization of Android plugin in tests
org/intellij/images/fileTypes/ImageFileTypeManager
java.lang.NoClassDefFoundError: org/intellij/images/fileTypes/ImageFileTypeManager
	at org.jetbrains.android.AndroidPlugin.lambda$registerWebpSupport$1(AndroidPlugin.java:50)
2020-06-10 13:01:20 +03:00
Nikolay Krasko
7190b3400f 202: Fix compilation in DefaultDiagnosticReporter 2020-06-10 12:39:29 +03:00
Nikita Bobko
ff7576f8e4 202: Fix compilation 2020-06-10 12:39:29 +03:00
Nikita Bobko
eb67c4519d 202: Fix compilation because of CoreJarVirtualFile
CoreJarVirtualFile is now package private. And seems that
most of VirtualFiles return system independent path
2020-06-10 12:39:28 +03:00
Nikolay Krasko
256bd8d594 202: Disable check for broken plugins in tests
Otherwise is is an exception in PluginManagerCore
because of brokenPlugins.txt file.
2020-06-10 12:39:28 +03:00
Nikolay Krasko
143cad78bf 202: Add fastutil dependency to compiler for to make proguard work 2020-06-10 12:39:27 +03:00
Nikolay Krasko
cc709a2ef9 202: Update dependencies 2020-06-10 12:39:27 +03:00
Nikolay Krasko
8485532856 202: Update to the latest EAP 2020-06-10 12:39:26 +03:00
Ilya Goncharov
fdbdc5aac7 [Gradle, JS] Fix error message for both executable 2020-06-10 11:26:22 +03:00
Pavel Kirpichenkov
83144d59be Fix tests 2020-06-10 10:58:42 +03:00
Mads Ager
dc34d355bc [JVM_IR] Generate line numbers and nops for init blocks.
This seems to be what JVM does and it allows you to set a
breakpoint on the init line.
2020-06-10 08:05:52 +02:00
Ilmir Usmanov
85e2392fef Fix merging two reference values
In this case, make the result of value type Object instead of unknown.
2020-06-09 20:52:29 +02:00
Ilmir Usmanov
5567033b33 Revert "Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline""
This reverts commit 822c14814b.
2020-06-09 20:52:24 +02:00
Alexander Udalov
e801fad4d4 Minor, unmute test on fun interface inheritance for FIR 2020-06-09 20:00:37 +02:00
Alexander Udalov
e3a23aed33 Minor, remove unneeded check in ClosureCodegen
Actually we do need to generate delegates to DefaultImpls even for Java
SAM wrappers, so this condition is incorrect. However, this never worked
properly anyway because of KT-12466.
2020-06-09 19:56:27 +02:00
Mikhail Zarechenskiy
93e9d3e57d Delay check for possibly deferred return type for reference candidate
This issue appeared after recently added new overload for flatMapTo.
 Before that, we picked candidate returning List<T> and completed
 inference, now we also check one more flatMapTo, which is here is
 incorrect and as a result we go into outer scope. Outer scope contains
 one property with deferred type, which introduced error about
 "typechecker has run into recursive problem" even it isn't applicable
 by receiver.

 So, the fix is to check receiver first and only then check return
 type of a candidate.

 #KT-39470 Fixed
2020-06-09 17:36:58 +03:00
Konstantin Tskhovrebov
21f7cd5d8f Add test for check expect/actual gutters at same module. 2020-06-09 16:28:28 +03:00
Konstantin Tskhovrebov
a6161c6f22 Fix expect/actual gutters for declarations in the same module.
Fixed #KT-33510.
2020-06-09 16:28:27 +03:00
Ilya Kirillov
3b422377d2 FIR IDE: move validation contract to analysis session base class 2020-06-09 16:20:26 +03:00
Ilya Kirillov
fb8acf8c1e FIR IDE: add tests for call resolve 2020-06-09 16:20:26 +03:00
Ilya Kirillov
8ac0466ec2 FIR IDE: resolve constructors to correct CallInfo 2020-06-09 16:20:25 +03:00
Ilya Kirillov
87a65c0e4b FIR IDE: throw PCE in highlighter & reference resolver if on EDT thread
As resolve is not allowed in EDT thread
2020-06-09 16:20:25 +03:00
Ilya Kirillov
19043537c1 FIR IDE: make API functions that returns types return non-null value 2020-06-09 16:20:24 +03:00
Ilya Kirillov
ee22d0b938 FIR IDE: introduce TypeInfo as a wrapper for types in high level API
Needed for correct handling types lifecycle
2020-06-09 16:20:24 +03:00
Ilya Kirillov
115327b967 FIR IDE: add validation contract to analysis session
This contract ensures that analysis session is used:
  * in read action
  * in non-EDT
  * Project has not changed since the session was created
2020-06-09 16:20:23 +03:00
Ilya Kirillov
71b916ae8f FIR IDE: rename AnalysisSessionFirImpl -> FirAnalysisSession 2020-06-09 16:20:20 +03:00
Ilya Kirillov
52a422350b FIR IDE: always invalidate PSI -> FIR caches on any change 2020-06-09 16:20:14 +03:00
Ilya Kirillov
c3f547ec77 FIR IDE: add missing runtime dependencies 2020-06-09 16:20:13 +03:00
Ilya Kirillov
7ac48f441d FIR IDE: remove enabled/disable FirResolution by registry
This separation is made based on plugins now
2020-06-09 16:20:07 +03:00
Ilya Kirillov
19d721d262 FIR IDE: mute not passing tests 2020-06-09 16:20:02 +03:00
Ilya Kirillov
d317ee1197 FIR IDE: move highlighting to fir ide module
As it doesn't use fir directly
2020-06-09 16:20:00 +03:00
Ilya Kirillov
a62c0e8163 FIR IDE: introduce fir lower level module 2020-06-09 16:19:58 +03:00
Ilya Kirillov
c1a62e2f05 Fix import optimizer test after reference classes rename 2020-06-09 16:19:57 +03:00
Ilya Kirillov
858b053134 FIR IDE: do not run fir tests in non FIR IDE plugin 2020-06-09 16:19:57 +03:00
Ilya Kirillov
dbfa43a60a FIR IDE: remove unneeded dependencies of idea-fir & idea-frontend-fir modules 2020-06-09 16:19:56 +03:00
Ilya Kirillov
1b8ea31172 FIR IDE: ignore not passing highlighting tests 2020-06-09 16:19:56 +03:00
Ilya Kirillov
65b22ebfa9 FIR IDE: improve search of containing declaration for getOrBuildFir 2020-06-09 16:19:55 +03:00
Ilya Kirillov
918e4ef7d0 FIR IDE: remove checker/duplicateJvmSignature tests for FIR as duplicate signature is not implemented for fir ide yet 2020-06-09 16:19:48 +03:00
Ilya Kirillov
00a271dd94 FIR IDE: Remove IGNORE_FIR from passing tests 2020-06-09 16:19:48 +03:00
Ilya Kirillov
c6ae916b24 FIR IDE: Fix tests in idea-fir 2020-06-09 16:19:47 +03:00
Ilya Kirillov
ba7e953760 FIR IDE: Introduce plugin.xml for fir ide 2020-06-09 16:19:45 +03:00
Ilya Kirillov
72175fc40e Fix idea.xml 2020-06-09 16:19:45 +03:00
Ilya Kirillov
bd12b37353 FIR IDE: Move ApplicationUtils to frontend independent module 2020-06-09 16:19:44 +03:00
Ilya Kirillov
a4f8c6734c FIR IDE: Introduce ide-frontend-independent.xml extensions 2020-06-09 16:19:43 +03:00
Ilya Kirillov
66d44162e9 FIR IDE: Move common caches related stuff from plugin-common.xml to caches.xml 2020-06-09 16:19:42 +03:00
Ilya Kirillov
3ca317e0ce FIR IDE: Split resources to three folders which is needed for FIR plugin
The "resources" is common for both plugins,
 while resources-descriptors & resources-fir belongs
 to corresponding plugins
2020-06-09 16:19:39 +03:00
Ilya Kirillov
2290c32a83 FIR IDE: Move idea related stuff from plugin-common.xml to idea.xml 2020-06-09 16:19:33 +03:00
Ilya Kirillov
3e25375013 FIR IDE: Move jps related stuff from plugin-common.xml to jps.xml 2020-06-09 16:19:32 +03:00
Ilya Kirillov
2c0e14ba92 FIR IDE: Move index related stuff from plugin-common.xml to indexes.xml 2020-06-09 16:19:32 +03:00
Ilya Kirillov
e06f297499 FIR IDE: Move inspections from plugin-common.xml to inspections.xml 2020-06-09 16:19:31 +03:00
Ilya Kirillov
d46088548d FIR IDE: Implement FIR reference resolve for some kinds of references
* implement for:
   * KtForLoopInReference
   * KtInvokeFunctionReference
   * KtPropertyDelegationMethodsReference
   * KtDestructuringDeclarationReference
2020-06-09 16:19:30 +03:00
Ilya Kirillov
30eab6c8a3 FIR IDE: Implement search of psi elements for deserialized Kotlin declarations
Fix "FIR IDE: Implement search of psi elements for deserialized Kotlin declarations"
2020-06-09 16:19:29 +03:00
Ilya Kirillov
a8b94b1cca FIR IDE: Move some declarations highlighting to before resolve highlighting pass 2020-06-09 16:19:28 +03:00
Ilya Kirillov
f37e313705 FIR IDE: Begin implementing semantic highlighting via FIR
* Introduce frontend api module & implement api for FIR
* Implement some basic declaration highlighting for FIR
2020-06-09 16:19:27 +03:00
Ilya Kirillov
507fc34c22 FIR: fix incorrect psi for named & spread arguments in FIR builder 2020-06-09 16:19:26 +03:00
Ilya Kirillov
6a4fa8de9d FIR IDE: Move base part of highlighting to frontend-independent-module 2020-06-09 16:19:25 +03:00
Ilya Kirillov
77550186ad FIR IDE: Move KDoc Reference & mainReference to frontend-independent module 2020-06-09 16:19:18 +03:00
Ilya Kirillov
45ef0e1b50 FIR IDE: Move fir resolving functionality from idea module to idea-frontend-fir 2020-06-09 16:19:14 +03:00
Ilya Kirillov
003827a4f2 FIR IDE: Start IDEA FIR plugin 2020-06-09 16:19:13 +03:00
Ilya Kirillov
418903e9ef FIR IDE: Make KtReference class descriptors frontend independent
* The new idea-frontend-independent module created
* Moved KtReference and it inheritors to that module & implement them in idea-analysis module by using descriptors frontend
2020-06-09 16:19:12 +03:00
Alexander Udalov
6adad1055b JVM IR: generate delegates to DefaultImpls for fun interfaces 2020-06-09 11:49:45 +02:00
Alexander Udalov
fc1217ba07 Generate delegates to DefaultImpls in fun interface wrappers
#KT-37436 Fixed
2020-06-09 11:44:31 +02:00
Alexander Udalov
77e479fda8 JVM IR: generate InnerClasses attribute for nested classes in annotation arguments
#KT-38853
2020-06-09 11:33:27 +02:00
Alexander Udalov
2793187bda Handle IllegalArgumentException in trimMargin intrinsics on JVM
#KT-38537 Fixed
2020-06-09 11:11:06 +02:00
Mikhail Glukhikh
261ed46341 IR metadata source: do not require descriptor in property metadata 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh
6f0eeecc64 [FIR2IR] Fix generation of type arguments of delegated constructor calls 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh
5c6f40b34a IR metadata source: extract & use declaration name 2020-06-09 11:40:26 +03:00
Mikhail Glukhikh
b2c78e490e [FIR2IR] Remove some descriptor-around calls 2020-06-09 11:40:25 +03:00
Ilya Chernikov
69d5635aae [minor] Fix textdata after reapplying commit w\ CompilerMessageLocation 2020-06-09 10:34:38 +02:00
Dmitriy Novozhilov
802272a579 Enable ContractsOnCallsWithImplicitReceiver in 1.4
#KT-28672 Fixed
2020-06-09 11:21:57 +03:00
Vladimir Dolzhenko
6478525666 Fixed GenerateCompilerTestsAgainstKlib.kt compilation
Relates to #KTI-17
2020-06-09 09:52:14 +02:00
Vladimir Dolzhenko
3817f7f044 Fixed GenerateKotlinpTests compilation
Relates to #KTI-17
2020-06-09 09:03:35 +02:00
Dmitriy Dolovov
9936468a5e [Commonizer] Update stats collector to report lifted up declarations 2020-06-09 11:13:04 +07:00
Dmitriy Dolovov
611946a7c7 [Commonizer] Drop useless annotation tests
^KMM-238
^KMM-53
2020-06-09 11:12:59 +07:00
Dmitriy Dolovov
596363ea23 [Commonizer] Refactor/simplify marker interfaces 2020-06-09 11:12:55 +07:00
Dmitriy Dolovov
f3b400975e [Commonizer] Drop useless "allowPrivate" flag in VisibilityCommonizer 2020-06-09 11:12:50 +07:00
Dmitriy Dolovov
d9bfe11ca1 [Commonizer] Source-based tests on lifting up identical type aliases
^KMM-55
2020-06-09 11:12:45 +07:00
Dmitriy Dolovov
e5885e9277 [Commonizer] Unit tests on lifting up identical type aliases
^KMM-55
2020-06-09 11:12:41 +07:00
Dmitriy Dolovov
d3c6dc362e [Commonizer] Lift up identical type aliases
^KMM-55
2020-06-09 11:12:36 +07:00
Dmitriy Dolovov
e37a485aaa [Commonizer] Process expect/actual cross-module dependencies in source-based tests 2020-06-09 11:12:31 +07:00
Dmitriy Dolovov
c8ba3fa8ed [Commonizer] Clean-up in AbstractCommonizationFromSourcesTest 2020-06-09 11:12:26 +07:00
Dmitriy Dolovov
5076f981a6 Minor. Add "kotlinx" and "cinterop" to project dictionary 2020-06-09 11:12:21 +07:00
Dmitriy Dolovov
e51c7a79c7 [Commonizer] Minor. Fixed typo 2020-06-09 11:12:16 +07:00
Dmitriy Dolovov
3654da8a63 [Commonizer] Minor. Improve error reporting 2020-06-09 11:12:12 +07:00
Dmitriy Dolovov
be9e25a2e5 [Commonizer] Move fqNameWithTypeParameters extension val into CirType 2020-06-09 11:12:07 +07:00
Dmitriy Dolovov
719d5da641 [Commonizer] Move some extension functions into CirFunctionOrProperty 2020-06-09 11:12:02 +07:00
Dmitriy Dolovov
da9e0d3c02 [Commonizer] Simplify detection if property is lifted up 2020-06-09 11:11:52 +07:00
Vladimir Ilmov
50165397c7 (CoroutineDebugger) flaky test coroutine-debug library changed to 1.3.4 2020-06-08 22:54:09 +02:00
Vladimir Dolzhenko
9319c4c96e DryRun mode for GenerateTests is added
Relates to #KTI-17
2020-06-08 19:05:10 +00:00
simon.ogorodnik
cd9273028b Profiling and repeat support for JVM CLI Compiler 2020-06-08 20:40:27 +03:00
Alexander Gorshenev
ce1ef6c159 Fixing a bug with private accessors in IR fake override construction 2020-06-08 17:07:06 +03:00
Mikhail Glukhikh
89e5e10657 [FIR2IR] Drop effectively unused FirMetadataSource.File.descriptors
NB: only FileClassLowering uses this property to check
whether facade is required, and IR-based check is enough in this lowering
2020-06-08 16:19:37 +03:00
Mikhail Glukhikh
6eab6a96cb [FIR2IR] Support type aliases properly 2020-06-08 16:19:37 +03:00
Andrei Klunnyi
6485869659 AbstractKotlinCodeVisionProviderTest has no test methods actually 2020-06-08 13:54:37 +02:00
Konstantin Tskhovrebov
c3802891fc Hide commonizer import error message for unsupported kotlin plugin. 2020-06-08 13:11:08 +03:00
Mikhail Glukhikh
8677d63003 [FIR2IR] Re-use FakeOverrideGenerator for external classes 2020-06-08 12:11:34 +03:00
Jinseong Jeon
ba1172b3ad FIR2IR: distinguish substitution case when adding external fake overrides 2020-06-08 12:11:34 +03:00
Mikhail Glukhikh
538535c3b7 [FIR2IR] Introduce & use declaration-based SymbolTable.enter(leave)Scope 2020-06-08 12:11:34 +03:00
Mikhail Glukhikh
e593c7270f [FIR2IR] Use specific symbols for enum entries 2020-06-08 12:11:34 +03:00
Mikhail Glukhikh
0770a6f848 [FIR2IR] Drop yet-unused local declaration symbols 2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
3567880303 [FIR] Consider enum entry nested classes as local 2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
8a456f578d [FIR mangler] Handle parent type aliases properly
NB: Normally parent class-like must be a class,
but in expect-actual situation it may appear to be an actual type alias.
2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
5603afbd20 FirClassSubstitutionScope: handle fake override local eff. visibility 2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
21498359e4 FirClassSubstitutionScope: extract 'configureAnnotationsAndParameters' 2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
7bd872b264 [FIR2IR] Restore container source related logic 2020-06-08 12:11:33 +03:00
Mikhail Glukhikh
0c41fcba6a [FIR2IR] Use signature composer only for non-local declarations 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
55b7cf0dda [FIR2IR] Extract declareIr<SomeDeclaration> 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
6d8b0f5566 [FIR2IR] Provide correct callable ids for fake overrides 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
dc660e72e5 [IR] Don't store descriptor in IR function to allow lazy initialization 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
de2980e9e5 [FIR2IR] Use specific symbols for class declarations 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
85801ea62c [FIR2IR] Use specific symbols for callable declarations 2020-06-08 12:11:32 +03:00
Mikhail Glukhikh
c7041c0f1a [FIR2IR] Add signature to all symbols 2020-06-08 12:11:31 +03:00
Mikhail Glukhikh
d4cb6b68c4 [FIR2IR] Introduce own symbol implementations 2020-06-08 12:11:31 +03:00
Mikhail Glukhikh
529c73d58d [FIR2IR] Introduce abstract bindable symbol 2020-06-08 12:11:31 +03:00
Vladimir Ilmov
9719391c82 (PerformanceTest) improvements in profiler snapshots
support for typing per inspection tests
 gradle arguments fixed to allow running tracing from cli
 Profiler disabled for warmup phases.

 relates to #KT-38653
2020-06-08 09:05:24 +02:00
Jinseong Jeon
0d2552b0b6 FIR: record and serialize the modifier "fun" for functional interface 2020-06-08 09:42:32 +03:00
Abduqodiri Qurbonzoda
6a2fed33d3 Deprecate old CharArray to String conversion api #KT-31343 2020-06-08 04:12:28 +03:00
Vladimir Dolzhenko
19855c5bd5 Tweaked performance-tests stats output 2020-06-07 23:03:04 +02:00
Pavel Kirpichenkov
8216e5cd72 Avoid persisting default anchor configuration
#KT-24309 In Progress
2020-06-07 21:24:45 +03:00
Yunir Salimzyanov
b8cbfcbe7e Revert "Add temporary fixMeExtensions to pass test on extensions check"
KTI-267
2020-06-07 10:49:55 +03:00
Yunir Salimzyanov
571cab305c Cleanup as35 patchset logic (KTI-267) 2020-06-07 10:49:55 +03:00
Yunir Salimzyanov
dce19b0ace Cleanup 191 patchset logic (KTI-267) 2020-06-07 10:49:55 +03:00
Abduqodiri Qurbonzoda
820353ee0e Promote scanReduce deprecation level to error 2020-06-07 10:05:40 +03:00
Abduqodiri Qurbonzoda
4e820edd1f Promote randomOrNull, reduceOrNull, scan to stable 2020-06-07 10:05:38 +03:00
Abduqodiri Qurbonzoda
094dbf4c2d Remove experimental status from Array.associateWith 2020-06-07 10:05:36 +03:00
Vladimir Ilmov
db0788c68f (LightClass) KotlinShortNamesCacheTest fix for methods, referenced from companions and classes 2020-06-06 23:48:15 +02:00
Vladimir Ilmov
8f00344191 (UnusedSymbolInspection) optimized path for data-classes 2020-06-06 23:48:15 +02:00
Vladimir Dolzhenko
0f73cdeccb Add ability to skip stats for performance tests if there is a custom stats name 2020-06-06 22:02:30 +02:00
Anton Bannykh
bd2a0563ad JS: fix explicit cross-module SAM constructor calls 2020-06-06 13:20:37 +03:00
Ilya Muradyan
489290263f Add info about the end of range in scripting REPL compiler messages 2020-06-05 21:58:28 +02:00
Ilya Chernikov
5e33612238 Extract interface from CompilerMessageLocation to ease extension
The CompilerMessageLocation is an implicit part of the binary daemon
protocol so changing it breaks compatibility with older daemons.
This change allows to extend location for non-daemon uses without
breaking the binary protocol.
2020-06-05 21:58:27 +02:00
Ilmir Usmanov
f1906bc966 Minor. Update test 2020-06-05 21:55:34 +02:00
Ilmir Usmanov
f0006f2405 Minor. Add regression test
#KT-39374 Fixed
2020-06-05 21:30:24 +02:00
Andrei Klunnyi
a3c881da59 KT-38027 Support Code Vision feature in Kotlin // experimental status
Feature received "experimental" status due to the low performance.
The root cause is slow find-usages functionality the feature is based
on. Once the later is improved Code-Vision should be revisited.

Previous commit of KT-38027 series contains production ready state.

To launch performance check again one needs to enable Code Vision in
AbstractPerformanceProjectsTest.setUp() with the following fun:

private fun enabledCodeVision() {
  val codeVisionProvider = KotlinCodeVisionProvider()
  val settings = codeVisionProvider.createSettings().apply {
     showUsages = true
     showInheritors = true
  }

  InlayHintsSettings.instance().storeSettings(codeVisionProvider.key,
   KotlinLanguage.INSTANCE, settings)
}
2020-06-05 19:15:38 +02:00
Andrei Klunnyi
b08f501aac KT-38027 Support Code Vision feature in Kotlin 2020-06-05 19:15:34 +02:00
Roman Golyshev
4c8f9e4e06 KT-39311 Fix fix.change.package.family bundle message
- ^KT-39311 Fixed
2020-06-05 19:37:35 +03:00
Svyatoslav Scherbina
46caf27e70 Add "Remove annotation" quickfix for @Throws override mismatch 2020-06-05 19:07:56 +03:00
Svyatoslav Scherbina
6461c1b4f1 Add "Remove annotation" quickfix for empty @Throws 2020-06-05 19:07:54 +03:00
Svyatoslav Scherbina
b7a08494ae Add quickfix for adding CancellableException to @Throws suspend fun 2020-06-05 19:07:52 +03:00
Svyatoslav Scherbina
290a824107 Add basic support for Native in idea/testdata/multiModuleQuickFix 2020-06-05 19:07:50 +03:00
Abduqodiri Qurbonzoda
46297645a4 Promote String <-> utf8 and CharArray conversions to stable 2020-06-05 18:41:06 +03:00
simon.ogorodnik
ab02381a83 [FIR] Make overriding generic callables independent of TP bounds order 2020-06-05 17:46:35 +03:00
simon.ogorodnik
2287435740 [FIR] KT-39033: Fix generic property override detection
#KT-39033 Fixed
2020-06-05 17:46:35 +03:00
Toshiaki Kameyama
e4a1c8dcef Anonymous function to lambda: add lambda parameter if type parameter is used, even if parameter is unused
#KT-39393 Fixed
2020-06-05 17:32:35 +03:00
Roman Artemev
311b2d7969 [PLUGIN API] Make context provide information about target platform 2020-06-05 17:14:33 +03:00
Jinseong Jeon
89c87f941f FIR: consider the absence of type arguments when constructing GetClassCall type 2020-06-05 17:00:17 +03:00
Mikhail Zarechenskiy
a086d9f7df Update forgotten FIR test 2020-06-05 16:30:09 +03:00
Mikhail Zarechenskiy
6c5806f971 Add test for obsolete issue
#KT-38161 Obsolete
2020-06-05 16:30:08 +03:00
Roman Golyshev
f9b3daabd1 Change testData for ShortenRefsTestGenerated to not use sql package
- Those packages are missing in the mockJdk 1.8 in intellij repository,
and it leads to those tests failing in kotlin-ide repository
- Test in `ShortenRefsTestGenerated` do not fail, but they are working
for the wrong reason (they do not shorten unresolved references)
2020-06-05 16:03:51 +03:00
Roman Golyshev
7d662bf5d1 Change testData for IntentionsTestGenerated to avoid using javax and sql packages
- Those packages are missing in the mockJdk 1.8 in intellij repository,
and it leads to those tests failing in kotlin-ide repository
2020-06-05 16:03:51 +03:00
Mikhail Zarechenskiy
22b558110d Don't apply Unit-conversion for expressions that return Nothing type 2020-06-05 15:59:31 +03:00
Vladimir Ilmov
3634cbe3cb (LightClasses) resolve of annotations fast-path 2020-06-05 13:27:10 +02:00
Vladimir Ilmov
991f12bd73 (LightClasses) while looking for accessors we expect them to be taken from single class 2020-06-05 13:27:09 +02:00
Vladimir Ilmov
c0144d2161 (LightClasses) minor improvement in annotation order check 2020-06-05 13:27:09 +02:00
Dmitry Petrov
4e7901b807 Bootstrap: 1.4.20-dev-117 2020-06-05 14:12:13 +03:00
Mikhail Zarechenskiy
fb812301b2 Add test to preserve behaviour
It's important to have ambiguity in these cases to introduce overload
 resolution by suspend-modifier without breaking changes in future

 Relates to #KT-23610
2020-06-05 14:07:08 +03:00
Mikhail Zarechenskiy
e72401c5f4 Don't allow coercing receivers from signed to unsigned constants 2020-06-05 13:24:22 +03:00
Mikhail Zarechenskiy
bfa648972f Introduce call checker for Unit-conversions 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy
6b0a803d14 Allow suspend-conversion for callable references as part of adaptation 2020-06-05 13:24:21 +03:00
Mikhail Zarechenskiy
6b58be377e Fix chained conversions for subtypes of functional types 2020-06-05 13:24:20 +03:00
Mikhail Zarechenskiy
71cbe97688 Introduce Unit-conversions for simple arguments 2020-06-05 13:24:20 +03:00
Mikhail Zarechenskiy
f08a45f2d4 Refactoring: rename files to avoid "util" suffixes 2020-06-05 13:24:19 +03:00
Mikhail Zarechenskiy
a4af833d55 Narrow down the range for compatibility warning to callee expression 2020-06-05 13:24:19 +03:00
Mikhail Zarechenskiy
4bd622c1c5 Refactoring: rename method to make it more specific 2020-06-05 13:24:18 +03:00
Mikhail Zarechenskiy
718f23b34f Compatibility warning for references to companion via name (KT-13934) 2020-06-05 13:24:18 +03:00
Dmitry Gridin
3fdf048e51 Regenerate Serialization* tests 2020-06-05 17:13:28 +07:00
Pavel Kirpichenkov
8ca5d3b6f9 Update library to source analysis mode configuration
Persist analysis flag in the same xml where anchor mapping reside instead
of using properties. This makes it possible to save config in VCS.

#KT-24309 In Progress
2020-06-05 11:14:02 +03:00
Pavel Kirpichenkov
8ed4424e3e Clean up API of AbstractResolverForProject
Resolution anchors are IDE-specific.
Creating dedicated methods for them in AbstractResolverForProject leads to meaningless
implementation in non-IDE resolvers. Now this method is implemented only
for IDE resolver and accessed through JvmPlatformParameters.

#KT-24309 In Progress
2020-06-05 11:14:01 +03:00
Ilya Goncharov
80a310540e [Gradle, JS]Remove failed on variant aware resolution tests on kotlin2js
Because kotlin2js is deprecated, it is not actual to support tests which are failed because changes in Gradle.
Seems kotlin2js doesn't and didn't and work with Gradle > 5.3
2020-06-05 10:50:08 +03:00
Dmitriy Novozhilov
ee3beea327 [FIR] Cache files with plugin annotations 2020-06-05 10:34:01 +03:00
Dmitriy Novozhilov
6c5181d8ce [FIR-PLUGIN] Add status transformer for default visibility 2020-06-05 10:34:01 +03:00
Dmitriy Novozhilov
1f80f35ce6 [FIR] Don't cache importing scopes while resolving plugin's annotations 2020-06-05 10:34:01 +03:00
Dmitriy Novozhilov
1ffe438fa1 [FIR-PLUGIN] Update AllOpenStatusTransformer according to previous commit 2020-06-05 10:34:00 +03:00
Dmitriy Novozhilov
514cbc77fc [FIR] Add owners to FirStatusTransformerExtension.transformStatus 2020-06-05 10:34:00 +03:00
Dmitriy Novozhilov
b79d6aced4 [FIR] Add resolve phase for resolving arguments of plugin's annotations 2020-06-05 10:34:00 +03:00
Dmitriy Novozhilov
73b738b7ff [FIR] Replace resolved flag with resolve status enum for annotation calls 2020-06-05 10:33:59 +03:00
Vladimir Ilmov
4f1b7b38b2 (Resolve) lightweight resolve annotations
relates to #KT-38653
2020-06-05 00:19:16 +02:00
Toshiaki Kameyama
46ab338ea6 "Convert anonymous function to lambda expression" intention: add necessary lambda type parameter
#KT-37748 Fixed
2020-06-04 23:38:29 +03:00
Dmitry Petrov
d27c7ce86f Bootstrap: 1.4.20-dev-65 2020-06-04 22:28:36 +03:00
Ilmir Usmanov
8cc5f2abfb Forbid val field initialization inside EXACLTY_ONCE lambda
unless the lambda is inline. This way, final field will remain final.
2020-06-04 21:26:48 +02:00
Vyacheslav Karpukhin
6d6a228057 Android import: binary-compatible setting of the BuildType attribute 2020-06-04 20:57:54 +02:00
Vyacheslav Karpukhin
39a3f5e7d9 Android import: better value source for BuildTypeAttr 2020-06-04 20:57:54 +02:00
Vyacheslav Karpukhin
1f638f52d5 Android import: setting BuildType attribute for kotlin android compilations 2020-06-04 20:57:54 +02:00
Sergey Igushkin
e4e70f1b5b VariantAwareDependenciesIT.kt: remove compile/runtime/... configurations 2020-06-04 20:42:12 +03:00
Steven Schäfer
3291cf7a6e JVM IR: Mark lateinit fields as NotNull
This is needed for compatibility with the JVM backend.
2020-06-04 17:52:56 +02:00
Sergey Igushkin
52b29b53bc Fixup BuildCacheRelocationIT: Gradle 5.6.1 -> 5.6.4 (AGP requirement) 2020-06-04 17:53:15 +03:00
Mikhail Glukhikh
6ad37eb7a8 Unmute two more FIR BB tests 2020-06-04 17:26:27 +03:00
Mark Punzalan
802beb49a6 Use TypeSubstitutor to get the substituted underlying type for inline
classes, instead of MemberScope.

The primary motivation was to fix issues around type-mapping for inline
classes in FIR, which uses wrapped descriptors that have empty
MemberScopes.
2020-06-04 17:03:55 +03:00
Mikhail Glukhikh
88b130308d Revert accidental test data change introduced in 0d6e3093 2020-06-04 16:34:40 +03:00
Mikhail Glukhikh
0ce47f2f12 [FIR TEST] Mute 2 BB tests broken by 0d6e3093 2020-06-04 16:34:39 +03:00
Alexander Udalov
5647a935a2 JVM IR: do not generate DefaultImpls delegate for collection fake overrides
In the newly added test, prior to this change, JVM IR was generating
DefaultImpls classes with calls to things like
`kotlin/collections/MutableList$DefaultImpls.spliterator` and other
default methods present in JDK 8+. This obviously didn't make much
sense. Although these weren't explicitly mentioned anywhere in the
bytecode, they caused some validation tools to report errors (e.g.
animalsniffer used in arrow).
2020-06-04 14:27:46 +02:00
Vladimir Ilmov
47c25982b6 (ResolveElementCache) KtAnnotationEntry resolveToDescriptor added 2020-06-04 14:23:45 +02:00
Ilya Goncharov
c5aa35e016 [Gradle, JS] All regular text printed to DEBUG 2020-06-04 15:02:56 +03:00
Ilya Goncharov
97e4d23d75 [Gradle, JS] Filter warning with source maps
#KT-39377 fixed
2020-06-04 15:02:54 +03:00
Ilya Goncharov
69b9a2e98a [Gradle, JS] Remove trailing commas from webpack config
#KT-39377 fixed
2020-06-04 15:02:39 +03:00
Ilya Goncharov
4bbead6200 [Gradle, JS] Remove custom source-map-loader
#KT-39377 fixed
2020-06-04 15:02:12 +03:00
Nikita Bobko
a94d2211e4 Cleanup getLineCount 2020-06-04 14:56:23 +03:00
Sergey Igushkin
603bae398f Fix BuildCacheIT and BuildCacheRelocationIT
* Adjust the log checks for newer Gradle versions
* Use AGP 3.6.0 and Gradle 5.6.1 as the older version
2020-06-04 10:41:25 +00:00
Florian Kistner
71a45e56d7 Don't apply copyright notice to Kotlin Ultimate 2020-06-04 12:22:51 +02:00
Dmitry Petrov
de25359a90 Fix stdlib compilation after updated @JvmName check
Previously, extension receiver type was not taken into account when
checking for @JvmName annotation applicability to possibly mangled
functions (such functions, however, were mangled).
This bug was fixed, but, unfortunately, not before such functions were
added to stdlib ('sumOf' family).
2020-06-04 12:16:28 +03:00
Dmitry Petrov
202bbdf8dd Forward compatibility hacks for Result.{success, failure}
Don't mangled functions annotated with @JvmName.
Annotate 'Result.success' and 'Result.failure' with @JvmName and
@Suppress("INAPPLICABLE_JVM_NAME").
NB this would require bootstrap.
2020-06-04 12:16:27 +03:00
Ilya Kirillov
8a4521864e Wizard: use cache redirector on project importing tests 2020-06-04 12:00:42 +03:00
Ilya Kirillov
cce5a9a1ca Wizard: download latest dev version for tests from bintray 2020-06-04 12:00:42 +03:00
Mikhail Glukhikh
1ea72ec378 Fix test data in FIR diagnostic test (merge with local eff. visibility) 2020-06-04 10:35:01 +03:00
Ilya Goncharov
74e4a817cb [Gradle, JS] Fix test after changing type of IR link task on mode 2020-06-04 10:24:06 +03:00
Jinseong Jeon
0d6e309372 FIR: construct type with actual type arguments during GetClassCall transformation 2020-06-04 10:13:37 +03:00
Mikhail Bogdanov
4f8ad6bdcb Remove compatibility hack 2020-06-04 08:01:30 +02:00
Valeriy.Vyrva
c023a02884 Create SortedMap with Comparator and items
KT-34142
2020-06-04 02:04:22 +03:00
Abduqodiri Qurbonzoda
e3fb74b656 Promote KClass.cast/safeCast, KAnnotatedElement.hasAnnotation() to stable 2020-06-03 23:50:48 +03:00
Dmitry Petrov
a4b9e8fdc6 Minor: mute test in JS_IR 2020-06-03 23:24:16 +03:00
Georgy Bronnikov
0db02926f5 JVM_IR: remove descriptors from MethodSignatureMapper 2020-06-03 22:42:02 +03:00
Georgy Bronnikov
77c20066a8 JVM_IR: implement getJvmModuleNameForDeserialized in MethodSignatureMapper 2020-06-03 22:42:02 +03:00
Georgy Bronnikov
80afe42d17 JVM_IR: implement getJvmNameIfSpecial in MethodSignatureMapper 2020-06-03 22:42:02 +03:00
Pavel Kirpichenkov
986b13c3a1 Optimize synchronization for resolution anchors
Use volatile state instead of synchronized access to it.
This should be enough as the component's state is only read
by the component users and never changed.
2020-06-03 20:58:07 +03:00
Pavel Kirpichenkov
175fe163af Add cancelation check when building anchor mappings 2020-06-03 20:58:07 +03:00
Pavel Kirpichenkov
7fff8f82e2 Changes after review
- Replace leaking ModuleResolverTracker with use of ModuleDescriptor.Capabilies
- Provide API for retrieving ResolverForProject from ResolutionFacade
- Update names
2020-06-03 20:58:07 +03:00
Pavel Kirpichenkov
db1210fc67 Introduce components for library-to-source resolution in IDE
#KT-24309 In progress
2020-06-03 20:58:07 +03:00
Yan Zhulanow
0b2c9ff77a IDE plugin dependencies: publish kotlin-main-kts artifact 2020-06-04 02:49:42 +09:00
Ilmir Usmanov
822c14814b Revert "Completely rewrite reifiedIntTypeAnalysis, making it more streamline"
This reverts commit 1ed4324613.

Otherwise, bootstrap is broken.
2020-06-03 19:43:59 +02:00
Toshiaki Kameyama
148f49d54a UselessCallOnCollectionInspection: fix false positive when lambda last statement is function call that returns generic type
#KT-38267 Fixed
2020-06-03 20:42:42 +03:00
Vyacheslav Gerasimov
3c8ef5749f Build: Remove identifying info from build scans 2020-06-03 19:04:07 +03:00
Sergey Igushkin
35b1bb05c8 Merge KT-MR-1260 from rr/gradle/igushkin/fix-kt-39304-unused-source-sets-failure 2020-06-03 14:32:53 +00:00
Anton Bannykh
a18bfad53a Add stdlib API test + remove some extra IR stdlib API's 2020-06-03 17:14:29 +03:00
Ilmir Usmanov
1ed4324613 Completely rewrite reifiedIntTypeAnalysis, making it more streamline
and easy to understand and optimize if it would be a bottleneck.
Use LVT to get information of refined int type in one specific case

 #KT-38925 Fixed
2020-06-03 16:03:50 +02:00
Ilmir Usmanov
0e908b720d Replace SourceInterpreter with specific one in tail-call optimization 2020-06-03 16:03:49 +02:00
Ilmir Usmanov
3fa9ea9bc0 Remove unreachable instructions 2020-06-03 16:03:48 +02:00
Ilmir Usmanov
ea60b83f16 Fix merging two sources with same type 2020-06-03 16:03:48 +02:00
Ilmir Usmanov
cd0e218a07 Rewrite RedundantLocalsEliminationMethodTransformer
Use specific interpreter instead of SourceInterpreter.
2020-06-03 16:03:48 +02:00
Ilmir Usmanov
f247ea7c27 Replace SourceInterpreter with a specific one in coroutines inlining 2020-06-03 16:03:48 +02:00
Dmitry Petrov
99a1ef0460 Minor: mute test in JS_IR 2020-06-03 16:09:52 +03:00
Ilya Goncharov
426f164e02 [Gradle, JS] Webpack on file providers for task configuration avoidance 2020-06-03 15:59:33 +03:00
Ilya Goncharov
01f3e4b083 [Gradle, JS] Make destinationDir as var 2020-06-03 15:59:33 +03:00
Ilya Goncharov
402dfd5da7 [Gradle, JS] Use RegularFile to not explicit dependsOn
^KT-32273 fixed
^KT-36451 fixed
^KT-37258 fixed
2020-06-03 15:59:33 +03:00
Ilya Goncharov
e27bd04ba2 [Gradle, JS] Add dependency on dce task
^KT-32273 fixed
^KT-36451 fixed
^KT-37258 fixed
2020-06-03 15:59:32 +03:00
Ilya Goncharov
d3260bca27 [Gradle, JS] JsBinaryType to KotlinJsBinaryType 2020-06-03 15:59:32 +03:00
Ilya Goncharov
d27ad99daa [Gradle, JS] KotlinJsType to KotlinJsMode 2020-06-03 15:59:32 +03:00
Ilya Goncharov
a5e46568ee [Gradle, JS] Move common part of webpack configuration to separate fun
^KT-32273 fixed
^KT-36451 fixed
^KT-37258 fixed
2020-06-03 15:59:32 +03:00
Ilya Goncharov
ef63d6f84c [Gradle, JS] Add resolveFromModulesFirst to build tasks 2020-06-03 15:59:32 +03:00
Ilya Goncharov
d4d8495840 [Gradle, JS] Use property for webpack entry 2020-06-03 15:59:32 +03:00
Ilya Goncharov
65db6bb2a5 [Gradle, JS] Add dce to development
^KT-32273 fixed
^KT-36451 fixed
^KT-37258 fixed
2020-06-03 15:59:31 +03:00
Ilya Goncharov
9d8eb65a5e [Gradle, JS] Use API form Gradle 5.0 2020-06-03 15:59:31 +03:00
Dmitry Petrov
ba43ee8410 Handle error type in SamType 2020-06-03 15:57:24 +03:00
Svyatoslav Kuzmich
b0445496bb [JS] Autogenerate and mute missing test 2020-06-03 15:19:36 +03:00
Svyatoslav Kuzmich
af13ae1ef2 [JS] Add klib to kostlin-stdlib-js.jar distribution
Fixes KTI-177 and KT-35857
2020-06-03 14:16:46 +03:00
Igor Yakovlev
ebae6332aa Fix invalid resources placement
For ExpandBooleanExpressionIntention and RedundantAsSequence intention
2020-06-03 14:02:58 +03:00
Dmitriy Novozhilov
f2d0d8b422 [FIR-PLUGIN] Add test for supertype modification extension 2020-06-03 13:10:17 +03:00
Dmitriy Novozhilov
dae2acca88 [FIR] Remove useless hack for builtins from supertype resolution 2020-06-03 13:10:17 +03:00
Dmitriy Novozhilov
9fa4ff750b [FIR] Fix ArrayMapImpl.iterator() 2020-06-03 13:10:17 +03:00
Dmitriy Novozhilov
15d85bdc05 [FIR] Add extension for adding new supertypes 2020-06-03 13:10:17 +03:00
Dmitriy Novozhilov
0c18cb054d [FIR-PLUGIN] Add tests for generating declarations from plugin 2020-06-03 13:10:17 +03:00
Dmitriy Novozhilov
eceeacdf61 [FIR] Change nested class generation extension to generate top-level classes also 2020-06-03 13:10:16 +03:00
Dmitriy Novozhilov
9cc13c8324 [FIR-PLUGIN] Add dummy implementation for nested class generator extension 2020-06-03 13:10:16 +03:00
Dmitriy Novozhilov
8acdb39bdd [FIR-PLUGIN] Add dummy implementation for member generator extension 2020-06-03 13:10:16 +03:00
Dmitriy Novozhilov
1b120c189e [FIR] Record generated classes in FirProvider 2020-06-03 13:10:16 +03:00
Dmitriy Novozhilov
ed55e84afa [FIR] Distinct declarations found by FirPredicateBasedProvider 2020-06-03 13:10:15 +03:00
Dmitriy Novozhilov
87f0f123a8 [FIR] Add extension for generating new members for existing classes 2020-06-03 13:10:15 +03:00
Ilya Goncharov
bd194686df [Gradle, JS] Add index.html to Kotlin DSL wizard
^KT-39275 fixed
2020-06-03 12:58:59 +03:00
Toshiaki Kameyama
6cb0190fad FoldInitializerAndIfToElvis: should not add new line for multiline initializer
#KT-35805 Fixed
2020-06-03 12:35:50 +03:00
Roman Artemev
5eae262264 [PLUGIN API] Implement custom linkage for plugin extensions 2020-06-03 12:17:14 +03:00
Roman Artemev
a401374ed4 [PLUGIN API] Add extension point to customize linkage process 2020-06-03 12:17:14 +03:00
Roman Artemev
f9c2c846f7 [IR] Move IrProvider and 'IrDeserializer' into separate package 2020-06-03 12:17:14 +03:00
Henrik Tunedal
71da941c8b Use system-specific user cache directory in main-kts
#KT-38222 fixed
2020-06-03 11:11:33 +02:00
Henrik Tunedal
8f80cf5664 Improve hashing of script files 2020-06-03 11:11:30 +02:00
Ilya Goncharov
890da492fb [Gradle, JS] Fix grammar in methods for JS import 2020-06-03 12:04:20 +03:00
Ilya Goncharov
bc4d7e0020 [Gradle, JS] Fix grammar on comment 2020-06-03 12:04:20 +03:00
Svyatoslav Kuzmich
e9e850ad8f [JS IR] Fix findInterfaceImplementation
isOrOverridesSynthesized uses descriptors which does not work with
wrapped descriptors
2020-06-03 10:47:15 +03:00
Denis Zharkov
19219c37b6 FIR: Fix test data for KT-13650 related test
Now, the behavior seems to be more correct then in FE 1.0
2020-06-03 10:43:37 +03:00
Denis Zharkov
7a22827af4 FIR: Unify all references to FIR nodes from non-parents 2020-06-03 10:43:37 +03:00
Denis Zharkov
4a4dce1766 FIR: Use more refined names instead of "safe"
^KT-38444 Fixed
2020-06-03 10:43:37 +03:00
Denis Zharkov
6507656496 FIR: Remove FirQualifiedAccessWithoutCallee.safe from generated code
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
291afd8448 FIR: Remove FirQualifiedAcces.safe in non-generated code
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
55a4c40970 FIR: Fix diagnostics test data after safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
723b275d99 FIR: Fix rendered fir and DFA graph test data after safe-calls refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
409e90e7de FIR: Fix codegen test data after safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
080565e482 FIR: Support safe-calls new format in DFA
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
ec746e17c9 FIR: Get rid of RealVariable.originalType
Store original type only for local variable aliases
The problem with the former is that RealVariable may be referenced
via safe-calls and via usual calls, but its type is fixed

^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
b0b7cf4042 FIR: Support safe-calls new format in FIR2IR
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
7ba1371466 FIR: Support safe-calls new format in body resolution
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
755b846877 FIR: Support safe-calls in renderers
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
9f793f1486 FIR: Support safe-calls new format in FIR builders
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
cb1c3f87f0 FIR: Prepare tree structure for safe-call refactoring
^KT-38444 In Progress
2020-06-03 10:43:37 +03:00
Denis Zharkov
14a41d91f6 FIR: Extract foldFlow from joinFlow/unionFlow in PersistentLogicSystem 2020-06-03 10:43:37 +03:00
Denis Zharkov
a3d6c42810 FIR: Reuse some common parts in PersistentLogicSystem 2020-06-03 10:43:37 +03:00
Denis Zharkov
233cf13bdc FIR: Minor. Remove when branch that is just the same as "else" 2020-06-03 10:43:37 +03:00
Denis Zharkov
93f39d5df9 FIR: Minor. Refactor processLevelForPropertyWithInvoke
- Rename
- Inline unused default parameter
2020-06-03 10:43:37 +03:00
Denis Zharkov
be4d3783a4 FIR: Fix type resolution for anonymous objects
^KT-39050 Fixed
2020-06-03 10:43:37 +03:00
Denis Zharkov
4d484dd971 FIR: Support java array in type argument
^KT-37321 Fixed
2020-06-03 10:43:37 +03:00
Dmitriy Novozhilov
164b4dd439 [FIR-TEST] Update testdata according to #KT-39340 2020-06-03 10:36:00 +03:00
Svyatoslav Kuzmich
f8fdb0dc7e [JS] Add ; after functions in .d.ts
Fixes nit from KT-37752
2020-06-03 10:33:46 +03:00
Svyatoslav Kuzmich
2ca751a9fc [JS] Prevent default class constructors in d.ts files.
Generate private TypeScript constructor for classes without public
primary Kotlin constructor.
2020-06-03 10:33:45 +03:00
Svyatoslav Kuzmich
695d383ed1 [JS] Support secondary constructors in JsExport 2020-06-03 10:33:45 +03:00
Mads Ager
f128e5222a [JVM_IR] Fix line number information for try-catch.
In particular, the current line numbers could lead to stepping
into the catch handler even when the code in the try did not
throw an exception.

This was caused by the code materializing the final value having
the catch line number. This patch delays the materialization
until the line number of the usage has been emitted.
2020-06-03 07:33:21 +02:00
Dmitry Petrov
5efbe6ae15 PSI2IR: SAM conversion in varargs 2020-06-02 23:53:47 +03:00
Dmitry Petrov
16f175612e KT-31908 Handle SAM conversion on vararg elements 2020-06-02 23:53:47 +03:00
Toshiaki Kameyama
343af60cb4 Add intention to expand boolean expression
#KT-38597 Fixed
2020-06-02 23:52:06 +03:00
Vladimir Dolzhenko
f005091dfb Fix performance test stats reporting 2020-06-02 21:44:55 +02:00
Toshiaki Kameyama
afd544cbab Introduce "Redundant 'asSequence' call" inspections
#KT-35893 Fixed
2020-06-02 22:17:54 +03:00
Ilya Gorbunov
e2c3455445 Document NaN propagation in top-level minOf/maxOf functions 2020-06-02 19:01:44 +03:00
Ilya Gorbunov
d19f9ee0c5 Simplify min/max implementation 2020-06-02 19:01:44 +03:00
Ilya Gorbunov
b4ba00ca36 Document and test NaN propagation of maxOf/minOf
Also simplify minOf/maxOf implementations

#KT-38708
2020-06-02 19:01:44 +03:00
Ilya Gorbunov
7b68de38e1 Introduce minOf/maxOf, minOfWith/maxOfWith and their OrNull variants
#KT-38708 Fixed
2020-06-02 19:01:44 +03:00
Ilya Gorbunov
6a24becd1d Introduce sumOf with various selector types
#KT-11253
2020-06-02 19:01:43 +03:00
Ilya Gorbunov
bdd53ee9cd Introduce new overloads of flatMap and flatMapTo
- Sequence<T>.flatMap((T) -> Iterable<R>)
- Iterable<T>.flatMap((T) -> Sequence<R>)
- Array<T>.flatMap((T) -> Sequence<R>)
- Map.flatMap((Entry) -> Sequence<R>)

KT-34506
2020-06-02 19:01:43 +03:00
Ilya Gorbunov
562788ceb9 stdlib-gen: allow template function sequences 2020-06-02 19:01:43 +03:00
Ilya Gorbunov
79afc4f72b stdlib-gen: avoid placing exact duplicates of annotations 2020-06-02 19:01:43 +03:00
Ilya Gorbunov
4ae6665b94 Advance bootstrap to 1.4.0-dev-9619 2020-06-02 19:01:43 +03:00
Mikhail Glukhikh
0ffa0b2bd7 [FIR] Fix effective visibility handling for local members
In future 'Local' effective visibility could be used
as a flag of local declaration
2020-06-02 18:47:58 +03:00
Mikhail Glukhikh
cb345a4c19 [FIR mangler] Search for type parameters also in overridden declarations 2020-06-02 18:47:58 +03:00
Mikhail Glukhikh
8c422fbfc7 [FIR2IR] Use signature composer to read external callables 2020-06-02 18:47:58 +03:00
Mikhail Glukhikh
9ea69b4b3c Introduce first version of FirJvmKotlinMangler & its parts 2020-06-02 18:47:50 +03:00
Mikhail Glukhikh
a239604c24 Rename & make public: Collection.collect -> collectForMangler 2020-06-02 18:43:16 +03:00
Mikhail Glukhikh
ecb48b7ed9 [FIR2IR] Support callables in signature composer 2020-06-02 18:43:16 +03:00
Vyacheslav Gerasimov
563981808d Build: Move dependencies cleanup to corresponding task action
Do cleanup only before dependencies unpacking to avoid tasks which are
always not up-to-date
2020-06-02 16:42:38 +03:00
Vyacheslav Gerasimov
f8b423046e Build: Don't build idea sources for teamcity builds 2020-06-02 16:42:38 +03:00
Mikhail Glukhikh
05d160b130 Revert "IR linked: introduce IrElement.isExpectMember instead of descriptor use"
This reverts commit 4b47eb35
2020-06-02 16:14:27 +03:00
Mikhail Glukhikh
72dd2ef448 [FIR] Fix CFG building for secondary constructor with delegation 2020-06-02 16:12:32 +03:00
Mikhail Glukhikh
b40709649d [FIR TEST] Add more detailed CFG inconsistency message 2020-06-02 16:12:27 +03:00
Mikhail Glukhikh
718f0240a1 [FIR TEST] Add problematic CFG test 2020-06-02 16:12:21 +03:00
Ilya Goncharov
a476d1dbc4 String prototypes polyfills on Object.defineProperty 2020-06-02 14:56:29 +03:00
Ilya Goncharov
9431fc4693 Polyfill for Arrays should be declared with Object.defineProperty
To not be enumerable
2020-06-02 14:56:29 +03:00
Ilya Goncharov
83e17cbf09 [Gradle, JS] Use name of target, not name of preset 2020-06-02 14:42:54 +03:00
Ilya Goncharov
b68715441f [Gradle, JS] Remove redundant fixing names
- in case when target name is `jsLegacy` with enabled both mode, we should get `jsLegacyMain` and `jsLegacyTest`, and Gradle plugin creates targets `jsLegacyLegacy` and `jsLegacyIr`, schema is name+suffix where name can be any, KotlinJsTargetPreset's name is name+`Both` so in KotlinJsTargetPreset in `both` case we need remove only `Both` suffix

#KT-39213 Fixed
2020-06-02 12:52:13 +03:00
Andrey Uskov
44f16eac2e Fixed resolution of dependencies on js libraries compiled in both mode
#KT-39213 Fixed
2020-06-02 12:52:13 +03:00
Igor Chevdar
e41b5fc1c6 [IR] Turned on a test for K/N + minor refactoring
NothingValueException has already been supported in K/N
2020-06-02 14:50:17 +05:00
Abduqodiri Qurbonzoda
c29e434d33 Remove SuccessOrFailure.kt 2020-06-02 12:04:47 +03:00
Jinseong Jeon
6eb21031b2 FIR JVM serializer: serialize property signature 2020-06-02 12:00:52 +03:00
nataliya.valtman
d6cb469e66 use Gradle 5.6 for tests with android build tool 28.0.3 2020-06-02 11:26:56 +03:00
Konstantin Tskhovrebov
08438dade2 Add project resolver for adding commonizer gradle task to IDEA import 2020-06-02 11:03:51 +03:00
Konstantin Tskhovrebov
94a4aacd9e Move commonizer to gradle task and attach to lazy file collection. 2020-06-02 11:03:51 +03:00
Vyacheslav Gerasimov
048559c053 as41: Register OCBundle for AS tests
fixes mass test fail with 'navigation.class.hierarchy' is not found in java.util.PropertyResourceBundle
2020-06-02 09:23:44 +03:00
Sergey Igushkin
f7ed3139ab Fix unused source sets missing in compilationsBySourceSets (KT-39304)
Issue #KT-39304 Fixed
2020-06-02 00:48:55 +03:00
Dmitriy Novozhilov
069adebf01 [NI] Fix checking for inline lambdas without candidate
#KT-34506
2020-06-01 23:40:32 +03:00
Abduqodiri Qurbonzoda
30037682f8 Revert "Promote String <-> utf8 and CharArray conversions to stable"
This reverts commit aba97033
2020-06-01 23:30:55 +03:00
Abduqodiri Qurbonzoda
aba97033f0 Promote String <-> utf8 and CharArray conversions to stable 2020-06-01 22:47:01 +03:00
Abduqodiri Qurbonzoda
f6a739bbc5 Promote bit query api to stable 2020-06-01 22:18:55 +03:00
Abduqodiri Qurbonzoda
55eb75d237 Remove IGNORE_BACKEND directives from forInCharSeqWithIndexStops.kt 2020-06-01 22:00:37 +03:00
Abduqodiri Qurbonzoda
1bd63bb07f Make consistent parameter nullability with appendLine 2020-06-01 22:00:36 +03:00
Abduqodiri Qurbonzoda
e05eeea6cd Promote common StringBuilder to stable 2020-06-01 22:00:34 +03:00
Abduqodiri Qurbonzoda
4568e438a9 Promote ExperimentalStdlibApi to stable 2020-06-01 21:59:32 +03:00
Ilya Gorbunov
7cc4cc0cec Make testDeepTreeOddEvenNodesMutual two times easier
Otherwise it often times out in JS tests in a parallel build.
2020-06-01 20:15:55 +03:00
Yunir Salimzyanov
77608c8785 Add temporary fixMeExtensions to pass test on extensions check (KTI-240) 2020-06-01 18:43:11 +03:00
Yunir Salimzyanov
3b9000cc0c Cleanup 191 extension files (KTI-240) 2020-06-01 18:43:10 +03:00
Yunir Salimzyanov
7ab7ca5ff0 Cleanup as35 extension files (KTI-240) 2020-06-01 18:43:10 +03:00
Yan Zhulanow
4d859a7212 Revert "TrailingCommaInspection: don't report Missing line break for when entry that has no trailing comma"
This reverts commit 25787eb8
2020-06-02 00:17:24 +09:00
Yan Zhulanow
a421f74ef0 Revert "Minor: extract new line allowance check"
This reverts commit e2f0b76e
2020-06-02 00:17:23 +09:00
Leonid Startsev
1d589e3f56 Rework access to properties in IR plugin
use accessors instead of fields whenever possible
2020-06-01 17:48:17 +03:00
Leonid Startsev
02bd8cbd6b Use SYNTHETIC_OFFSET instead of UNDEFINED
because Native's debug information does not accept undefined offsets
2020-06-01 17:48:17 +03:00
Leonid Startsev
7c8c5b057f Extensible mechanism for plugin metadata during descriptor serialization
A mechanism that allows kotlinx.serialization plugin to preserve the
correct (program) order of properties after serializing/deserializing
descriptors to kotlin metadata, which is needed for correct and stable
json serialization of class hierarchies in incremental/multi-module scenario.
It uses protobuf extensions.
2020-06-01 17:48:16 +03:00
Victor Petukhov
8d05253369 NI: take into account effective variance during adding constraints from LHS instead of only use site variance
^KT-39220 Fixed
2020-06-01 17:24:49 +03:00
Alexander Gorshenev
561c6747a6 Remove tests from muted 2020-06-01 17:16:31 +03:00
Nikita Bobko
2ef46b586d Fix broken NavBar for 201
^KT-38466 Fixed
^KT-38260 Fixed
2020-06-01 17:05:10 +03:00
Dmitry Petrov
246c68b0a9 PSI2IR: Don't generate IMPLICIT_INTEGER_COERCION
Generate integer coercion function calls and properly typed constant
expressions instead.
2020-06-01 16:51:47 +03:00
Juan Chen
bfac0355bf WIP: [FIR] unmute testKt14227 with FULL_JDK
The test used to fail because it has an augmented assignment for
elements in a HashMap of Strings, and "plus" fails to resolve due to
ambiguity: besides String.plus, BigDecimal.plus in the standard
library is also considered. BigDecimal is not resolved and thus
isError returns true. During type checking, the context has
isErrorTypeEqualsAnything set to true, and BigDecimal is now regarded
as a super type of String and BigDecimal.plus is a valid
candidate. Adding the directive "FULL_JDK" enables resolving of
BigDecimal so that BigDecimal.plus is excluded.
2020-06-01 16:47:15 +03:00
Toshiaki Kameyama
45d60baeb0 Add import for member: don't suggest if a class with the same name has been imported
#KT-38492 Fixed
2020-06-01 21:42:04 +09:00
Toshiaki Kameyama
329f0227ec Remove explicit type specification: do not suggest for suspend function type
#KT-38310 Fixed
2020-06-01 21:42:04 +09:00
Toshiaki Kameyama
098469eb85 Implement members: implement functions in the same order as within Java interface
#KT-31760 Fixed
2020-06-01 21:42:04 +09:00
Yan Zhulanow
741ebeb7b8 Mark semicolons after nullable types redundant, despite of '!' after (KT-38240) 2020-06-01 21:42:04 +09:00
Toshiaki Kameyama
4cf83d9526 Redundant semicolon: don't report when semicolon is between type and '!'
#KT-38240 Fixed
2020-06-01 21:42:04 +09:00
Yan Zhulanow
8e8171547b Add super type in "Convert to anonymous object" test 2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
111b2945e1 "Convert to anonymous object" quickfix: false negative when interface has concrete members
#KT-37908 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
5b927d798c Replace explicit parameter with it: don't suggest if overload resolution ambiguity error occurs
#KT-20795 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
69a2697598 Convert lambda to reference: add type parameter to outer call expression if needed
#KT-37744 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
a4239afcb3 Convert to anonymous function: do not suggest for suspend functions
#KT-37842 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
ded996bdf7 PlatformExtensionReceiverOfInline: fix false positive with extension function with nullable type receiver
#KT-37256 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
6868f53f46 "Change JVM name" (@JvmName) quickfix: improve name suggester for generic functions
#KT-38559 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
5efbbdea57 Lift assignment out: do not report when assignment variables are different
#KT-38649 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
498c40548b Structure view: add visibility sorter
#KT-36444 Fixed
2020-06-01 21:42:03 +09:00
Toshiaki Kameyama
9aaba8c759 Structure view: add visibility filter for class properties
#KT-38276 Fixed
2020-06-01 21:42:03 +09:00
Yan Zhulanow
e2f0b76e2f Minor: extract new line allowance check 2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
25787eb869 TrailingCommaInspection: don't report Missing line break for when entry that has no trailing comma
#KT-38568 Fixed
2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
3272b8fc2c CanSealedSubClassBeObjectInspection: don't report if sub-class has classModifier
#KT-38790 Fixed
2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
cea879cbd5 "Make containing function suspend" quickfix: don't suggest for anonymous function
#KT-38948 Fixed
2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
8f3392d635 Convert lambda to reference: fix it works correctly in anonymous object
#KT-31682 Fixed
2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
b9fab1123d Convert lambda to reference: fix it works correctly for labeled expression
#KT-37214 Fixed
2020-06-01 21:42:02 +09:00
Toshiaki Kameyama
2a36a8acac JavaMapForEachInspection: don't report if argument is not single
#KT-39151 Fixed
2020-06-01 21:42:02 +09:00
Yan Zhulanow
7d3b28d75b Add missing runReadAction call (EA-223789) 2020-06-01 21:42:02 +09:00
Mikhail Zarechenskiy
f073e34926 Update forgotten test-data 2020-06-01 15:35:24 +03:00
Natalia Selezneva
fd07d5f301 Scripting setting: auto reloading of script dependencies is now per definition 2020-06-01 15:12:53 +03:00
Roman Golyshev
8726d3dc4e KT-37950 Add io.ktor packages to 'Packages to use * import' list
- Ktor code style [here](https://ktor.io/quickstart/code-style.html)
suggests to use star imports for Ktor packages
- Absence of it in the default code style for Kotlin results in some
inconveniences during auto-import and autocompletion (see the issue)
- Automatic * import should mitigate the issue, since the first
autocompleted item from the proper package should import the whole
package, and then no further auto-import would be required for the
next completions
- KT-37950 Fixed
2020-06-01 14:41:51 +03:00
Yunir Salimzyanov
17a9d93a4f Unmute two successfully finished muted tests for 193 platform 2020-06-01 14:38:55 +03:00
Yan Zhulanow
7014c17a57 IDE plugin dependencies: Publish unshaded kotlin-scripting-compiler 2020-06-01 18:44:44 +09:00
Vyacheslav Gerasimov
8704946498 as41: Fix testResourceBundle hack for AS 4.1 2020-06-01 12:29:10 +03:00
Vyacheslav Gerasimov
7d7835f0f4 as41: Remove ApplicationUtils.kt.as41 which should be same as for 201 2020-06-01 12:29:10 +03:00
Vyacheslav Gerasimov
af1e815f47 as41: Remove AbstractModelBuilderTest.java.as41
Should be same as for 201
2020-06-01 12:29:09 +03:00
Roman Golyshev
7fb5acc718 KT-18538 Fix inspection to detect unnecessary grand-base class qualifier
- Add separate option to enable/disable this inspection, as it is not
obvious if it should be always enabled or not
  - This option can be used to detect all unnecessary qualifiers in
  tests
- Add possibility to configure inspections via `settings.xml` in the
`AbstractMultiFileLocalInspectionTest.kt`
- ^KT-18538 Fixed
2020-06-01 08:59:37 +00:00
Roman Golyshev
2c12d26d28 KT-18538 Unwrap fake override in ShortenReferences
- Fake override prevents reference shortener from shortening of static
methods declared in the class bases when they are located not in
direct parent of the class (for example, in grand-
or grand-grand-parent)
- The completion uses descriptor with unwrapped fake override when it
performs the insertion. It leads to inserting the name of the base which
actually contains the static method instead of the direct parent class.
Now, when reference shortener compares unwrapped descriptors, this
problem should be fixed during insertion handling
2020-06-01 08:59:37 +00:00
Roman Golyshev
43bbfa78d1 KT-18538 Cleanup in ShortenReferences 2020-06-01 08:59:36 +00:00
Roman Golyshev
16bdfa4fee KT-18538 Cleanup in RemoveRedundantQualifierNameInspection 2020-06-01 08:59:36 +00:00
Jinseong Jeon
4a511c7721 FIR: extend arrayOf call transformation to other variants 2020-06-01 10:45:42 +03:00
Mikhail Zarechenskiy
7ec8716d65 Introduce HTML redenred version for compatibility warning 2020-06-01 10:19:36 +03:00
Mikhail Zarechenskiy
569b6eaff2 Don't issue compatibility warning for the candidates in the same group 2020-06-01 10:19:35 +03:00
Mikhail Zarechenskiy
f922e454f9 Don't propagate compatibility resolve from callable reference arguments 2020-06-01 10:19:35 +03:00
Mikhail Zarechenskiy
599f520fd8 Add compatibility warning for chained sam->suspend-conversion 2020-06-01 10:19:35 +03:00
Mikhail Zarechenskiy
a5203428a4 Replace resolution error for suspend-conversion with call checker error 2020-06-01 10:19:34 +03:00
Mikhail Zarechenskiy
eaeaf3c8a3 Add compatibility warning for suspend conversions 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy
47e6805186 Add compatibility warning for reference adaptation 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy
684dfb959c Don't write any COERCION_STRATEGY for Unit to Unit return types 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy
03358c61d4 Add compatibility warning for SAM conversions 2020-06-01 10:19:33 +03:00
Mikhail Zarechenskiy
01de789c76 Add compatibility warning for SAM conversions on Kotlin functions 2020-06-01 10:19:32 +03:00
Yan Zhulanow
080d8fa127 Add missing stdlib-common IDE plugin dependency 2020-06-01 15:16:16 +09:00
Vladimir Ilmov
73f4b61022 (CoroutineDebugger) Windows test fix for kotlinx-coroutines-core 2020-05-31 20:24:41 +02:00
Mikhail Zarechenskiy
ea6a8ce5cd Rename language feature to make it more clear 2020-05-31 18:13:17 +03:00
Ilya Muradyan
bbe00b2fdc Add scripting REPL completion options
nameFilter - way of filtering descriptors by their names;
filterOutShadowedDescriptors - if true, filters out descriptors
shadowed by descriptors in latter-compiled snippets. May slow down
completion performance.
2020-05-31 17:05:24 +02:00
Mikhail Zarechenskiy
0ab9b3639b Approximate types for lambda literals before serialization 2020-05-31 17:38:18 +03:00
Mikhail Zarechenskiy
366ed7d4ca Minor: reformat fakeDescriptorsForReferences.kt 2020-05-31 17:38:17 +03:00
Nicolay Mitropolsky
6ed453dfbc Uast: removing deprecated JvmDeclarationUElement (KT-23887) 2020-05-31 06:54:12 +03:00
Alexander Gorshenev
a112f8acb6 Moved symbol table emptiness assertion to later places,
so that the assert doesn't trigger in the plugin context
2020-05-31 06:00:33 +03:00
Alexander Gorshenev
5e56a52f94 Properly update modality and visibility of property accessors on fake override creation 2020-05-31 06:00:33 +03:00
Alexander Gorshenev
4dd159d4ec Added another fake override validation pass after IR plugins 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
46e3649bd0 Moved all things related to fake overrides to a single directory 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
06abbe468b Signature based fake override validation 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
024385cbbd Construct fake overrides after IR deserialization 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
ee1ea15684 Adapted descriptor fake override construction from OverridingUtil.java to IR as IrOverridingUtil.kt 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
2828aa9ce8 Typechecker and visibility utils for fake overrides 2020-05-31 06:00:32 +03:00
Alexander Gorshenev
789efc7c3a Created a deep copier good for fake overrides.
Adapted it from inliner copier.
It is capable of producing type substituted members.
2020-05-31 06:00:31 +03:00
Alexander Gorshenev
63429c088f Introduced IrFakeOverrideFunctionImpl and IrFakeOverridePropertyImpl 2020-05-31 06:00:31 +03:00
Alexander Gorshenev
20dedd53ff Got rid of LazyIrProvider. It is not used anymore 2020-05-31 06:00:31 +03:00
Alexander Gorshenev
756f7076f6 Got rid of duplicates in resolveFakeOverrides implementations 2020-05-31 06:00:31 +03:00
Yunir Salimzyanov
ea71a57fac Unmute non-flaky tests and mark some flaky tests with FLAKY label
KTI-216
2020-05-30 22:50:34 +03:00
Yunir Salimzyanov
4e732b7ba2 Wrap parametrized tests with muteWithDatabase
Cause: should correctly run muted tests in database (KTI-216)
2020-05-30 22:50:34 +03:00
Yunir Salimzyanov
8d51b027ed Add annotation to prevent test invocation twice
Cause: it helps to fix double inversion of muted non-flaky tests result
(KTI-216).
2020-05-30 22:50:34 +03:00
Yunir Salimzyanov
a256e75909 Run muted non-flaky tests and invert their result (KTI-216)
Cause: if mutedInDatabase test is failing then test result = success
else test result = failure (because now it should be unmuted)
2020-05-30 22:50:33 +03:00
Yunir Salimzyanov
cfb8763b33 Remove redundant Runner logic 2020-05-30 22:50:33 +03:00
Ilya Gorbunov
2e67ccbd6a Advance bootstrap to 1.4.0-dev-9436 2020-05-30 21:34:49 +03:00
Vladimir Ilmov
0b3ae50f31 Revert "(CoroutineDebugger) Windows test fix for kotlinx-coroutines-core"
This reverts commit faaf40dbe5.
2020-05-30 17:09:52 +02:00
Vladimir Ilmov
faaf40dbe5 (CoroutineDebugger) Windows test fix for kotlinx-coroutines-core 2020-05-30 10:55:49 +02:00
simon.ogorodnik
99b2a4745a [FIR2IR] Fix superQualifier in case of composed super type ref 2020-05-29 21:10:56 +03:00
simon.ogorodnik
8afbb4542b [FIR2IR] Fix check if interface is SAM 2020-05-29 21:10:56 +03:00
Nikita Bobko
aa5a5c954f Refactoring: change "// BUNCH: xxx" format
It wasn't obvious how to use this comment properly.
Now it should be clear
2020-05-29 20:31:12 +03:00
Nikita Bobko
b34fe77760 Split bunches with comma 2020-05-29 20:31:12 +03:00
Nikolay Krasko
5e7c82ea01 Fix building dist with JDK 13 (KTI-262)
Return to bootstrap version, that was abandoned because of KT-37235.
It looks like build is fine now.
2020-05-29 20:17:55 +03:00
Steven Schäfer
7ea71a17f0 JVM IR: Use language feature for inline class mangling rules 2020-05-29 19:54:09 +03:00
Ilya Goncharov
a41b746774 Revert "[Gradle, JS] Output file path as input fo js compile task"
This reverts commit df173c8c
2020-05-29 19:39:17 +03:00
Ilya Goncharov
df173c8c93 [Gradle, JS] Output file path as input fo js compile task
^KT-38676 fixed
2020-05-29 17:37:00 +03:00
Dmitriy Novozhilov
1d32cab11d Revert "[FIR] Don't save original user type in FirResolvedTypeRef"
Also fix `FirGeneratedElementsValidator` so it doesn't check
   `FirResolvedTypeRef.delegatedTypeRef`
2020-05-29 17:35:53 +03:00
Dmitriy Novozhilov
72813cefbe [FIR] Store list of sealed inheritors even if there are none of them 2020-05-29 17:35:53 +03:00
Vyacheslav Gerasimov
d612c130e8 Build: Fix jpsStandalone dependency in core.descriptors.runtime 2020-05-29 17:29:27 +03:00
Ilya Goncharov
bb9e8a8a50 [Gradle, JS] Fix warning message with new line
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:20:10 +03:00
Ilya Goncharov
1b841adfff [Gradle, JS] Fix param name
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:20:00 +03:00
Ilya Goncharov
9fd211cfcd [Gradle, JS] Manually singleton because Gradle Daemon
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:19:44 +03:00
Ilya Goncharov
59c2bc25d5 [Gradle, JS] Detect multiple plugins for NodeJsRootPlugin and YarnPlugin
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:19:27 +03:00
Ilya Goncharov
39869f009e [Gradle, JS] Throw error in JS part when plugins goes from different classloaders
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:19:13 +03:00
Ilya Goncharov
2e39c1164d Move detecting of multiple kotlin plugins into extract class
^KT-39210 fixed
^KT-31669 fixed
2020-05-29 17:18:57 +03:00
Alexander Udalov
7d9fe55072 Regenerate tests 2020-05-29 15:15:43 +02:00
Dmitriy Novozhilov
f21d1e1c1b [FIR] Record non-user type refs to resolved type refs
That `delegatedTypeRef` is needed for reporting errors on value
  parameters of function types and errors about cyclic dependencies
  between types
See 6f241c6d
2020-05-29 16:10:38 +03:00
Mads Ager
7d7b9262e7 [JVM] Port remaining line number tests to stepping infrastructure.
These line number tests only tested that a set of line numbers where
present in the java bytecode. Not that they would be hit in the
right order by the debugger. Moving them to stepping tests fixes that.

This exposes a couple of issues (in particular around try-catch-finally)
that should be fixed.

A number of tests are marked as failing now. Will investigate and
work on fixes next.
2020-05-29 15:07:49 +02:00
Dmitry Petrov
5db6a0b563 New mangling rules require language version 1.4 (not compiler version)
Follow-up to a270ee094c
2020-05-29 15:15:54 +03:00
Victor Petukhov
40a4cea530 NI: remove type depth check during adding initial constraints 2020-05-29 12:37:27 +03:00
pyos
35460fed19 JVM_IR: fix a bug when isInlineParameter is applied to default stubs
If an inline parameter has a default value, its type is nullable.
There's already code to handle this in `IrInlineCodegen`, but it
really should be in `isInlineParameter` instead, otherwise e.g.
SyntheticAccessorLowering fails.
2020-05-29 10:04:36 +02:00
Nicolay Mitropolsky
86e434195e Uast: UastKotlinPsiVariable made isEquivalentTo it's physical PSI (KT-39174) 2020-05-29 11:00:47 +03:00
Ilmir Usmanov
5f3e296f19 Fix bugs with capturing rhs into EXACTLY_ONCE lambda
There are multiple ways to declare a named variable-like entity in
Kotlin:
1. val/var variable declaration
2. destructuring declaration
3. parameter of a function
4. parameter of a lambda
5. destructured lambda parameter
6. for-loop's variable declaration
7. catch block exception declaration
8. val in when
9. field declaration

Out of them, only variable and field can be assignable, in other words,
they can be on the left hand side of an assignment.
Val/var variable declarations were already supported.
So, we needed to just support field initialization and tell the backend
that other ways are prohibited. Function and lambda parameters were
already been supported. So, the only thing to explain to the backend are
remaining ways.
 #KT-39113 Fixed
 #KT-34048 Fixed
2020-05-29 09:55:04 +02:00
Ilya Kirillov
0fc43b1f57 Wizard: add possibility to change Kotlin version for generated projects via property
#KT-39247 fixed
2020-05-29 10:48:53 +03:00
Dmitriy Novozhilov
6f241c6dcd [FIR] Don't save original user type in FirResolvedTypeRef 2020-05-29 10:24:39 +03:00
Dmitriy Novozhilov
422a327fca [FIR] Add visitor for validation of generated FIR 2020-05-29 10:24:39 +03:00
Dmitriy Novozhilov
f6dabafe34 [FIR] Make creating of resolve processors type safe
Also get rid of `CompilerMode` enum
2020-05-29 10:24:36 +03:00
Dmitriy Novozhilov
c919f6172e Reformat AbstractSimpleFileBenchmark.kt 2020-05-29 10:24:29 +03:00
Dmitriy Novozhilov
b4ce736814 [FIR] Move registration components out of initializers of FirSession 2020-05-29 10:24:26 +03:00
Dmitriy Novozhilov
fec3e4faf1 [FIR] Move initialization of common services to FirSessionBase 2020-05-29 10:22:04 +03:00
Dmitriy Novozhilov
1973060e8c [FIR-PLUGIN] Fix AllOpenClassGenerator after previous commit 2020-05-29 10:22:03 +03:00
Dmitriy Novozhilov
6d37776267 [FIR] Rename FirClassImpl to FirRegularClassImpl
Also rename `buildClassImpl` to `buildRegularClass` and get rid
  of intermediate `AbstractFirRegularClassBuilder`
2020-05-29 10:22:03 +03:00
Dmitriy Novozhilov
60fd505a9c [FIR] Get rid of FirSealedClass node
Now list of inheritors is hold in attributes of `FirRegularClass`
2020-05-29 10:22:00 +03:00
Dmitriy Novozhilov
41cdb61ef3 [FIR] Move all symbol providers to separate package 2020-05-29 10:20:57 +03:00
Dmitriy Novozhilov
a1c3d2b709 [FIR] Add separate session component for FirIdeProvider 2020-05-29 10:17:22 +03:00
Dmitriy Novozhilov
34d3fe26e6 [FIR] Get rid of FirProvider.getInstance 2020-05-29 10:17:21 +03:00
nataliya.valtman
ff06e60a06 Revert "run for 28.0.2"
This reverts commit 86d52d41
2020-05-29 10:09:50 +03:00
nataliya.valtman
86d52d4123 run for 28.0.2 2020-05-29 10:07:34 +03:00
Dmitriy Novozhilov
1982f80bfb [NI] Leave candidates with annotation if there are no candidates without it 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov
2812ed0a02 [NI] Use types and systems from return arguments instead of return type of lambda 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov
f76b57d260 [OI] Prefer candidate without @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov
a604404bff [NI] Report warning if candidate was chosen using only @OverloadResolutionByLambdaReturnType 2020-05-29 09:36:33 +03:00
Dmitriy Novozhilov
82ce2e7b7c [NI] Update annotation used in testdata 2020-05-29 09:36:32 +03:00
Ilya Gorbunov
e9ef6dbc28 Discriminate OverloadResolutionByLambdaReturnType annotated overloads...
instead of preferring them in case of unsolvable ambiguity.
2020-05-29 09:36:32 +03:00
Dmitriy Novozhilov
e1418a5540 [NI] Check for maximally specific candidate chosen with factory resolution 2020-05-29 09:36:32 +03:00
Dmitriy Novozhilov
e7869bd9d4 [NI] Analyse lambda in factory pattern resolution in independent context 2020-05-29 09:36:32 +03:00
Ilya Gorbunov
a0c7bece93 Overload resolution by lambda return type
Make compiler recognize new annotation enabling this feature.

Change overload selection algorithm to consider all overloads
with that annotation, not just the first one.

#KT-38480
#KT-11265
2020-05-29 09:36:32 +03:00
Ilya Gorbunov
23414496c4 Annotation to enable overload resolution by lambda return type
#KT-38480
2020-05-29 09:36:32 +03:00
Dmitriy Novozhilov
1c32c62a87 [NI] Choose annotated candidate if call still ambiguous
#KT-11265
2020-05-29 09:36:31 +03:00
Dmitriy Novozhilov
8c524769b1 [NI] Add required FactoryPattern annotation for factory pattern resolve
#KT-11265
2020-05-29 09:36:31 +03:00
Dmitriy Novozhilov
865ddac07a [NI] Add feature for choosing candidate by lambda return type 2020-05-29 09:36:31 +03:00
Ilya Gorbunov
f243b8946f Restore testOmittedStdlibVersion originally added in commit 15feeddc 2020-05-29 04:10:17 +03:00
Ilya Gorbunov
d47981f07b Drop gradle ITs depending on AGP versions below 3.2
AGP of these versions cannot handle module-info class included in
kotlin-stdlib artifact from now on.
2020-05-29 04:10:17 +03:00
Dmitry Petrov
a270ee094c Language feature for new inline class mangling rules (since 1.4) 2020-05-29 00:53:01 +03:00
Dmitry Petrov
94509bdb4e KT-39228 Fix inliner when latest 1.4 compiler used with 1.3 stdlib
Since 1.4.0-dev-8774, we mangle functions returning inline class values,
including functions with return type 'kotlin.Result'. This causes
incompatibility when 1.4 compiler is used with 1.3 (or just some
pre-1.4.0-dev-8774) standard library.

Also, write "message from the future" on functions returning inline
class values indicating that they can be used since compiler version 1.4
(otherwise 1.3 compiler using 1.4 stdlib would fail to find some
@InlineOnly functions such as 'Result.success' and 'Result.failure').
2020-05-29 00:53:00 +03:00
Mikhail Glukhikh
ffdab473e2 IR symbols: enhance exception messages / toString() a bit 2020-05-28 22:59:13 +03:00
Mikhail Glukhikh
b6cdcc8d50 [FIR2IR] Mute 2 failing BB tests 2020-05-28 22:51:20 +03:00
Mikhail Glukhikh
19f1a3de1a [FIR2IR] Populate overridden symbols also with public symbol inheritors 2020-05-28 22:19:21 +03:00
Mikhail Glukhikh
85760770a8 [FIR2IR] Initialize built-in symbols at start of conversion 2020-05-28 22:18:20 +03:00
Mikhail Glukhikh
cd24745f1f [FIR2IR] Add primitive signature composer & use it for external classes 2020-05-28 22:18:13 +03:00
Mikhail Glukhikh
048e7a7075 [FIR] Add forgotten FirJvmBackendClassResolver to CLI 2020-05-28 22:18:05 +03:00
Andrey Uskov
0ed9356cd2 Fixed reporting duration between builds in gradle statistics 2020-05-28 22:08:18 +03:00
Andrey Uskov
8dcbc391fe Implemented collecting JS compilation mode
#KT-36410 Fixed
2020-05-28 22:08:13 +03:00
Andrey Uskov
97039926f0 Fixed import of transitive HMPP dependencies
#KT-36792 Fixed
2020-05-28 22:08:04 +03:00
Andrey Uskov
a431e20b45 Fix import of js MPP source sets in both mode
#KT-38706 Fixed
2020-05-28 22:07:55 +03:00
Andrey Uskov
36c9d04cd3 Fix HMPP import tests 2020-05-28 22:07:51 +03:00
Andrey Uskov
9c2918bdd6 Drop import tests with module per source set disabled 2020-05-28 22:07:48 +03:00
Andrey Uskov
104eeb9ffd Fixed KNPE when serialized Kotlin Facet is broken
#KT-37428 Fixed
2020-05-28 22:07:44 +03:00
Andrey Uskov
e6165ed785 Improved performance of MPP projects import
#KT-39059 Fixed
2020-05-28 22:07:39 +03:00
Andrey Uskov
8eca3c8aa8 Fixed building MPP model if project root directory does not exist 2020-05-28 22:07:36 +03:00
Andrey Uskov
c7a53e4435 Fix android import tests 2020-05-28 22:07:31 +03:00
Andrey Uskov
351d706e0d Fixed reporting NPM download time
#KT-39109 Fixed
2020-05-28 22:07:27 +03:00
Andrey Uskov
15ead4cbe6 Fixed representation of project structure when MPP module is involved
KT-37125
2020-05-28 22:07:22 +03:00
Andrey Uskov
2eb354f211 Fixed import of MPP modules with single artifacts
#KT-38037 Fixed
2020-05-28 22:07:16 +03:00
Zalim Bashorov
a8623b9b28 Make sure that library file still exists before calling loadMetadata from JsResolverForModuleFactory since IDE model could be outdated
#EA-218905 fixed
2020-05-28 21:38:01 +03:00
Zalim Bashorov
7f41dc4828 Add more detailed message for EA-227305 and EA-226744 2020-05-28 21:38:00 +03:00
Vyacheslav Karpukhin
7b55a49ddd Dependency on IDEA replaced with AS incompatibility 2020-05-28 19:29:22 +02:00
Steven Schäfer
dc0ef996b7 JVM IR: Implement the new inline class ABI 2020-05-28 18:00:35 +03:00
Nicolay Mitropolsky
e60a32e8d3 Uast: UastFakeLightMethod dependent generic type SOE fix KT-39155 2020-05-28 17:53:30 +03:00
Vladimir Ilmov
de790a3e3b (UnusedSymbolInspection) Added support for typing per inspection tests
relates to #KT-38653
2020-05-28 15:27:58 +02:00
Alexander Udalov
1f1790d60e Do not rely on descriptors in KParameterImpl.equals/hashCode
For the same reason as in the previous commit: descriptors are cached
via weak references in moduleByClassLoader.kt and can be
garbage-collected at any point. So different instances of KParameterImpl
representing the same parameter may store different instances of
descriptors.
2020-05-28 14:17:37 +02:00
Alexander Udalov
55f384cb04 Do not rely on descriptors in KTypeParameterImpl.equals/hashCode
Descriptors are cached via weak references in moduleByClassLoader.kt and
can be garbage-collected at any point. So relying on identity of
descriptors in KTypeParameterImpl is dangerous because the same type
parameter can be represented by different descriptors. For example, the
test equalsOnFunctionParameters.kt was flaky before this change because
of this issue, and that could be reproduced by running it a few hundred
times in the same process.

Instead, use the type parameter's container (which is either KClass or
KCallable) and name, in equals/hashCode. KClass and KCallable already
have equals/hashCode independent of descriptors, so this works in case
the descriptor is invalidated.
2020-05-28 14:17:37 +02:00
Alexander Udalov
d25f9dee62 Minor, remove temporary workarounds for JPS build 2020-05-28 14:17:36 +02:00
Victor Petukhov
e72f7d9a1d NI: return optimization for adding constraints in ConstraintInjector.kt 2020-05-28 14:58:15 +03:00
anastasiia.spaseeva
6c1efbe812 [Spec tests] Update spec testData 2020-05-28 14:23:11 +03:00
Mikhail Glukhikh
25b1059f74 Cleanup: ExpectDependencyGenerator 2020-05-28 14:03:01 +03:00
Mikhail Glukhikh
c9f2876368 [PSI2IR] Drop unnecessary forcing of type alias RHS referencing 2020-05-28 14:03:01 +03:00
Mikhail Glukhikh
cef23a284f [PSI2IR] Use returnTarget.symbol directly in generateReturnExpression 2020-05-28 14:03:00 +03:00
Mikhail Glukhikh
8e8bb9bf08 [IR] Simplify class parent fetching in PrimitiveCompanionLowering 2020-05-28 14:03:00 +03:00
Mikhail Glukhikh
487a698e49 [IR] Add IrSymbolBase.toString() implementation 2020-05-28 14:02:59 +03:00
Mikhail Glukhikh
07b1bd9d99 IrTypeUtils: take name directly from IrDeclaration 2020-05-28 14:02:59 +03:00
Mikhail Glukhikh
4b47eb359a IR linked: introduce IrElement.isExpectMember instead of descriptor use 2020-05-28 14:02:58 +03:00
Mikhail Glukhikh
7c7f87e729 [IR] Replace some usages of KotlinType to IrType 2020-05-28 14:02:58 +03:00
Mikhail Glukhikh
2d842d061e IrSourceCompilerForInline: get ownerKind without descriptor 2020-05-28 14:02:57 +03:00
Mikhail Glukhikh
a631c24e8c [IR] Drop unused 'withDescriptors' dumper 2020-05-28 14:02:57 +03:00
Mikhail Glukhikh
4944fc78b2 [IR] Require bound symbols in classFqNameEquals 2020-05-28 14:02:56 +03:00
Mikhail Glukhikh
cacf5f5a4a [IR] Read isExpect directly from IrDeclaration without using descriptor 2020-05-28 14:02:56 +03:00
Mikhail Glukhikh
934b040152 [IR] Read isSuspend directly from IrFunction without using descriptor 2020-05-28 14:02:55 +03:00
Mikhail Glukhikh
8a15edf5e6 [IR] Extract IrDeclaration(Access).psiElement extension 2020-05-28 14:02:55 +03:00
Mikhail Glukhikh
6b3c390fa7 [FIR2IR] Use IrSymbols directly instead of referencing via SymbolTable 2020-05-28 14:02:54 +03:00
Mikhail Glukhikh
90e6d5bea7 [FIR2IR] Read modality directly from IrFunction without using descriptor 2020-05-28 14:02:54 +03:00
Mikhail Glukhikh
724101cdd2 [IR] Get rid of minor symbol.descriptor usages 2020-05-28 14:02:53 +03:00
Mikhail Glukhikh
bf66929b5b Extract IrClass.syntheticAccessorToSuperSuffix() 2020-05-28 14:02:53 +03:00
Mikhail Glukhikh
66da676b9e [IR] Extract IrCallableReference.referencedName 2020-05-28 14:02:52 +03:00
Mikhail Glukhikh
79fd24f734 IrBuilder: get typeParametersCount from IR owner, not from descriptor 2020-05-28 14:02:52 +03:00
Ilya Goncharov
bf5810a349 [Gradle, JS] Fix text after proof read
#KT-35641 fixed
#KT-35611 fixed
2020-05-28 12:14:34 +03:00
Ilya Goncharov
85e5f8a736 [Gradle, JS] Deprecation of kotlin2js and kotlin-dce-js plugins
#KT-35641 fixed
#KT-35611 fixed
2020-05-28 12:13:28 +03:00
Dmitriy Dolovov
118c4b96cc [Commonizer] Leaf source sets should depend on commonized "common" libs
^KMM-241
2020-05-28 12:12:40 +07:00
Dmitriy Dolovov
45260cee1e [Commonizer] Update stats collector to report lifted up declarations 2020-05-28 12:12:40 +07:00
Dmitriy Dolovov
9f31931bb8 [Commonizer] Tests on lifting up identical const properties
^KMM-241
2020-05-28 12:12:39 +07:00
Dmitriy Dolovov
2ce1625989 [Commonizer] Lift up identical const properties
^KMM-241
2020-05-28 12:12:39 +07:00
Dmitriy Dolovov
a2edb9b547 Minor. Add "commonized" to project dictionary 2020-05-28 12:12:39 +07:00
Dmitriy Dolovov
36a29ce2dd [Commonizer] Split different aspects of CIR
- Entity declaration
- Entity implementation
- Creation of new entities from descriptors
2020-05-28 12:12:29 +07:00
Dmitriy Dolovov
f26a3150ba [Commonizer] Explicitly check if annotation constants are allowed 2020-05-28 12:11:11 +07:00
Dmitriy Dolovov
0827d2e8a3 [Commonizer] Fix Gradle module dependencies 2020-05-28 12:11:04 +07:00
Dmitriy Dolovov
b5245e2df6 [Commonizer] Avoid N^2 during merge of KLIB manifest dependencies 2020-05-28 12:10:58 +07:00
Dmitry Gridin
dbd10380ee Code style settings: fix top border in UI
#KT-39180
2020-05-28 09:28:52 +07:00
Alexander Udalov
d115a1ff9c Minor, fix some warnings such as "unused main argument" in generators 2020-05-27 23:29:21 +02:00
Alexander Udalov
4520e02bae Support fun interfaces in kotlinx-metadata
#KT-37421 Fixed
2020-05-27 23:29:12 +02:00
Vladimir Dolzhenko
c805274d2e Fix projectRoutines.kt compilation under 192/as36 2020-05-27 21:11:23 +02:00
Steven Schäfer
86cd039526 JVM IR: Use original descriptors for lambdas in JvmDeclarationOrigin 2020-05-27 20:21:42 +03:00
Nataliya Valtman
bd66e87440 KT-38250 The minimal supported Gradle version is 5.3 now
Gradle integration tests: use at least OLDEST_SUPPORTED version.

extract minSupportedGradleVersion for using both in check and tests

avoid using Usage.JAVA_API_JARS and JAVA_RUNTIME_JARS
2020-05-27 19:05:45 +03:00
Vyacheslav Gerasimov
af2dce0549 as41: Build against AS 4.1 C10 2020-05-27 18:46:57 +03:00
Vyacheslav Gerasimov
097b93cb2a as41: Setup bunch config and compatibility dsl for AS 4.1 2020-05-27 18:46:57 +03:00
Vyacheslav Gerasimov
d6011103e2 Build: Remove bunch files with intellijUltimateEnabled=false for AS 2020-05-27 18:46:57 +03:00
Victor Petukhov
cadc5ad587 NI: remove deprecated TODO about doing investigation around producing unwanted Any? during incorporation (KT-39154) 2020-05-27 16:52:55 +03:00
Victor Petukhov
0bed055fca NI: small refactoring around TypeCheckerContext and adding new possible constraints 2020-05-27 16:39:31 +03:00
Victor Petukhov
d7f52e8b67 NI: do explicit incorporation of type of fixing type variable into other constraints
^KT-37380 Fixed
2020-05-27 15:44:03 +03:00
Dmitry Gridin
3643b7b0ca trailingComma: cleanup code 2020-05-27 11:24:12 +00:00
Dmitry Gridin
052d06be3f TrailingCommaIntention: fix description
#KT-39180
2020-05-27 11:24:11 +00:00
Dmitry Gridin
bf6dffdf38 Introduce KotlinOtherSettingsPanel
#KT-39180 Fixed
#KT-38036 Fixed
2020-05-27 11:24:10 +00:00
Dmitry Gridin
880658135f TrailingCommaIntention: should call notifyCodeStyleSettingsChanged() 2020-05-27 11:24:10 +00:00
Dmitry Gridin
dcebcc27b4 trailing comma: remove similar test data 2020-05-27 11:24:09 +00:00
Dmitry Gridin
c78fd4aaca TrailingCommaInspection: should suggest fixes for call-site without warnings
#KT-39131 Fixed
2020-05-27 11:24:09 +00:00
Dmitry Gridin
10462c31d2 Join lines should remove useless trailing commas
#KT-39065 Fixed
2020-05-27 11:24:08 +00:00
Dmitry Gridin
e4a9679ec2 TrailingCommaVisitor: improve tree traversal 2020-05-27 11:24:07 +00:00
Dmitry Gridin
eab12a32ac util: add missing constraints 2020-05-27 11:24:07 +00:00
Dmitry Gridin
262c9e6858 TrailingCommaPostFormatProcessor: should work with call-site in limited mode
* remove useless comma
* format call if comma exists

#KT-39079 Fixed
2020-05-27 11:24:06 +00:00
Dmitry Gridin
86827dfc92 TrailingCommaVisitor: adapt to TrailingCommaContext
#KT-39123 Fixed
2020-05-27 11:24:05 +00:00
Dmitry Gridin
6d7c03b6fd Get rid of TrailingCommaHelper.needComma 2020-05-27 11:24:05 +00:00
Dmitry Gridin
0076f1ddd5 Introduce TrailingCommaContext 2020-05-27 11:24:04 +00:00
Dmitry Gridin
bb329c0415 Move TrailingComma* to separate module 2020-05-27 11:24:03 +00:00
Dmitry Gridin
64bcd32661 Introduce TrailingCommaState 2020-05-27 11:24:03 +00:00
Dmitry Gridin
fbddc6921f KotlinCodeStyleSettings: add hidden settings for trailing comma on call site
#KT-39079
2020-05-27 11:24:02 +00:00
Ilya Chernikov
dec8eb7899 Revert renaming scripting plugin jar:
it conflicts with the compilation on daemon, so transistion should
be planned accordingly, and now it is not a good time for it.
The most important part of the renaming remains intact.

Partially reverts commit "Rename scripting libs and plugin - invert embeddable suffix"
2020-05-27 13:15:50 +02:00
Jinseong Jeon
18953c4717 FIR: transform resolved arrayOf call inside annotation to FirArrayOfCall 2020-05-27 11:38:34 +03:00
Jinseong Jeon
265d066878 FIR2IR: minor refactor to share IrVarargElement creation. 2020-05-27 11:38:32 +03:00
Jinseong Jeon
ff509bdcd3 FIR2IR: fix inverted types for array/element in arrayOf call. 2020-05-27 11:38:32 +03:00
Jinseong Jeon
b93868c30b IR: migrate IrType utils about array element type. 2020-05-27 11:38:32 +03:00
Roman Artemev
49690fc620 [JS IR] Properly detect whether nested class is external
- Fix KT-38765
2020-05-27 10:49:57 +03:00
Denis Zharkov
5bb0085f7e FIR: Fix test data after adba0a03a6 2020-05-27 10:29:46 +03:00
Roman Elizarov
46b426ef77 KT-31741: stdlib: DeepRecursiveFunction (#3398)
Introduces experimental coroutines-based framework to execute deeply recursive functions that utilities the heap and thus avoid StackOverflowError.
2020-05-27 10:06:00 +03:00
Mads Ager
9fa1614903 [JVM] Port line number tests to stepping framework.
Allow specifying JVM and JVM_IR as well as shared expectations.

Add the method name to the step.

Discard steps in synthetic methods.
2020-05-27 07:28:47 +02:00
Mikhail Zarechenskiy
4dbd4a56d5 Compose: adapt new API for intercepting candidates in call resolvers
Most part is made by @lelandrichardson
2020-05-27 01:42:48 +03:00
Roman Artemev
500acf412f [JS TESTS] Regenerate ES6 tests 2020-05-27 00:32:56 +03:00
Roman Artemev
2fd6921806 [JS TESTS] Emulate failing of non-run tests 2020-05-27 00:32:56 +03:00
Roman Artemev
086241659e [JS TESTS] Don't run ES6 test on win & mac till j2v8 issue is fixed. 2020-05-27 00:32:56 +03:00
Roman Artemev
50162265da [JS TESTS] Add EP to disable run test on specific platform 2020-05-27 00:32:56 +03:00
Vitaly
fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Vitaly
fe65045615 [JS BE] add es6 BE and relevant generated tests 2020-05-27 00:32:56 +03:00
Vitaly
a231b21c69 [JS BE] add tests for es6-classes 2020-05-27 00:32:55 +03:00
Vitaly
adf6831d7f [JS BE] implement es6-classes's codegen 2020-05-27 00:32:55 +03:00
Vitaly
90bcf8bf88 [JS BE] add es6LoweringPhase 2020-05-27 00:32:55 +03:00
Vitaly
fd25a5b3c8 [JS BE] es6: save instance after superCall 2020-05-27 00:32:55 +03:00
Vitaly
8c412adfaa [JS BE] implement es6-classes lowering 2020-05-27 00:32:55 +03:00
Vitaly
be85b36025 [JS BE] add flag es6mode 2020-05-27 00:32:55 +03:00
Vitaly
9ede8445e7 [JS BE] add runtime-function and intrinsics for es6-classes 2020-05-27 00:32:54 +03:00
Vitaly
18bd80eb29 [JS BE] add JsClass node to ast 2020-05-27 00:32:54 +03:00
Dmitry Petrov
69fa067df9 Fix compiler bootstrap (1.4.0-dev-9205) 2020-05-27 00:28:58 +03:00
Vladimir Dolzhenko
5c58a9dfd1 PerfTests gradle interceptor clean up 2020-05-26 21:50:31 +02:00
Ilya Chernikov
a1c173733c Fix gradle tests after renaming scripting libs and plugin 2020-05-26 20:24:15 +02:00
Steven Schäfer
9b7a95b05c Parcelize: Fix test code
On Android, we would need to call `setDataPosition(0)` after
unmarshalling a parcel. The reason why the test code is currently
working is purely because the Robolectric test framework is more
permissive.
2020-05-27 02:39:29 +09:00
Steven Schäfer
d93e5d3dc0 Parcelize: Enable ParcelableDeclarationChecker with the parcelize plugin
Previously, the ParcelableDeclarationChecker was only enabled as part of
the view extensions. In particular, the checker was not enabled for the
parcelize test suite.
2020-05-27 02:39:29 +09:00
Steven Schäfer
f93749ae6a Parcelize: Fall back to readValue/writeValue if no other serializers are available 2020-05-27 02:39:28 +09:00
Steven Schäfer
8d364a8a1a Parcelize: Resolve parcel serializers on demand 2020-05-27 02:39:28 +09:00
Steven Schäfer
cfe168021a Parcelize: Remap functions in overridden symbols and callable references 2020-05-27 02:39:28 +09:00
rbares
b39a65305d Fix Parcelize codegen tests following rebase 2020-05-27 02:38:45 +09:00
rbares
8a9610d3af Update Parcelize codegen tests 2020-05-27 02:38:45 +09:00
rbares
00ec50ff73 Fix Parcelize annotation implementing Parcelable.Creator<T> 2020-05-27 02:38:45 +09:00
Vitaliy.Bibaev
20793a65f4 KT-37486 Don't store instances from stream debugger plugin in companions 2020-05-27 02:38:45 +09:00
Yan Zhulanow
0c71c681e5 Do not reformat expressions in ReplaceCallWithBinaryOperatorInspection and SpecifySuperTypeFix 2020-05-27 02:38:45 +09:00
Yan Zhulanow
5a53c6ebf1 Remove ide-plugin-dependencies/tests-common-for-ide project
tests-common are now copied to the kotlin-ide project, so the artifact
  dependency is not needed any more
2020-05-27 02:38:44 +09:00
Yan Zhulanow
ed82465c3c Fix eager inter-project dependency 2020-05-27 02:38:44 +09:00
Yan Zhulanow
fb8640b3b6 Move compilerComponents project list to the root project 2020-05-27 02:38:44 +09:00
Yan Zhulanow
9d1c405b3c Rename ide-artifacts project to ide-plugin-dependencies 2020-05-27 02:38:44 +09:00
Yan Zhulanow
066b6d830f Put IDE plugin dependency artifact building/publishing under a flag 2020-05-27 02:38:44 +09:00
Yan Zhulanow
b00b6b0614 Remove explicit project paths for ide-artifacts projects
Gradle requires the explicit path mappings only if the physical location
  of Gradle build scripts doesn't match project paths.
2020-05-27 02:38:44 +09:00
Yan Zhulanow
91c24605f2 Minimize changes in 202 bunch 2020-05-27 02:38:44 +09:00
Yan Zhulanow
dea902551d Publish artifacts needed for the kotlin-ide repository 2020-05-27 02:38:44 +09:00
Yan Zhulanow
46ac241e2f 202: Fix compatibility with 202 IDEA branch (code) 2020-05-27 02:38:44 +09:00
Yan Zhulanow
f489ac1d03 Fix compatibility with 202 IDEA branch (dependencies) 2020-05-27 02:38:44 +09:00
Yan Zhulanow
a9d0c16fef Add 2020.2 bunch configuration 2020-05-27 02:38:44 +09:00
Yan Zhulanow
8a3e63aaf6 Minor: Clean up jvm-debugger-core module 2020-05-27 02:38:43 +09:00
Yan Zhulanow
3e05f7c2ab Minor: Move EvaluationStatus to the parent dir match its package name 2020-05-27 02:38:43 +09:00
Yan Zhulanow
0bf63c3000 Minor: Move filters to the companion object 2020-05-27 02:38:43 +09:00
Yan Zhulanow
3a0b0770d7 Debugger, minor: Remove obsolete KotlinRuntimeTypeEvaluator 2020-05-27 02:38:43 +09:00
Yan Zhulanow
9e85e9a036 Debugger, minor: Move method filters to the 'smartStepInto' package 2020-05-27 02:38:43 +09:00
Yan Zhulanow
45c97a2c5e Debugger: Add test for KT-14057 2020-05-27 02:38:43 +09:00
Yan Zhulanow
bf890a1540 Debugger, tests: Change ADDITIONAL_BREAKPOINT directive format
- Make it extendable and easier to parse
- Allow to create additional function breakpoints
2020-05-27 02:38:43 +09:00
Yan Zhulanow
4244f05307 Debugger: Fix step over in functions with default parameters (KT-14828)
Adds a synthetic line number just before the original function call.
The new line number is recognized by the debugger which replaces the
  'step over' action with 'step into' and stops.
2020-05-27 02:38:43 +09:00
Yan Zhulanow
d0f34624bd Debugger: Replace unsafe location() calls with safeLocation() 2020-05-27 02:38:43 +09:00
Yan Zhulanow
e6791ea4c3 Minor: merge KotlinSyntheticTypeComponentProvider with the base class
Base class was needed because of the separate bunch.
The bunch was deleted in 254dc8f71c,
  and now it doesn't make sense to have a base class any more.
2020-05-27 02:38:43 +09:00
Yan Zhulanow
69965eaa5c Implement new stepping for suspend functions 2020-05-27 02:38:43 +09:00
Yan Zhulanow
2044ece335 Kapt: Add DUMP_DEFAULT_PARAMETER_VALUES flag (KT-29355)
Put initializers on fields when corresponding primary constructor
  parameters have a default value specified. The new behavior
  is available under the new 'DUMP_DEFAULT_PARAMETER_VALUES' flag.

Note that this doesn't affect regular functions with default parameter
  values, as well as primary constructor parameters without a
  'val' or 'var' keyword.
2020-05-27 02:38:42 +09:00
Yan Zhulanow
60aa47553d Kapt, minor: Move test logic for KaptFlags to the new base class 2020-05-27 02:38:42 +09:00
Yan Zhulanow
c699a5b54c Pill: Disable Pill support for coroutines-experimental module 2020-05-27 02:38:42 +09:00
Yan Zhulanow
8fc403db94 Check if we are inside Kotlin in KotlinClassWithDelegatedPropertyRenderer
As 'isApplicable()' is called for Java classes as well, we spend too
  much time on calling 'allFields()' for deliberately unrelated classes.
2020-05-27 02:38:42 +09:00
Yan Zhulanow
0afd73b95c Debugger: Pass files with inline functions to backend (KT-36404) 2020-05-27 02:38:42 +09:00
Yan Zhulanow
85a5e5241f Debugger: Fix function breakpoints for libraries (KT-36403) 2020-05-27 02:38:42 +09:00
Yan Zhulanow
18070303d5 Update test data (KT-32511) 2020-05-27 02:38:42 +09:00
Yan Zhulanow
797058f781 Update test data (KT-27651) 2020-05-27 02:38:42 +09:00
Toshiaki Kameyama
f6a13df388 Add quick fix for AMBIGUOUS_SUPER
#KT-5271 Fixed
2020-05-27 02:38:42 +09:00
Toshiaki Kameyama
7c0af78b08 UnnecessaryVariableInspection: fix false positive in lambda
#KT-32565 Fixed
2020-05-27 02:38:42 +09:00
Toshiaki Kameyama
64f6ed586b "Convert to primary constructor" inspection: do not report when property has setter
#KT-22142 Fixed
2020-05-27 02:38:42 +09:00
Yan Zhulanow
08f31758b8 Minor: Extract name comparison 2020-05-27 02:38:41 +09:00
Toshiaki Kameyama
19d1532dc7 AddFunctionParametersFix: use argument name as parameter name if argument is referenced variable
#KT-14021 Fixed
2020-05-27 02:38:41 +09:00
Toshiaki Kameyama
8b8059acdd Add quick fix for MANY_IMPL_MEMBER_NOT_IMPLEMENTED
#KT-17121 Fixed
2020-05-27 02:38:41 +09:00
Toshiaki Kameyama
21d6d50241 Create class quick fix: suggest on supertype entry
#KT-32511 Fixed
2020-05-27 02:38:41 +09:00
Toshiaki Kameyama
4973d3c359 "Create enum constant" quick fix: handle trailing comman correctly
#KT-36461 Fixed
#KT-36462 Fixed
2020-05-27 02:38:41 +09:00
Yan Zhulanow
0bd2643788 Fix EA-209582: Add a missing runReadAction() 2020-05-27 02:38:41 +09:00
Yan Zhulanow
075870fee9 Fix EA-207101: Abort changing property declaration from Java accessor
This is not a proper fix. "Change signature" in Kotlin should support
  changing property name/type through accessors. However, it's not
  easy to achieve without a huge refactoring.
2020-05-27 02:38:41 +09:00
Yan Zhulanow
fc433dece8 Fix EA-221456, check for error types before method signature calculation 2020-05-27 02:38:41 +09:00
Yan Zhulanow
c8bad15ba9 Fix EA-210182, check for context validity 2020-05-27 02:38:41 +09:00
Yan Zhulanow
b756e18962 Never treat @JsExport-annotated declarations as not-used instead of @JsName 2020-05-27 02:38:41 +09:00
Yan Zhulanow
ef698a5747 Fix "PSI/index mismatch" in case of @ParameterName on non-functional types (KT-34524) 2020-05-27 02:38:41 +09:00
Yan Zhulanow
d86b54a2f1 Minor: Fix formatting 2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
4638a97bbc "Call on collection type may be reduced": fix false positive with mapNotNull, generic lambda block and new inference
#KT-32801 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
6ee4b5e393 Condition of 'if' expression is constant: don't report when condition has named reference
#KT-27651 Fixed
2020-05-27 02:38:40 +09:00
Yan Zhulanow
bfb5efd490 Minor: Get rid of the hard-coded modifier value 2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
581f83421a Unnecessary parentheses in function call with lambda: don't report for function named 'suspend'
#KT-22878 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
777995a3a0 Add braces: don't insert extra line break and move the following comment
#KT-36194 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
905d0c1016 Unused symbol: do not report for @JsName annotated declarations
#KT-17368 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
7abd0831a1 Unused unary operator: highlight whole expression in yellow
#KT-37156 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
43b106fc72 Can be replaced with binary operator: do not report if it leads to an error/warning after conversion
#KT-25050 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
81d01a8f8e "To ordinary string literal": don't add unnecessary escapes to characters in template expression
#KT-36406 Fixed
2020-05-27 02:38:40 +09:00
Toshiaki Kameyama
bf3e739edf Replace with string templates: add curly braces if needed
#KT-37173 Fixed
2020-05-27 02:38:39 +09:00
Toshiaki Kameyama
8d3e41ae60 ReplaceToWithInfixFormInspection: don't report when call expression has type typeArguments
#KT-36508 Fixed
2020-05-27 02:38:39 +09:00
Toshiaki Kameyama
f7a69d4aa7 Convert lambda to reference: suggest on lambda argument for suspend function parameter
#KT-34378 Fixed
2020-05-27 02:38:39 +09:00
Toshiaki Kameyama
9b6b25f069 Convert lambda to reference: suggest on lambda argument for extension function parameter
#KT-22014 Fixed
#KT-22015 Fixed
2020-05-27 02:38:39 +09:00
Toshiaki Kameyama
b8ae13b3d9 RedundantLetInspection: remove 'let' safe call correctly
#KT-37148 Fixed
2020-05-27 02:38:39 +09:00
Toshiaki Kameyama
a2f55e8b7c Remove redundant calls of the conversion method: report for unsigned types
#KT-30263 Fixed
2020-05-27 02:38:39 +09:00
Yan Zhulanow
38b6b73745 Add additional diagnostic for EA-225967 2020-05-27 02:38:39 +09:00
Yan Zhulanow
36f3ff7d20 Add stack trace logging for EA-225969 2020-05-27 02:38:39 +09:00
Yan Zhulanow
c1b57e8681 Pill: Remove "Refresh Pill model" run configuration
Just invoke ./gradlew pill task, there is no need in the extra
  run configuration.
2020-05-27 02:38:39 +09:00
Dmitry Petrov
f81be526bc Support deserialized IR in IfNullExpressionsFusionLowering
Deserializer generates simple branches instead of IrElseBranches.
2020-05-26 20:29:12 +03:00
Svyatoslav Scherbina
c9f721848a Fix Throws declaration in Native diagnostics tests
Align annotation target with real declaration in Native stdlib
2020-05-26 20:24:35 +03:00
Svyatoslav Scherbina
fa152593ef Fix false-positive @Throws error diagnostics in Native
Don't report
THROWS_LIST_EMPTY and MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND
caused by unresolved arguments.
2020-05-26 20:24:34 +03:00
Svyatoslav Scherbina
242d0aa26e Add Native diagnostics for @Throws suspend fun
`@Throws suspend fun` must have CancellationException accepted.

Also add more tests.
2020-05-26 20:24:32 +03:00
Svyatoslav Scherbina
3e8b0055ab Decouple Call.hasUnresolvedArguments from ResolutionContext 2020-05-26 20:24:30 +03:00
Sergey Rostov
eb338e2e91 Scripting IDE cache: unblocking concurrent update
#KT-38875 Fixed

(cherry picked from commit 63e355d979)
2020-05-26 19:22:15 +03:00
Sergey Rostov
e3ed8870dd scripting, sdk cache: same key for locating sdk 2020-05-26 19:22:09 +03:00
Sergey Rostov
8d00ec1933 scripting: fixes after rebase 2020-05-26 19:22:08 +03:00
Sergey Rostov
74b189fa54 idea.core.script.ucache: remove cyrilic "c" in package name 2020-05-26 19:22:08 +03:00
Natalia Selezneva
5212054af6 Fix sdk duplication in ProjectSdkTable in tests 2020-05-26 19:22:08 +03:00
Sergey Rostov
72aba2fce2 IDE scripting: add default sdk only when used 2020-05-26 19:22:07 +03:00
Sergey Rostov
53983a99e5 Fix order of ExternalSystemListeners 2020-05-26 19:22:07 +03:00
Sergey Rostov
06dbbe2452 KotlinDslModels: project can be null in ExternalSystemTaskNotificationListener.onStart 2020-05-26 19:22:07 +03:00
Sergey Rostov
44f6d490b6 scripting ucache: update synchronously in unit test mode 2020-05-26 19:22:06 +03:00
Sergey Rostov
e613bc406e 201: proper implementation for AsyncFileChangeListenerHelper.kt
updateFile is called before changes in vfs, so the timestamp is old there.
The proper implementation is to collect changed files in list and get timestamp in apply.
2020-05-26 19:22:06 +03:00
Sergey Rostov
8f8ee1ea83 Scripting unified cache: update sdks synchronously on changes 2020-05-26 19:22:06 +03:00
Sergey Rostov
037ea224a4 GradleBuildRoot: don't store references to virtual files 2020-05-26 19:22:06 +03:00
Sergey Rostov
a97e9f641a remove stale GradleScriptInputsWatcher references 2020-05-26 19:22:06 +03:00
Sergey Rostov
494a4460c1 minor: ScriptingSupport.Provider -> ScriptingSupport, KDoc 2020-05-26 19:22:05 +03:00
Sergey Rostov
40c852e818 GradleScriptOutOfProjectTest: roots are already registered as legacy 2020-05-26 19:22:05 +03:00
Sergey Rostov
cf4ad1908b Fix lastIndexOfOrNull 2020-05-26 19:22:05 +03:00
Sergey Rostov
c604ef1255 Scripting, minor: updateScriptDefinitions -> updateScriptDefinitionReferences 2020-05-26 19:22:05 +03:00
Sergey Rostov
cfe6fee1ca ScriptClassRootsCache, sdk: use toSystemIndependentName 2020-05-26 19:22:05 +03:00
Sergey Rostov
eda95af999 gradle.kts, minor: remove unused code 2020-05-26 19:22:04 +03:00
Sergey Rostov
cb3e08b345 GradleScriptListenerTest: add gradle-wrapper.properties to specify gradle version explicitly 2020-05-26 19:22:04 +03:00
Sergey Rostov
ec9608b00d ScriptClassRootsUpdater, updateSynchronously: cancel before waiting for lock 2020-05-26 19:22:04 +03:00
Sergey Rostov
59c35fe35c ScriptClassRootsUpdater: fix clearing scheduledUpdate and check cancelled in sync 2020-05-26 19:22:04 +03:00
Sergey Rostov
2932c67db7 gradle.kts: remove LastModifiedFiles fs data when removing gradle root 2020-05-26 19:22:04 +03:00
Sergey Rostov
6b53a98399 gradle.kts, minor: move isInAffectedGradleProjectFiles inside GradleBuildRootsManager 2020-05-26 19:22:03 +03:00
Sergey Rostov
b233a2a83a GradleScriptListenerTest: link gradle project 2020-05-26 19:22:03 +03:00
Sergey Rostov
13abfda00b GradleBuildRootsManager: fix onProjectsLinked 2020-05-26 19:22:03 +03:00
Sergey Rostov
5cd9e99caa GradleLegacyScriptListener: call from GradleScriptListener
GradleScriptListener is called from VFS listener
2020-05-26 19:22:03 +03:00
Sergey Rostov
bac68816d2 gradle.kts: use toSystemIndependentName for paths coming from Gradle 2020-05-26 19:22:02 +03:00
Sergey Rostov
381d505430 ScriptClassRootsUpdater: run synchronously in unit test mode 2020-05-26 19:22:02 +03:00
Sergey Rostov
4e8b1634e6 UnusedSymbolInspection: load script configurations from cache 2020-05-26 19:22:02 +03:00
Sergey Rostov
d937b66f30 gradle.kts, scheduleLastModifiedFilesSave: fix race condition 2020-05-26 19:22:02 +03:00
Sergey Rostov
e168cb739c gradle.kts, minor: areRelatedFilesUpToDate -> areRelatedFilesChangedBefore 2020-05-26 19:22:02 +03:00
Sergey Rostov
d84acb8ca2 GradleScriptListener: update lastModifiedFiles on document change 2020-05-26 19:22:01 +03:00
Sergey Rostov
62bd16ddf9 GradleBuildRoot: fix loading lastModifiedFiles 2020-05-26 19:22:01 +03:00
Sergey Rostov
70a3877546 LastModifiedFiles: fix in case of sequential changes in same file 2020-05-26 19:22:01 +03:00
Sergey Rostov
f161276949 .gradle.kts, listener: support multiple gradle projects linked to one IntelliJ project
GradleScriptInputsWatcher moved to GradleScriptListener.kt and GradleBuildRootsManager.kt
2020-05-26 19:22:01 +03:00
Sergey Rostov
e376a04b5a gradle.kts: docs 2020-05-26 19:22:00 +03:00
Sergey Rostov
d6adab785a ScriptConfigurationManager: take OutsidersPsiFileSupport into account 2020-05-26 19:22:00 +03:00
Sergey Rostov
bfa88267ec Scripts, minor: get rid of ScriptingSupportHelper 2020-05-26 19:22:00 +03:00
Sergey Rostov
bae550665e gradle.kts: merge data on failed gradle sync, fix updates scheduling in corner cases 2020-05-26 19:22:00 +03:00
Sergey Rostov
381374d339 gradle.kts: solve the linked gradle builds hell 2020-05-26 19:22:00 +03:00
Sergey Rostov
d8abf60b3d gradle.kts, imported gradle build root: fix equality 2020-05-26 19:21:59 +03:00
Sergey Rostov
560c2b62ef ScriptConfigurationManager, outsider files: search in roots cache too 2020-05-26 19:21:59 +03:00
Sergey Rostov
347f69b1fd ScriptConfigurationManager: rebuild cache synchronously from default loader 2020-05-26 19:21:59 +03:00
Sergey Rostov
feac19f46e gradle.kts: cache definitions 2020-05-26 19:21:59 +03:00
Sergey Rostov
1fdd1bcbf6 gradle.kts: remove useless gradle build root kinds 2020-05-26 19:21:58 +03:00
Sergey Rostov
4e61758188 CompositeScriptConfigurationManager: unified caching 2020-05-26 19:21:58 +03:00
Sergey Rostov
d21a7f54e4 GradleScriptConfigurationLoader: KDocs 2020-05-26 19:21:58 +03:00
Sergey Rostov
8f75f72835 Revert "Fix order of ExternalSystemListeners"
This reverts commit 879fe9b4
2020-05-26 19:21:58 +03:00
Sergey Rostov
7ec82ba279 Revert "KotlinDslModels: project can be null in ExternalSystemTaskNotificationListener.onStart"
This reverts commit 98d3855f
2020-05-26 19:21:57 +03:00
Natalia Selezneva
ba5fe6cda9 Testing: Avoid creating duplicated SDKs 2020-05-26 19:21:57 +03:00
nataliya.valtman
22243c756b Revert "KT-38250 The minimal supported Gradle version is 5.3 now"
This reverts commit 61f213c8
2020-05-26 19:06:47 +03:00
Ilya Goncharov
f7ee9b42d7 [Gradle, JS] Update package json only if version of dependency changed 2020-05-26 18:21:42 +03:00
Ilya Goncharov
f064634eb0 [Gradle, JS] Backport possibility to disable granular workspaces 2020-05-26 18:21:42 +03:00
Ilya Goncharov
60515aad77 [Gradle, JS] Move umbrella task to nodejs extension 2020-05-26 18:21:42 +03:00
Ilya Goncharov
549797c719 [Gradle, JS] Add nodeArgs 2020-05-26 18:21:42 +03:00
Ilya Goncharov
b201ff0168 [Gradle, JS] Args for webpack 2020-05-26 18:21:42 +03:00
Ilya Goncharov
0a704cf52c [Gradle, JS] Add generate config only to webpack 2020-05-26 18:21:42 +03:00
Sergey Rostov
61f213c80c KT-38250 The minimal supported Gradle version is 5.3 now
Gradle integration tests: use at least OLDEST_SUPPORTED version.

extract minSupportedGradleVersion for using both in check and tests

avoid using Usage.JAVA_API_JARS and JAVA_RUNTIME_JARS
2020-05-26 18:08:26 +03:00
Nicolay Mitropolsky
0bb3a4ccb7 201: Uast: KotlinUastCodeGenerationPlugin on the level needed for ReactorSupport (KT-38062) 2020-05-26 17:39:43 +03:00
Nicolay Mitropolsky
8434806f56 Ide-common: resolveToKotlinType moved to TypeUtils.kt in the *ide-common* 2020-05-26 17:39:43 +03:00
Nicolay Mitropolsky
70237ecf31 Uast: explicitly expose implicit Lambda parameters 2020-05-26 17:39:43 +03:00
Nicolay Mitropolsky
5f64c6b9f1 Uast: a proper sourcePsi for lambda parameters 2020-05-26 17:39:43 +03:00
anastasiia.spaseeva
9d862aaa1d [Spec tests] Remove spec info from fir tests 2020-05-26 17:27:06 +03:00
anastasiia.spaseeva
5ba9d09278 [Spec tests] Fix fir test runner for spec tests 2020-05-26 17:27:06 +03:00
Ilya Chernikov
2509dfb287 Rename scripting libs and plugin - invert embeddable suffix
now regular, unshaded libs, are named with suffix `-unshaded`, while
former `-embeddable` ones named without any suffix. This will encoursge
use of the shaded libs by default, avoiding conflicts with 3-party
libs packed into the `kotlin-compiler`.
Note, that only the "frontline" libs are renamed to avoid switching
problems, the ones that not normally used directly are left as is,
including the `kotlin-compiler` itself.
2020-05-26 15:58:25 +02:00
Zalim Bashorov
f39165bb58 Revert accidentally pushed changes
Revert "~~~"

This reverts commit 03fcbfad

Revert "Add an ability to provide own handler for errors inside KotlinJavascriptMetadataUtils.loadMetadata"

This reverts commit 69827fc5

Revert "Add more detailed message for EA-227305 and EA-226744"

This reverts commit b79b3507
2020-05-26 16:15:59 +03:00
Roman Golyshev
eb838b0fa0 KT-39179 Replace ApplicationBundle with KotlinBundle
- Used bundle messages are moved to JavaBundle in platform >= 201
- ^KT-39179 Fixed
2020-05-26 13:00:12 +00:00
Zalim Bashorov
03fcbfad1a ~~~ 2020-05-26 15:43:05 +03:00
Zalim Bashorov
69827fc5af Add an ability to provide own handler for errors inside KotlinJavascriptMetadataUtils.loadMetadata
Use a logger to handle errors inside loadMetadata when it's used from IDE (JsResolverForModuleFactory).

#EA-218905
2020-05-26 15:41:47 +03:00
Zalim Bashorov
b79b3507f2 Add more detailed message for EA-227305 and EA-226744 2020-05-26 15:41:47 +03:00
Krasnoriadtseva Anastasiia
a55dec28b9 [FIR] Fix infinite CFG traverse 2020-05-26 15:30:45 +03:00
Roman Artemev
7644b4baec [KLIB] Improve performance a bit 2020-05-26 14:41:49 +03:00
Roman Artemev
44dfae53f0 [IR BE] Add runtime compilation benchmarks for IR JS compiler 2020-05-26 14:41:49 +03:00
Roman Artemev
e6c855111e [KLIB] Add flag to select between per-file and monolithic layout 2020-05-26 14:41:49 +03:00
Roman Artemev
444ecc0981 [PLUGIN API] Fix misprint 2020-05-26 14:38:18 +03:00
Roman Artemev
bc32688497 [PLUGIN API] Drop PureIrGenerationExtension 2020-05-26 14:38:18 +03:00
Roman Artemev
6f2972ee8b [ANDROID] Move Parcelize plugin to general IrGenerationExtension API 2020-05-26 14:38:18 +03:00
Juan Chen
adba0a03a6 [FIR] Create builtin primitive array types for properties
If the primary constructor has a vararg parameter, the corresponding
property has an array type. This commit creates the builtin array
types for such properties if the vararg element type is primitive,
e.g., CharArray instead of Array.
2020-05-26 14:08:47 +03:00
Vladimir Ilmov
ed6aceca87 (UnusedSymbolInspection) lazy parameter evaluation fix 2020-05-26 12:36:42 +02:00
Nikolay Krasko
4a7854a948 Sign and generate hash for compiler and plugin zip 2020-05-26 12:47:10 +03:00
Vladimir Dolzhenko
bf5c7aea4d Added heapDumper for perfTests 2020-05-26 11:09:25 +02:00
Dmitry Petrov
2f79b4c412 Add test for KT-34902 2020-05-26 11:59:05 +03:00
Mikhail Glukhikh
4455532210 JsIntrinsics: use createEmptyExternalPackageFragment 2020-05-26 11:50:55 +03:00
Mikhail Glukhikh
7818baff1e [FIR2IR] Fix problem with double-generation of local class members 2020-05-26 11:50:33 +03:00
Vyacheslav Gerasimov
64fcbbc89f Build: buildSrc should inherit build cache setup of parent project
https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_composite
2020-05-26 10:39:27 +03:00
Vyacheslav Gerasimov
5bca9c488e Build: Don't unpack ivy repo artifacts if target directory exists 2020-05-26 07:18:09 +03:00
Vladimir Dolzhenko
bca8e96362 Clean up after nicer performance tests suite dsl 2020-05-25 21:54:56 +02:00
simon.ogorodnik
ac1769a474 [FIR2IR] Support SAM constructors 2020-05-25 21:24:39 +03:00
simon.ogorodnik
dbc564e74e [FIR2IR] Approximate types for lambdas before passing to serialization 2020-05-25 21:24:39 +03:00
simon.ogorodnik
b92194229c [FIR] Add fir copy function generation 2020-05-25 21:24:38 +03:00
pyos
f625444be2 Update debugger test data
Note: neither the new nor the old data is actually correct, as the
debugger needs to stop on line 7 twice (once for the call, once for the
lambda) but ignore the synthetic line number in between.
2020-05-25 20:03:56 +02:00
pyos
76c34a07b2 JVM: use 1 as a synthetic line number for @InlineOnly lambdas
The source path already marks it as synthetic.
2020-05-25 20:03:56 +02:00
pyos
25e1fb8502 JVM: map synthetic line numbers through the SMAP
This is necessary so that IDEA does not ignore the line number.
2020-05-25 20:03:56 +02:00
pyos
d17a18f96d JVM: do not write trivial SMAPs to classes outside inline funs
where trivial == those that map the file to itself.
2020-05-25 20:03:56 +02:00
Pavel Punegov
a04aeeb4e1 Ignore broken test in Native 2020-05-25 20:58:43 +03:00
Victor Petukhov
e70242f6f1 NI: some review fixes for improved postponed arguments analysis 2020-05-25 19:37:30 +03:00
Victor Petukhov
756326cefe NI: report error diagnostic about impossible to infer anonymous function's parameter
Partially fixed KT-39098
2020-05-25 19:37:27 +03:00
Dmitry Savvinov
00df562a2b Allow specific native targets to depend on unspecified native target
^KT-38769 Fixed
2020-05-25 16:13:10 +03:00
Vladimir Dolzhenko
55dc308688 Projects HL perf test 2020-05-25 13:11:10 +00:00
Vladimir Dolzhenko
1ae7f693c5 Nicer performance tests suite dsl 2020-05-25 13:11:09 +00:00
Mikhail Zarechenskiy
2cee82a348 [NI] Resolve receiver of provideDelegate independently
#KT-38259 Fixed
2020-05-25 16:06:55 +03:00
Mikhail Zarechenskiy
59f027e3e9 [NI] Don't try performing any conversions on receivers 2020-05-25 16:06:55 +03:00
Vladimir Ilmov
de69962e9d (UnusedSymbolInspection) alternative accessor names for searching references
relates to #KT-38653
2020-05-25 14:49:16 +02:00
Vladimir Ilmov
17df7ade59 (UnusedSymbolInspection) Optimize second call to isCheapEnoughToSearchUsages
relates to #KT-38653
2020-05-25 14:49:16 +02:00
Mikhail Glukhikh
6c124ccd0c [IR] Drop deprecated symbol.descriptor based declaration constructors 2020-05-25 15:40:38 +03:00
Mikhail Glukhikh
bb2e58b6a4 Deprecate IrDeclaration.descriptor and IrSymbol.descriptor 2020-05-25 15:40:38 +03:00
Mikhail Glukhikh
b05a1bb1a2 [IR] Extract IrExternalPackageFragmentImpl.createEmptyExternalPackageFragment 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
12f596c620 [IR] Unbind construction methods of IR file/enum entry/type alias from symbol.descriptor 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
c68de4639f [IR] Unbind construction methods of IrLocalDelegatedPropertyImpl from symbol.descriptor 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
58ef59074d [IR] Unbind construction methods of IrTypeParameterImpl from symbol.descriptor 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
3f09bb40c0 [IR] Unbind construction methods of IrVariableImpl from symbol.descriptor 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
784d3a9005 [IR] Unbind construction methods of IrValueParameterImpl from symbol.descriptor 2020-05-25 15:40:37 +03:00
Mikhail Glukhikh
03f2c6d38a [IR] Unbind construction methods of IrFieldImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh
ab15a88ce4 [IR] Unbind construction methods of IrPropertyImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh
7840adde12 [IR] Unbind construction methods of IrConstructorImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh
262548fd5b [IR] Unbind construction methods of IrFunctionImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh
a7d514a0a9 [IR] Unbind construction methods of IrClassImpl from symbol.descriptor 2020-05-25 15:40:35 +03:00
Vladimir Ilmov
9e807ebb89 (CoroutineDebugger) Prevent navigation to internalCompiledFiles
#KT-39143 fixed
2020-05-25 14:36:22 +02:00
Vladimir Ilmov
545fdb96d5 (CoroutineDebugger) 201 compatibility fix
#KT-39143 fixed
2020-05-25 14:36:22 +02:00
Vladimir Ilmov
7a70f8d29e (CoroutineDebugger) executionContext added to ContinuationVariableValueDescriptor 2020-05-25 14:36:21 +02:00
Roman Artemev
257c4c5604 [PLUGIN API] Extract IrPluginContext into separate interface
- Isolate ir infrastructure implementation details behind special interface
2020-05-25 13:26:35 +03:00
Victor Petukhov
a84780fefb NI: Add regression test for KT-38799
The issue has been fixed by introducing the modified postponed arguments analysis (KT-37952)
2020-05-25 11:56:08 +03:00
Roman Golyshev
4436142f00 KT-38450 Add functional interface converter to the NJ2K
- Enable custom compiler options for
`AbstractNewJavaToKotlinConverterSingleFileTest`
- ^KT-38450 Fixed
2020-05-25 11:11:24 +03:00
gcx11
50fc9d3692 KT-10974 - code review changes 2020-05-25 10:40:24 +03:00
gcx11
2382629209 KT-10974 - code review changes 2020-05-25 10:40:24 +03:00
gcx11
a2dc2fe5bb KT-10974 - small fixes 2020-05-25 10:40:24 +03:00
gcx11
8849a66c00 KT-10974 - add import layout configuration table 2020-05-25 10:40:24 +03:00
Sergey Rostov
9574ac83e4 jps: testPureJavaProject fix 2020-05-25 10:06:11 +03:00
Ilya Chernikov
574b917061 Remove new kotlin daemon from dist
hopefully temporarily, also see #KTI-173
2020-05-24 19:03:43 +02:00
Ilya Chernikov
3dd79ffea6 Update coroutines-core version to 1.3.7 2020-05-24 19:03:43 +02:00
Ilya Chernikov
9d98c90881 Drop coroutines from compiler jar, add appropriate plugin dependency
#KT-30778 fixed
2020-05-24 19:03:42 +02:00
Dmitriy Novozhilov
343e519f7f [FIR-PLUGIN] Update testdata according removed class generation stage 2020-05-24 18:04:48 +03:00
Dmitriy Novozhilov
e340dacb9a [FIR-PLUGIN] Add check to test that jar with annotations exists 2020-05-24 18:04:48 +03:00
Dmitriy Novozhilov
d49c198a7f [FIR] Correctly initialize extensions in all sessions 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov
96da6d35c5 [FIR] Add processor for transforming statuses with plugins 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov
8d686226c7 [FIR] Introduce FirResolveProcessors 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov
96802dde04 [FIR-PLUGIN] Fix compilation 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov
3de12f9b09 [FIR] Completely remove old extensions service 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov
9a8d520b85 [FIR] Remove first version of class generation transformer 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov
3e3387fb69 [FIR] Remove extension status transformation from status resolve 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov
006232dfb2 [FIR] Fix FirPluginAnnotationsResolveTransformer 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov
206a646195 [FIR] Use caches for predicate matching 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov
594a854b4e [FIR] Reimplement FirExtensionService
- Get rid of old FirExtensionsService
- Implement new FirExtensionService
- Remove duplicating code in FirExtensionRegistrar
2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov
846db641be [FIR] Make ArrayMap iterable 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov
5c12b3df95 [FIR] Introduce FirPredicateBasedProvider 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov
0b00015424 [FIR] Deprecate FirExtensionsService 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov
f3d4fa715e [FIR] Introduce DeclarationPredicates for matching declarations for extensions 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov
74353d8bc9 [FIR] Introduce FirAnnotatedDeclaration 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov
799253256c [FIR-PLUGIN] Add additional checker to prototype plugin 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov
f764baad82 [FIR] Add extension with additional checkers 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov
04a1027b39 [FIR] Add empty instances of DeclarationCheckers and ExpressionCheckers 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov
c0a57ae55c [FIR] Move expression checkers from package call to expression 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov
6d6ed1e755 [FIR] Create session component with registered checkers 2020-05-24 18:04:43 +03:00
Mikhail Bogdanov
b61b4e4a97 Use proper distributionSha256Sum for android tests 2020-05-24 15:37:59 +02:00
Andrey Uskov
bfad00e8c9 Mute android-related gradle import tests 2020-05-23 23:16:42 +03:00
Ilya Gorbunov
22c4d30a89 Correct docs of ThreadLocal and SharedImmutable annotations
- clarify that they have effect only in K/N
- correct possible application targets of SharedImmutable

KT-36245
2020-05-23 22:28:46 +03:00
Ilya Gorbunov
dae7a23998 Clarify docs of CharSequence.split(Pattern, limit)
Emphasize differences from Pattern.split(CharSequence, limit).

#KT-39023 Fixed
2020-05-23 22:25:54 +03:00
Abduqodiri Qurbonzoda
f3145454f2 Decommonize collection builder implementations 2020-05-23 03:40:44 +03:00
Victor Petukhov
379c6944a2 NI: extract diagnostics from partially resolved call instead of separately handling it including running all checks
^KT-37630 Fixed
^KT-35494 Fixed
2020-05-22 22:13:53 +03:00
Ilya Matveev
eaa16714f6 [Gradle, native] Allow disabling warning about incorrect dependencies
Issue #KT-32476
2020-05-22 22:16:18 +07:00
Svyatoslav Kuzmich
c9adf22697 [JS] Remove binding context from NameSuggestion instance
Pass bindingContext to suggest method instead.
Revert creating multiple instances of NameSuggestion in checkers.
2020-05-22 17:05:30 +03:00
Ilya Goncharov
104352b313 [Gradle, JS] Remove browser tests from gradle integration tests 2020-05-22 13:25:23 +03:00
Svyatoslav Kuzmich
6e3d3831c2 [JS] JsExport diagnostics and legacy support
Account for JsExport in legacy backend namer. It means we
catch overloaded exported function conflicts for free!

Add error diagnostics:
* NESTED_JS_EXPORT (Fixes KT-36798)
* WRONG_EXPORTED_DECLARATION (Part of the fix for KT-37752)
* NON_EXPORTABLE_TYPE (Fixes KT-37771)
2020-05-22 10:50:22 +03:00
Dmitriy Dolovov
4076bf40a9 [Commonizer] Add Gradle property to pass JVM args
^KT-39094
2020-05-22 12:07:37 +07:00
Dmitriy Dolovov
2a1e014d51 Minor. Add jetbrains to project dictionary 2020-05-22 12:07:26 +07:00
anastasiia.spaseeva
c736a1e5b0 [Spec tests] Update testsMap for when-expression section 2020-05-22 02:52:02 +03:00
anastasiia.spaseeva
d9160a26e9 [Spec tests] Add property helpers to testMaps 2020-05-22 02:52:02 +03:00
anastasiia.spaseeva
cbba52e43c [Spec tests] Make collectInfoFromTests for both spec and implementation tests 2020-05-22 02:52:01 +03:00
anastasiia.spaseeva
270972ca1c [Spec tests] Make main link nullable for case if implementation tests don't have this one 2020-05-22 02:52:00 +03:00
anastasiia.spaseeva
3a46b5a45a [Spec tests] Add path element at testMaps for main links also 2020-05-22 02:52:00 +03:00
anastasiia.spaseeva
d94c212a60 [Spec tests] Add linkType element to testMaps 2020-05-22 02:51:59 +03:00
anastasiia.spaseeva
3a31150df4 [Spec tests] Metadata refactoring: remove duplicated links in testMaps 2020-05-22 02:51:58 +03:00
anastasiia.spaseeva
d32aca87d1 [Spec tests] Change metadata structure of implementation and spec tests 2020-05-22 02:51:57 +03:00
Mikhail Likholetov
80cd26c9df [FIR] Support several annotation class diagnostics 2020-05-21 18:01:36 +03:00
Ilya Chernikov
c112d37ac1 Consolidate resolving in the new lib, deprecate it in script-util
also deprecate Import and CompileOptions annotations, because they
do not seem generic enough. Create specific copie in the main-kts
instead.
2020-05-21 16:49:57 +02:00
Ilya Chernikov
7d426226f9 Switch example to the new maven resolving API 2020-05-21 16:49:56 +02:00
Ilya Chernikov
f363134fbc Do not continue compilation if collected dependencies contain error
avoids additional errors reported by compilation, if configuration
refinement returned error
2020-05-21 16:49:56 +02:00
Ilya Chernikov
d92e4d28f5 Provide a method to update script definitions after loading into IDE
also documenting ScriptDefinitionsProvider
2020-05-21 16:49:56 +02:00
Ilya Chernikov
4b032a14af Refactor host configuration handling and script definition creation
so it is possible now to create custom host configuration with template
and all configurations are handled consistenly.
Also introduce and use new ScriptDefinition class wrapping compilation
and evaluation configurations, that could be consistenly created from a
template.
2020-05-21 16:49:55 +02:00
Ilya Chernikov
255ad47406 Use copied key to extract default jdkHome from host configuration 2020-05-21 16:49:55 +02:00
Ilya Chernikov
20bbcd5d5a Implement copied key with ability to take default from source config 2020-05-21 16:49:55 +02:00
Ilya Goncharov
3c9207a2cd [Gradle, JS] Add test on local project dependency
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
985623eac5 [Gradle, JS] Fix hmpp on only js
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
bed7b23d6c [Gradle, JS] Fix naming of test and test data
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
d089bbe14a [Gradle, JS] Fix for JsIrTarget in mixed mode
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
79984b6e04 [Gradle, JS] Add test on hmpp with both js
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
a6812e5d6a [Gradle, JS] Add fake common usage context for single js plugin publish
#KT-38592 fixed
2020-05-21 17:36:33 +03:00
Ilya Goncharov
4f747072f4 [Gradle, JS] Define fake configuration for single js plugin to publish as common
#KT-38592 fixed
2020-05-21 17:36:32 +03:00
Ilya Goncharov
22f5d3b134 [Gradle, JS] Add isMpp property
#KT-38592 fixed
2020-05-21 17:36:32 +03:00
Pavel Kirpichenkov
0b33e9430b [NI] Report unstable smart cast directly instead of using SmartCastManager
Fix compilation errors, revealed by this fix.

SmartCastManager is unnecessary for error reporting, intermediate diagnostics from the NI contain all required infromation.
When SmartCastManager is used it leads to missing unstable smart casts in case of expressions with captured types.
This happens, because data flow info is recorded for original expression without captured types, which is used as a key.
DataFlowValues created from receivers with captured types can't be used to retrieve that info.

^KT-39010 Fixed
2020-05-21 17:09:10 +03:00
Dmitry Gridin
b808d5f381 TrailingCommaInspection: cleanup code 2020-05-21 13:42:30 +00:00
Dmitry Gridin
ee141ae57b TrailingCommaInspection: add dependency to settings
* Change severity to `INFO`
* Mark useless comma as unused symbol
* Add dependency on `Use trailing comma`

#KT-39069 Fixed
#KT-38568 Fixed
2020-05-21 13:42:29 +00:00
Ilya Matveev
8d77ec83c6 [Gradle, native] Don't set system properties when the compiler runs in daemon
Changing system properties during parallel in-process compiler
execution may cause data races (e.g. see KT-37362, KT-37442).

This commit abandons using system properties when the compiler
is executed in process.

Issue #KT-37550 fixed
2020-05-21 12:05:24 +00:00
Ilya Matveev
f88722ae76 Update K/N: 1.4-M3-dev-15627 2020-05-21 12:05:23 +00:00
Roman Golyshev
a83b0bef96 KT-38841 Do not call preparePsiElementForWrite if not needed
- This call breaks Intention Preview for all intentions that extend
`SelfTargetingIntention`
- This check is actually already performed by the platform before the
intention invocation (but only if `startInWriteAction` returns `true`)
- There are many other intentions which redundantly use this call, but
most of them implement `LocalQuickFix`, which means that they are
inspection based. Currently Intention Preview does not seem to support
this kind of intentions
2020-05-21 11:45:48 +00:00
Dmitry Petrov
b89878a509 Update testData for KAPT tests for new inline class ABI
Since class member functions returning inline class values are now
mangled, they are not visible from Java.
2020-05-21 13:56:57 +03:00
Jinseong Jeon
7a947e8008 FIR: fix default constructor visibility for enum entry. 2020-05-21 08:40:03 +03:00
Jinseong Jeon
0d3301b695 FIR: resolve local class in anonymous initializer. 2020-05-21 08:36:49 +03:00
Mikhail Zarechenskiy
2ff5b253ae [NI] Fix suspend conversions for subtypes of functional types
Fix for recently added tests:
  - testIntersectionTypeToSubtypeConversion
  - testSubtypeOfFunctionalTypeToSuspendConversion
2020-05-21 00:47:12 +03:00
Roman Golyshev
3903814c9c Revert "KT-38841 Remove redundant preparePsiElementForWrite call"
This reverts commit 165b62da

Something went wrong with the AS40 build
2020-05-20 22:58:49 +03:00
Victor Petukhov
12db3d6e83 NI: remove separation of variable fixation order by constraint kind
The commit partially reverts ec4d9d2f1f

^KT-37914 Fixed
2020-05-20 22:37:30 +03:00
Dmitry Petrov
874fa5b998 Bootstrap: 1.4.0-dev-8798 2020-05-20 18:02:11 +03:00
Roman Golyshev
165b62da63 KT-38841 Remove redundant preparePsiElementForWrite call
- This call breaks Intention Preview for all intentions that extend
`SelfTargetingIntention`
- This check is actually already performed by the platform before the
intention invocation
- There are many other intentions which redundantly use this call, but
most of them implement `LocalQuickFix`, which means that they are
inspection based. Currently Intention Preview does not seem to support
this kind of intentions
2020-05-20 14:33:21 +00:00
Steven Schäfer
933440dc63 JVM IR: Fix mangling of @JvmStatic internal function in companion objects 2020-05-20 15:57:03 +02:00
Vladimir Dolzhenko
2d0445ebaa Add klib extension to ARCHIVE fileType
Fixed to #KT-38767
Relates to #KT-38571
2020-05-20 13:24:11 +00:00
Mikhail Zarechenskiy
fceaf65729 [NI] Don't compute conversions for definitely not SAM parameter 2020-05-20 15:30:14 +03:00
Mikhail Zarechenskiy
8bdc4d34f7 [NI] Commonize type-conversions (SAM/Suspend)
- Allow participating subtypes of functional types in conversions
 - Fix several subtle inconsistencies
 - Place logic about conversions at one place

 Now conversions operations have two stages: before usual subtyping
 check and after one. This is needed to support conversions of
 subtypes (of functional types, for example). First, the compiler
 checks if it possible to resolve an argument without conversion and
 only then it tries to perform conversion.
 Note that it'd be incorrect to perform conversion eagerly as it can
 change resolve (Runnable & () -> Unit <: KRunnable), plus we can't
 guess whether conversion is needed at all as it's important not to
 look into supertypes if resolution doesn't actually needed it

 #KT-36448 Fixed
 #KT-37574 Fixed
 #KT-38604 Fixed
2020-05-20 15:30:14 +03:00
Mikhail Zarechenskiy
f702da5c51 [NI] Small refactoring around type conversions 2020-05-20 15:30:13 +03:00
Mikhail Zarechenskiy
d3d162f9c8 Refactoring: start commonization of type-conversions 2020-05-20 15:30:13 +03:00
Mikhail Zarechenskiy
cce9646c7d Refactoring: extract method about SAM conversions out 2020-05-20 15:30:13 +03:00
Mikhail Zarechenskiy
372f378edc [NI] Support nested transactions inside constraint system 2020-05-20 15:30:13 +03:00
Kevin Most
4f26ac9a04 Fix "Koltin" typos throughout codebase (#3383)
* Fix "Koltin" typos throughout codebase

* Update K2MetadataKlibSerializer.kt
2020-05-20 15:12:32 +03:00
Sergey Igushkin
38fd9c3d1a Fix KT-39063 by not adding extendsFrom with metadata configurations
Issue #KT-39063 Fixed
2020-05-20 14:31:36 +03:00
Dmitry Petrov
6fcdab23cc Bootstrap: 1.4.0-dev-8774 2020-05-20 13:47:39 +03:00
Vladimir Dolzhenko
88efac00b3 Disable klib fileType in lue of KLibFileTypeFactory
Relates to #KT-38767
Relates to #KT-38571
2020-05-20 10:07:03 +00:00
Toshiaki Kameyama
081d6c1dff Useless call on collection: propose 'Replace with toList()' instead of 'Remove useless call' if receiver is array type
#KT-38961 Fixed
2020-05-20 12:46:23 +03:00
Ilya Chernikov
994897cee9 Fix textdata after reverting a commit about CompilerMessageLocation 2020-05-20 10:37:56 +02:00
Ilya Kirillov
d825428718 New J2K : move resolve resolve out of EDT in shorten references processing
relates to #KT-31812
2020-05-20 11:11:46 +03:00
Dmitriy Novozhilov
dc57d307f3 [FIR] Clean data flow context before body resolve of file 2020-05-20 10:41:03 +03:00
Dmitriy Novozhilov
8df635a4e0 [FIR] Add cleanup of tower data for imports 2020-05-20 10:41:02 +03:00
Dmitriy Novozhilov
b05546dd64 [FIR] Add check for session consistency in body resolve transformer 2020-05-20 10:41:02 +03:00
Dmitriy Novozhilov
371757309e [FIR] Don't recreate transformer in FirBodyResolveTransformerAdapter 2020-05-20 10:41:01 +03:00
Dmitriy Novozhilov
4e07f8180b [FIR] Don't recreate transformer in FirImplicitTypeBodyResolveTransformerAdapter 2020-05-20 10:41:01 +03:00
Dmitriy Novozhilov
c4407d6d63 [FIR] Don't recreate transformer in FirContractResolveTransformerAdapter 2020-05-20 10:41:00 +03:00
Dmitriy Novozhilov
c1080989b6 [FIR] Suppress pointless unchecked casts in FirStatusResolveTransformer 2020-05-20 10:41:00 +03:00
Dmitriy Novozhilov
329af65996 [FIR] Get rid of FirStatusResolveTransformerAdapter 2020-05-20 10:40:59 +03:00
Dmitriy Novozhilov
93992d1d75 [FIR] Get rid of FirTypeResolveTransformerAdapter 2020-05-20 10:40:58 +03:00
Dmitriy Novozhilov
ca4deec10e [FIR] Don't recreate transformers in FirSupertypeResolverTransformer 2020-05-20 10:40:58 +03:00
Dmitriy Novozhilov
dc30bf5d09 [FIR] Don't recreate transformers in FirPluginAnnotationsResolveTransformer 2020-05-20 10:40:57 +03:00
Dmitriy Novozhilov
0544369503 [FIR] Add transformImports to FirFile 2020-05-20 10:40:57 +03:00
Dmitriy Novozhilov
f60c8eac71 [FIR] Don't rewrite session in FirImportResolveTransformer 2020-05-20 10:40:56 +03:00
Dmitriy Novozhilov
67a259a903 [FIR] Get rid of FirSymbolProvider.getInstance(session)`
Replace with `session.firSymbolProvider`
2020-05-20 10:40:56 +03:00
Dmitriy Novozhilov
24c8a659ee [FIR] Add FirSession as parameter for FirTotalResolveTransformer 2020-05-20 10:40:55 +03:00
Dmitry Petrov
c165b8d55c JVM: Update IR bytecode text and signature tests 2020-05-20 07:19:30 +03:00
Dmitry Petrov
16e7a42aea JVM: Fix line numbers in test 2020-05-20 07:19:30 +03:00
Dmitry Petrov
e625bb375f Temporarily mute unsigned tests in JVM_IR and FIR 2020-05-20 07:19:30 +03:00
Dmitry Petrov
de4ebe4395 Prohibit @JvnName on functions mangled because of return type 2020-05-20 07:19:29 +03:00
Dmitry Petrov
fcf8a91a38 Update kotlin-stdlib-runtime-merged.txt 2020-05-20 07:19:29 +03:00
Dmitry Petrov
cf70c83ab7 JVM: Update tests 2020-05-20 07:19:29 +03:00
Dmitry Petrov
2f82c5b6af JVM: Fix default parameter values handling
When we generate call for 'foo', we make decision about invoking
a 'foo$default' too late, after the call arguments are generated.
If 'foo' was an override, and base class (interface) was generic,
'foo' in base class could have a different Kotlin and JVM
signature, so the arguments we generated could be generated wrong
(primitive or inline class values instead of boxes, see KT-38680).
Also, we always selected first base class in supertypes list,
which caused KT-15971.

Look into resolved call and see if we should actually call
'foo$default' instead of 'foo' when determining actual callable.

Overrides can't introduce default parameter values, and
override-equivalent inherited methods with default parameters
is an error in a child class. Thus, if we are calling a class
member function with a default parameters, there should be one
and only one overridden function that has default parameter values
and overrides nothing.
2020-05-20 07:19:29 +03:00
Dmitry Petrov
dc9f64fc9d JVM: Fix reflection tests for new IC ABI 2020-05-20 07:19:28 +03:00
Dmitry Petrov
b5bd3604b1 JVM: Mangle functions returning inline class values
Mangling suffix is base64-encoded MD5 of ":<returnTypeFQN>"
2020-05-20 07:19:28 +03:00
Dmitry Gridin
9beb36ca2b Code style: add option for blank lines before declarations
#KT-39024 Fixed
#KT-37420 Fixed
#KT-37891 Fixed
2020-05-20 02:22:53 +00:00
Dmitry Gridin
499a02ebe3 AddThrowsAnnotationIntention: improve for mpp
#KT-38391 Fixed
2020-05-20 02:19:10 +00:00
Dmitry Gridin
8b4660031f multiPlatformSetup: cleanup code 2020-05-20 02:19:09 +00:00
Dmitry Gridin
7b079a5f1c Deprecated symbol usages: fix test 2020-05-20 09:04:46 +07:00
Vyacheslav Karpukhin
2c5e42a765 Merge branch 'rr/slava/rename-foreign-usages' 2020-05-19 18:45:59 +02:00
Mikhail Bogdanov
16b4342d92 Add minor test for SMAP
Relates to PR 3248
2020-05-19 18:34:56 +02:00
pyos
73e91af792 IDEA: test the plugin's ability to parse correct JSR-045 data 2020-05-19 18:33:27 +02:00
pyos
c51c537504 JVM: use precise line bounds when regenerating objects with no SMAPs 2020-05-19 18:33:27 +02:00
pyos
7222a732c1 JVM: treat empty SMAP instances as "skip all line numbers" 2020-05-19 18:33:27 +02:00
pyos
86b28b95ca JVM: keep call site markers when inlining lambdas into objects
A follow-up for KT-35006:

    fun f() = foo {
        bar()
    }
    inline fun foo(crossinline x: () -> Unit) = { x() }()
    inline fun bar() = TODO()

does not provide the option to navigate to bar's call site at all.
2020-05-19 18:33:27 +02:00
pyos
5feadd56ef JVM: parse KotlinDebug when regenerating anonymous objects 2020-05-19 18:33:27 +02:00
pyos
1fe7ef6521 JVM: separate the two kinds of source mappers
* a writing source mapper has `mapLineNumber(line, file, class)` that
   inserts a new SMAP entry and returns a fake line number from it;
 * a copying source mapper has `mapLineNumber(line)` that uses an
   existing SMAP to resolve the line number and call the former method
   on a different source mapper;
 * those two types are disjoint.
2020-05-19 18:33:27 +02:00
Ilya Gorbunov
143d8d1520 Minor: fix issue reference 2020-05-19 19:24:00 +03:00
Ilya Gorbunov
d37c412f76 Suppress a couple more warnings 2020-05-19 19:24:00 +03:00
Ilya Gorbunov
bf21e1282a Suppress most of unused parameter warnings 2020-05-19 19:24:00 +03:00
Dmitry Borodin
dd46d5ca5a Add sample for Map.flatMap 2020-05-19 19:24:00 +03:00
Dmitry Borodin
1a0b59da49 KT-20357 Add sortedBy() sample (#3283) 2020-05-19 19:21:21 +03:00
Vyacheslav Gerasimov
0d71758112 Build: Add miscCompilerTest task
for everything except jvmCompilerTest & jsCompilerTest
2020-05-19 18:34:38 +03:00
Victor Petukhov
eff5f3a242 NI: do type checking for anonymous functions not inside a call
^KT-38890 Fixed
^KT-38439 Fixed
2020-05-19 16:29:14 +03:00
Mark Punzalan
425ce8c3ab [FIR] Use flexible type lower bound when approximating type for
IntegerLiteral.
2020-05-19 15:42:49 +03:00
Mark Punzalan
d5141674a3 [FIR] Update GenerateRangesCodegenTestData for newly-enabled FIR tests. 2020-05-19 15:41:29 +03:00
Mark Punzalan
89d706972c [FIR] Use vararg element type when generating argument mapping. 2020-05-19 15:41:29 +03:00
Natalia Selezneva
98d3855fd8 KotlinDslModels: project can be null in ExternalSystemTaskNotificationListener.onStart
For example when project is created from sources
2020-05-19 15:04:15 +03:00
Natalia Selezneva
879fe9b493 Fix order of ExternalSystemListeners
in 201 the order of ExternalSystemListener.EP isn't guaranteed.
But we need to update script definitions and only then we can store script models,
because they need to know script definitions additional classpath
2020-05-19 15:04:14 +03:00
Natalia Selezneva
1a1bcefb2a Add debug logger to ScriptTemplatesFromDependenciesProvider
This will help with investigation of problems with script definition discovery
2020-05-19 15:04:14 +03:00
Natalia Selezneva
16b7232b4f Minor: do not associate with the same extensions multiple times in ScriptDefinitionsManager 2020-05-19 15:04:14 +03:00
Natalia Selezneva
8d22429abc Do not show notification before all definitions are loaded 2020-05-19 15:04:14 +03:00
Natalia Selezneva
1513429613 Load script definitions in IDE on project opening
This will speed up first script opening,
will avoid unexpected indexing because of new definitions
Script definitions are also needed for Kotlin scripting settings
2020-05-19 15:04:14 +03:00
Natalia Selezneva
942c8aaafc Introduce index for folders with script definitions templates
Replace it with nonBlockingReadAction meaning that if update was canceled then loading will be restarted after all write events happen
Also scanning is now started after indexing

^KT-36378 Fixed
^KT-34138 Fixed
^KT-37863 Fixed
2020-05-19 15:04:14 +03:00
Ilya Matveev
839e4ecff2 Allow passing a MessageRenderer to CLITool.mainNoExit
Earlier a system property was used to configure a message renderer
for the K/N compiler. The fix for KT-37550 requires getting rid of
using properties when the compiler is started in a Gradle process.
This patch allows us to specify a correct message renderer at
the K/N side depending on entry point used to run the compiler.

 Issue #KT-37550
2020-05-19 18:57:41 +07:00
Ilya Matveev
5287ffb4a5 [Native] Don't use konan.home to determine a path to the K/N dist
A fix for KT-37550 requires us to stop using system properties when
the compiler is started from Gradle. This patch stops reading the
konan.home property to determine a path to the compiler and requires
this path to be explicitly specified in a constructor of the
Distribution class.

Issue #KT-37550
2020-05-19 18:57:39 +07:00
Ilya Matveev
8e3a62e5fd [Gradle] Get rid of java.library.path when running the K/N compiler
Issue #KT-37550
2020-05-19 18:57:37 +07:00
Dmitry Gridin
0df5d5158d Add resources-en for idea
#KT-38297 Fixed
2020-05-19 16:22:06 +07:00
Dmitry Gridin
12217ef2ab Add regression test for ReplaceWith
#KT-35015 Fixed
2020-05-19 16:15:13 +07:00
Toshiaki Kameyama
02c17378b1 Replace deprecated symbol usage: replace imported object function correctly
#KT-33951 Fixed
2020-05-19 15:40:59 +07:00
Dmitry Gridin
b2be1a53cf SpecifyTypeExplicitlyIntention: remove annotations from result type
#KT-36930 Fixed
2020-05-19 01:17:39 +00:00
Segun Famisa
d6a8003743 Add samples for String/CharSequence filter & filterNot (#3390)
* Add samples for String/CharSequence filter & filterNot
* Link samples to stdlib generator
2020-05-18 23:15:41 +03:00
Ilya Gorbunov
25f83e941c Fix sample reference for unsigned array range sort 2020-05-18 20:37:11 +03:00
Ilya Gorbunov
c40c9a3d14 stdlib-gen: make 'sample' overwrite samples list instead of adding
It's more common for a function to have the single sample, and it's
more convenient to override it in `specialFor` blocks, rather than
to append another one.
2020-05-18 20:37:11 +03:00
Mark Punzalan
371c4561a0 [IR/FIR] Use isExpect from IR element instead of descriptor in
ExpectDeclarationRemover.
2020-05-18 17:20:43 +02:00
Toshiaki Kameyama
23c4eac45b Introduce "Logger initialized with foreign class" inspection
^KT-38982 Fixed
2020-05-18 18:16:52 +03:00
Ilya Goncharov
c6e23ffa3b [Gradle, JS] Move npm declarations to KotlinDependencyHandler
KT-38331
2020-05-18 17:41:49 +03:00
Ilya Goncharov
85fa1859b3 [Gradle, JS] Fix generateKotlinExternals for scoped without generating
KT-38331
2020-05-18 17:41:49 +03:00
Ilya Goncharov
8ac5ebac84 [Gradle, JS] Separate interface for directory dependency with externals
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
8565b77293 [Gradle, JS] Delegate instead inheritance
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
4a574b8e00 [Gradle, JS] Not input transitive dependencies to dukat
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
309d928ed6 [Gradle, JS] Quoted args
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
0e24b5aaa2 [Gradle, JS] Possible variants consider scope
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
0d9265388b [Gradle, JS] Add possible variants for generate kotlin variants
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
5d74db51d7 [Gradle, JS] Fix message
KT-38331
2020-05-18 17:41:48 +03:00
Ilya Goncharov
f4521ee4e4 [Gradle, JS] In case when default generate kotlin externals will be changed, nothing will be broken
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
86c8986bd3 [Gradle, JS] throw exception if dependency forbid generate external
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
df38a669b8 [Gradle, JS] Fix vararg call
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
dcb961af19 [Gradle, JS] Support generateKotlinExternals option for Groovy
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
e8d10d45a9 [Gradle, JS] Add generateKotlinExternals option for root dependencies
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
50e0e6ac06 [Gradle, JS] Add defaultGeneratedKotlinExternals to dependencies extensions
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
830555aa8b [Gradle, JS] generateKotlinExternals option in dsl functions
KT-38331
2020-05-18 17:41:47 +03:00
Ilya Goncharov
c20184ae08 [Gradle, JS] Add option for generate kotlin externals
KT-38331
2020-05-18 17:41:46 +03:00
Ilya Goncharov
53a5980d4c [Gradle, JS] Forbid create peer dependency with directory
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
4d32140f6f [Gradle, JS] Extract interface with directory dependency
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
52214e9093 [Gradle, JS] Add deprecation on npm with name only
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
3c0965802a [Gradle, JS] Extract name only npm dependency to separate interface
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
228e22b4cb [Gradle, JS] Update NPM dependency fail message for Groovy
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
5a348a4831 [Gradle, JS] Add dev dependency to test
#KT-38683 fixed
2020-05-18 17:41:46 +03:00
Ilya Goncharov
efe70da594 [Gradle, JS] KotlinDependencyHandler extends from KotlinNpmDependencyHandler to provide these functions in interface
#KT-38683 fixed
2020-05-18 17:41:45 +03:00
Ilya Goncharov
4fb1e4614d [Gradle, JS] Remove deprecated npm dependency with org
#KT-38683 fixed
#KT-38994 fixed
2020-05-18 17:41:45 +03:00
Ilya Goncharov
b4b2efdc08 [Gradle, JS] Remove copypaste on name only npm dependency
#KT-38683 fixed
2020-05-18 17:41:45 +03:00
Ilya Goncharov
2378d9ba0a [Gradle, JS] Remove copypaste on directoryNpmDependency
#KT-38683 fixed
2020-05-18 17:41:45 +03:00
Ilya Goncharov
28b0bfd40c [Gradle, JS] Remove possibility to declare npm dependency w/o version
#KT-38683 fixed
2020-05-18 17:41:45 +03:00
Ilya Goncharov
3a9e3f29e4 [Gradle, JS] Make addNpmDependencyExtension as internal
#KT-38683 fixed
2020-05-18 17:41:45 +03:00
Dmitry Gridin
19f878f5cd update searchableOptions.xml 2020-05-18 21:20:46 +07:00
Ilya Goncharov
6bde5b620e [Gradle, JS] Add test on NPM range versions
#KT-38990 fixed
2020-05-18 12:48:03 +03:00
Ilya Goncharov
fd7cd7167c [Gradle, JS] Extract methods about parse line
#KT-38990 fixed
2020-05-18 12:47:56 +03:00
Ilya Goncharov
0492d81a8c [Gradle, JS] Process quoted value in yarn.lock
#KT-38990 fixed
2020-05-18 12:47:40 +03:00
Mikhail Glukhikh
db7a7f6cd3 [FIR2IR] Move facade classes generation to the main converter 2020-05-18 11:48:33 +03:00
Mikhail Glukhikh
c4f4883b96 [FIR] Remove redundant dependency generation in JvmIrCodegenFactory
Dependency generation isn't necessary at this point because
it's already performed by Fir2IrConverter
2020-05-18 11:48:33 +03:00
Ilya Gorbunov
a3e8f02330 Update proguard version in test
The latest version at this moment (6.2.2) that ignores mutlirelease jar
content automatically, e.g. META-INF/versions/9 directory content.

Previous versions fail with the error
"class [META-INF/versions/9/module-info.class] unexpectedly contains class [module-info]"
2020-05-18 11:21:13 +03:00
Ilya Gorbunov
843829116d Add module-info to kotlin-test-* framework adapter artifacts
#KT-21266
2020-05-18 11:21:13 +03:00
Ilya Gorbunov
92c4ccc65f Allow customizing compilation classpath for JPMS module-info build 2020-05-18 11:21:13 +03:00
Ilya Gorbunov
e3d20a2f5c Update module-info exports for stdlib and suppress warnings
- include kotlin.time package

Suppress module-info warnings:

- terminal digits in module name
- open/export for another not yet built dependee module

#KT-21266
2020-05-18 11:21:12 +03:00
Ilya Gorbunov
01fb200791 Build default jvm core libraries artifacts as modular
#KT-21266
2020-05-18 11:21:12 +03:00
Denis Zharkov
e1e149a062 FIR: Support coercion-to-unit semantics for callable references 2020-05-18 11:17:45 +03:00
Jinseong Jeon
61def4cdc5 FIR: set function factory (before it's used in SAM lowering). 2020-05-18 09:36:22 +03:00
Ilya Kirillov
9ca6091b1d Wizard: use correct version of react libraries
#KT-38929 fixed
2020-05-18 08:59:41 +03:00
Ilya Kirillov
321272abed Wizard: make new wizard non-experimental
relates to #KT-38952
2020-05-18 08:59:40 +03:00
Vladimir Dolzhenko
01992b581e Dropped KotlinNativeFileTypeFactory from native-common.xml
Relates to #KT-38571
2020-05-17 16:02:25 +00:00
Vyacheslav Gerasimov
005e62526b Build: Add distributionSha256Sum to gradle-wrapper.properties
To enable downloaded gradle checksum validation
https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:verification
2020-05-17 10:40:13 +03:00
Vladimir Dolzhenko
7afadb9b5e Init default profile for perf tests 2020-05-16 14:10:29 +02:00
Ilya Chernikov
fb6ef38370 Revert "Add info about the end of range in scripting REPL compiler messages"
This reverts commit af251caf, because it breaks daemon/client
compatibility, which we'd like to keep as much as possible
2020-05-15 21:15:48 +02:00
Vyacheslav Karpukhin
1ba4d7d99b Update foreign references when renaming a Kotlin file
(cherry picked from commit 1571a87d8f)
2020-05-15 19:45:14 +02:00
Dmitry Savvinov
3793e485b6 Check for common klibs builtins_platform properly
Actually, common klibs don't have a corresponding record (and abscence
of that record should be treated as platform COMMON).

^KT-38769 Fixed
2020-05-15 20:25:48 +03:00
Anton Bannykh
c6f38ebfbf JS IR: enable scope expansion strategy for JS IR KLIB incremental generation 2020-05-15 19:23:52 +03:00
Anton Yalyshev
59ca626487 Make JPS-based wizards available only for new_module use case 2020-05-15 19:11:47 +03:00
Anton Yalyshev
f0ff4b066e Remove old Gradle-based new_project_wizards from the Kotlin group 2020-05-15 19:11:47 +03:00
Toshiaki Kameyama
82d81d5223 Change Signature: move lambda outside of parentheses if the arguments are reordered so that the lambda goes last
#KT-30128 Fixed
2020-05-15 17:58:33 +02:00
Konstantin Tskhovrebov
912fd556e5 Fix commonizer: merge klib manifest dependencies during commonization. 2020-05-15 18:27:13 +03:00
Konstantin Tskhovrebov
32e0ce8779 Disable default platform libs for konanc metadata compilation. 2020-05-15 18:27:13 +03:00
Konstantin Tskhovrebov
17ad0a97d8 Add commonized dependencies to metadata compilation. 2020-05-15 18:27:13 +03:00
Konstantin Tskhovrebov
beb59b3075 Refactor: add Project.getMetadataCompilationForSourceSet extension. 2020-05-15 18:27:13 +03:00
Denis Zharkov
5bbb459993 FIR: Refactor FirTowerResolverSession.enumerateTowerLevels
- Leave only onScope callback as onLocalScope/onNonLocalScope are the same in most cases
- Pass towerGroup to callbacks as they are the same all the time
2020-05-15 16:04:44 +03:00
Denis Zharkov
475671563b FIR: Get rid of obsolete local scopes optimizations
They are already filtered out (see FirTowerResolverSession#localScopes initializer)
2020-05-15 16:04:44 +03:00
Denis Zharkov
e7a67c7a16 FIR: Extract StandardClassIds.KClass 2020-05-15 16:04:44 +03:00
Denis Zharkov
b691b13d8e FIR: Add separate local scopes for blocks 2020-05-15 16:04:44 +03:00
Denis Zharkov
b084399b58 FIR: Cleanup local scope tracking 2020-05-15 16:04:44 +03:00
Denis Zharkov
e7e84b18cd FIR: Do not retrieve symbol for type construction 2020-05-15 16:04:44 +03:00
Denis Zharkov
25bee057e0 FIR: Do not retrieve file for callable until it's needed 2020-05-15 16:04:44 +03:00
Denis Zharkov
295f7d7500 FIR: Do not add trivial constraints 2020-05-15 16:04:44 +03:00
Denis Zharkov
27aa0040be FIR: Cache supetypes scopes when building callable scopes for qualifier 2020-05-15 16:04:44 +03:00
Denis Zharkov
774c5b55c3 FIR: Avoid creating empty nested classes scopes 2020-05-15 16:04:44 +03:00
Denis Zharkov
cd149957ee FIR: Filter out irrelevant local scopes during resolution 2020-05-15 16:04:44 +03:00
Denis Zharkov
beb9a72e9d FIR: Optimize constructor of FirTowerResolverSession 2020-05-15 16:04:44 +03:00
Denis Zharkov
2e91bf7e50 FIR: Minor. Clarify name for addNonLocalTowerDataElements 2020-05-15 16:04:44 +03:00
Denis Zharkov
288db4fb1c Revert "FIR: make both ImplicitReceiverStack.get implementations consistent"
This reverts commit b058ca635c.

Change is not necessary anymore since there are no kinds for implicit
receivers
2020-05-15 16:04:44 +03:00
Denis Zharkov
808355d817 FIR: Fix test data for secondary constructor delegation calls
They appeared, after the changes in previous commits at
org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirExpressionsResolveTransformer#transformDelegatedConstructorCall

The idea is that dispatch receiver is available there in old FE, but additional
diagnostic should be reported on it (see KT-38813)

This change was not made intentionaly but it was the easiest way to
support new tower data elements structure and on the other side it's the
correct behavior as for old FE.

Also, if we once would prefer the previous behavior it's still not very
hard to support it
2020-05-15 16:04:44 +03:00
Denis Zharkov
f71a56e742 FIR: Fix test data after rewritten scope structure
Mostly, the semantics for statics/companions has been changed there
Fixed test data now is much closer to semantics of old FE
2020-05-15 16:04:44 +03:00
Denis Zharkov
f64c12efac FIR: Drop MutableImplicitReceiverStack and its implementation 2020-05-15 16:04:44 +03:00
Denis Zharkov
35e3942afb FIR: Drop unused ImplicitDispatchReceiverKind 2020-05-15 16:04:44 +03:00
Denis Zharkov
0ef1628751 FIR: Refactor scope structure on body resolve stage
Before this change:
- Local scopes, implicit receivers and type parameter scopes were separated.
- Static scopes for super classes were not present as a concept.
Instead of them, all-inherited-static for the current class has been used.
- During call resolution we were processing implicit receivers first and then non-local scopes,
while we should process them in the order of their syntax appearance from the closest
to the most distant

All these facts affect semantics (see test data changed here and the following commits)

The architecture changes are the following:
- FirTowerDataElement introduced as tower level that is used in resolution
  (effectively it's a union type between scope and implicit receiver + isLocal flag)
- FirTowerDataContext introduced for sake of encapsulation of tower data elements' list
  (it also has redundant implicitReceiverStack and localScopes)
- For each regular class we collect relevant tower data elements and add them to the current context
- Also, we preserve a special tower data context for static entities of the class
  (it doesn't have class' dispatch receiver and generic parameters)
2020-05-15 16:04:44 +03:00
Denis Zharkov
cee38e0800 FIR: Implement FirScopeProvider.getStaticScope
It will be used in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov
5268802d5d FIR: Minor. Move "storeFunction" call to transformSimpleFunction
It's only neede there and also scope structure will be cleaned up after transformFunctionWithGivenSignature
in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov
3d6eedc962 FIR: Do not store nested local classes to local scopes 2020-05-15 16:04:44 +03:00
Denis Zharkov
07be2ae5c7 FIR: Use containers structure in FirContractResolveTransformer
transformDeclarationContent call remembers the container
2020-05-15 16:04:44 +03:00
Denis Zharkov
a67e9966b8 FIR: Adapt DataFlowAnalyzer to PersistentReceiverStackImpl
It will be used as main implementation in further commits
2020-05-15 16:04:44 +03:00
Denis Zharkov
687a58843f FIR: Rewrite visibility checking
Unbound it from implicit receiver stack as it only needs scope structure/declaration nestedness
Semantics for protected has been changed in a way it works in old FE

NB: We should report additional diagnostic in case of CallCompanionProtectedNonStatic.fir.kt
(see KT-38814)
2020-05-15 16:04:44 +03:00
Denis Zharkov
825cdd3841 FIR: Move PersistentImplicitReceiverStack to resolve module 2020-05-15 16:04:44 +03:00
Denis Zharkov
e8232fe471 FIR: Remove unused TowerGroupKind.Static 2020-05-15 16:04:44 +03:00
Denis Zharkov
56c793ffc6 FIR: Minor. Extract FirDeclarationsResolveTransformer::doTransformRegularClass
It's will be useful in the following commits
2020-05-15 16:04:44 +03:00
Denis Zharkov
7489b9f636 FIR: Minor. Inline processMembersForExplicitReceiver 2020-05-15 16:04:44 +03:00
Denis Zharkov
fee639258c FIR: Simplify file imports scope tracking 2020-05-15 16:04:44 +03:00
Denis Zharkov
8a51bb7810 FIR: Minor. Unbound FirTowerResolverSession from FirLocalScope 2020-05-15 16:04:44 +03:00
Denis Zharkov
8363671cab FIR: Inline constructor parameter at FirTowerResolverSession 2020-05-15 16:04:44 +03:00
Denis Zharkov
75c4239504 Add "*.png binary" to .gitattributes 2020-05-15 16:04:44 +03:00
Toshiaki Kameyama
1d39ac1d3e Move statement: do not move when function last parameter is on same line as right parenthesis
#KT-14757 Fixed
2020-05-15 15:02:58 +02:00
Jinseong Jeon
615636ed55 FIR2IR: apply SAM conversion to arguments of functional type. 2020-05-15 15:08:43 +03:00
Vladimir Dolzhenko
599c5dd474 Collect unique subtypes from incremental compilation cache 2020-05-15 10:48:55 +00:00
Vladimir Dolzhenko
2f3ff10204 formatting clean up 2020-05-15 10:48:54 +00:00
simon.ogorodnik
e101f88b50 [FIR] Add lines per second metric 2020-05-14 20:58:27 +03:00
Toshiaki Kameyama
8a595ad165 Move statement: Add or remove empty lines correctly
#KT-14946 Fixed
2020-05-14 18:57:56 +02:00
Victor Petukhov
73dec25eb1 NI: intersect DFI types before capturing
^KT-37887 Fixed
2020-05-14 19:54:59 +03:00
Toshiaki Kameyama
5a7ceec985 Color settings: use "Static field" instead of "Instance field" for "Enum entry" language defaults
#KT-15143 Fixed
2020-05-14 18:40:00 +02:00
Ilya Gorbunov
0e67e8e747 Advance bootstrap to 1.4.0-dev-8447 2020-05-14 19:35:00 +03:00
Roman Artemev
34bdd95e50 [JS SCRIPT] Enable js script test along with other script tests 2020-05-14 17:58:33 +03:00
Roman Artemev
9d9930f748 [JS SCRIPT] Fix test dependencies
- make sure kotlin stdlib is compiled and accessible
2020-05-14 17:58:33 +03:00
Roman Artemev
0e21dd15ba [JS SCRIPT] Fix script test data 2020-05-14 17:58:33 +03:00
Roman Artemev
31af1e6ca7 [JS SCRIPT] Fix ScriptDependencyCompiler
- Invoke KotlinIrLinker properly
2020-05-14 17:58:33 +03:00
Roman Artemev
52a93f189e [JS SCRIPT] Fix IrBuiltIns to make it stable if symbols already defined 2020-05-14 17:58:32 +03:00
Roman Artemev
8f71bdbf01 [JS SCRIPT] Fix IrScript visit order 2020-05-14 17:58:32 +03:00
Roman Artemev
f792c5c936 [JS SCRIPT] Fix default arguments in script 2020-05-14 17:58:32 +03:00
Roman Artemev
996137576e [JS SCRIPT] Fix script lowering 2020-05-14 17:58:32 +03:00
Roman Artemev
e573efb3a5 [JS SCRIPT] Handle IrScript in mangler correctly 2020-05-14 17:58:32 +03:00
Yaroslav Chernyshev
785fa7dd1c [Gradle, Import] Ignore incompatible test runs for Native targets.
#Fixed KT-34516
2020-05-14 17:43:00 +03:00
Nikolay Krasko
e2857a910b Minor: show existing modules in absent error in gradle tests 2020-05-14 16:13:38 +03:00
Nikolay Krasko
189a9dbc02 201: Mute tests with changed module names after idea update (KT-37125)
Problems started with commit:
67fdc5db3b
2020-05-14 16:13:37 +03:00
Alexander Udalov
82551e91a4 Add KClass.isFun modifier to reflection
#KT-38881 Fixed
2020-05-14 14:05:51 +02:00
Anton Bannykh
86b5c63891 JS IR: fix origin for callable references with bound reciever
In case of IrFunctionReference with type SuspendFunction (no K!) there
was a misalignment between the base class (Any) and the
origin (LAMBDA..). As a result the SuspendFunctionLowering was
getting confused and produced hanging code.
2020-05-14 14:33:12 +03:00
Anton Bannykh
bdca4b45bd JS: inliner supports extra argument caused by suspend conversions 2020-05-14 14:33:12 +03:00
Alexander Udalov
ed8efafa9b Generate InnerClasses attribute for nested classes in annotation arguments
Otherwise we incorrectly try to load a nested class "A.B" as if it is a
top level class named "A$B" and fail.

 #KT-38853 Fixed
2020-05-14 13:20:13 +02:00
Mikhail Glukhikh
cdac6157a9 [FIR2IR] Force loading Java SAM from external classes 2020-05-14 14:07:40 +03:00
Jinseong Jeon
89a6ecd77d [FIR] Update argument mapping while transforming integer operator. 2020-05-14 13:42:07 +03:00
Juan Chen
858731cac8 [FIR] add support for varargs in delegated constructor calls
Also add support for spread operators as named arguments.
2020-05-14 13:42:07 +03:00
Mikhail Glukhikh
3652ac9354 [FIR2IR] Mute 2 failing BB tests
Looks like both tests are failing because now only classes from
'kotlin.*' are considered "external" and generated with declarations.
2020-05-14 13:40:37 +03:00
Mikhail Glukhikh
d8398bb0ab [FIR2IR] Handle external declaration parents more accurately
This allows us to set declaration parent immediately,
not at some moment after its creation
2020-05-14 13:40:37 +03:00
Mikhail Glukhikh
6beee004a3 [FIR2IR] Take callables from scope in external declaration generator
This commit fixes 2 more unmuted BB tests
2020-05-14 13:40:37 +03:00
Mikhail Glukhikh
12c0cbee94 [FIR2IR] Don't enter same class twice while override searching
This commit fixes 21 unmuted BB tests after previous one
2020-05-14 13:40:37 +03:00
Mikhail Glukhikh
00fcb6cb02 [FIR2IR] Minor refactoring of populateOverriddenSymbols 2020-05-14 13:40:36 +03:00
Mikhail Glukhikh
e7e80be34a [FIR2IR] Populate overridden symbols even for !isOverride
Before this commit we considered !isOverride as a sign that
function / field / accessor has no overridden symbols.
However, it's false for deserialized, because isOverride
is always false there.

This commit fixes 68 BB tests but breaks 25 BB tests (not yet muted)
2020-05-14 13:40:36 +03:00
Dmitriy Dolovov
ac1e96500a [Commonizer] Added README.md 2020-05-14 17:35:16 +07:00
Toshiaki Kameyama
08588001be Redundant suspend modifier: do not report when the function has 'actual' modifier
#KT-37746 Fixed
2020-05-14 12:08:52 +02:00
Ilya Gorbunov
188bcf0e7b stdlib-js-ir: do not copy source directories from the same project 2020-05-14 10:40:34 +03:00
Ilya Gorbunov
46b0784508 Disable kotlinMetadata compilation for js-ir-minimal-for-test
Use more convenient way to specify dependency on source syncing tasks.
2020-05-14 10:40:18 +03:00
Jinseong Jeon
bcf277d885 Add comments for generators about data/inline class (in psi2ir and fir2ir) and annotations (fir2ir). 2020-05-14 09:41:11 +03:00
Jinseong Jeon
e844c59e7e FIR2IR: filter correct use-site target for value parameter annotations. 2020-05-14 09:41:11 +03:00
Jinseong Jeon
76e679a6ca FIR2IR: refactor annotation generations. 2020-05-14 09:41:11 +03:00
Jinseong Jeon
931ba4892a FIR2IR: split property annotations according to use-site targets. 2020-05-14 09:41:11 +03:00
Steven Schäfer
9bc8fdcb3c JVM IR: Validate corresponding properties 2020-05-13 20:57:52 +02:00
Steven Schäfer
13f15a702b JVM IR: Remove corresponding property hacks from MethodSignatureMapper 2020-05-13 20:57:52 +02:00
Steven Schäfer
497df0922a JVM IR: Fix corresponding properties in inline classes 2020-05-13 20:57:52 +02:00
Steven Schäfer
c41e71b1c5 JVM IR: Merge PropertiesToFieldsLowering and JvmPropertiesLowering
This is necessary in order to fix the corresponding property symbols,
since PropertiesToFieldsLowering broke them intentionally.
2020-05-13 20:57:52 +02:00
Steven Schäfer
d5c2707c2c JVM IR: Fix corresponding properties in JvmStaticAnnotationLowering 2020-05-13 20:57:52 +02:00
Steven Schäfer
24b28f80cb JVM IR: Fix corresponding properties in BridgeLowering 2020-05-13 20:57:52 +02:00
Steven Schäfer
4a2b5df9fa JVM IR: Fix corresponding properties for default impls redirections 2020-05-13 20:57:52 +02:00
Steven Schäfer
1fafbb8d72 Minor: Remove duplicate IrSetField builder 2020-05-13 20:57:52 +02:00
simon.ogorodnik
86683e94fc [FIR] Fix cfg crash with multiple postponed arguments 2020-05-13 19:20:02 +03:00
Anton Bannykh
5b63dad1c3 JS IR: fix incremental compilation for stdlib 2020-05-13 19:15:18 +03:00
Ilya Gorbunov
a95f205c1a Binary compatibility validator is now an external tool
Use its code from a dependency.
2020-05-13 19:00:35 +03:00
Konstantin Tskhovrebov
ceb03ce739 Disable KotlinNativeRunConfigurationProducer if not found Gradle plugin.
Issue #KT-38186 Fixed
2020-05-13 17:18:35 +03:00
Vladimir Ilmov
af114e3211 (CoroutineDebugger) 192/193 compatibility fix 2020-05-13 15:45:47 +02:00
Anton Bannykh
b5f31a3d76 JS IR: make CodeCleaner more conservative
The CodeCleaner treated all expressions with type `Nothing` as
non-terminating. This is not true for cases when return type is generic,
e.g:

```
fun <T> foo(): T = Any() as T

foo<Nothing>() // type: Nothing
```

This change makes the CodeCleaner more conservative, so that it doesn't
treat to such functions as non-terminating. This eliminates the need
to change call types from Nothing to Unit in
KotlinNothingValueExceptionLowering.
2020-05-13 16:30:47 +03:00
pyos
8809abdbac JVM_IR: do not handle Nothing in suspend tail call bridges
Else they wouldn't be tail call, would they?
2020-05-13 05:54:37 -07:00
Ilmir Usmanov
0acaedef92 Fix attribute clash between STATIC_INLINE_CLASS_REPLACEMENT and original
Attributes are used to name continuation classes and are generated
before inline classes processing. During the processing, for override
functions in inlined classes, the compiler generates
STATIC_INLINE_CLASS_REPLACEMENT function with body of the override.
The override's body is replaced with delegating call to
STATIC_INLINE_CLASS_REPLACEMENT. However, since we need to keep the name
of the continuation class, we copy attributes from the override to
STATIC_INLINE_CLASS_REPLACEMENT. This leads to attribute clash during
AddContinuationLowering.
So, to fix the issue, do not use the attribute of
STATIC_INLINE_CLASS_REPLACEMENT in original->suspend map.
As an optimization, do not generate continuation for the override
function.
2020-05-13 14:53:37 +02:00
Alexander Udalov
d2a691d157 Minor, ignore failing box tests for light analysis 2020-05-13 13:54:51 +02:00
Mark Punzalan
99856afc31 ForLoopsLowering: Use @file:OptIn(ExperimentalUnsignedTypes::class)
instead of annotating declarations.
2020-05-13 13:54:35 +02:00
Mark Punzalan
b5b361bb09 Add tests for nullable loop variable in for-loop over unsigned progression. 2020-05-13 13:54:35 +02:00
Mark Punzalan
b85da8411d ForLoopsLowering: Convert ProgressionType from enum to sealed class and
move more logic into the class.

This refactoring simplifies their usage with fewer `when` switches and
passing around of Symbols.
2020-05-13 13:54:35 +02:00
Mark Punzalan
177967258b ForLoopsLowering: Eliminate construction/boxing/unboxing of UInt/ULong.
This needs further cleanup to encapsulate more logic into ProgressionType.
2020-05-13 13:54:35 +02:00
Mark Punzalan
e1120f49d8 ForLoopsLowering: Reduce unnecessary temporary variables. 2020-05-13 13:54:35 +02:00
Mark Punzalan
eaddd02e9b Mute/unmute failing/passing unsigned progression tests for FIR. 2020-05-13 13:54:35 +02:00
Mark Punzalan
f249e7f5e9 ForLoopsLowering: Add additional bytecode text tests for optimization of
unsigned progressions.
2020-05-13 13:54:35 +02:00
Mark Punzalan
0e6af517d7 Generate tests for unsigned progressions using
GenerateSteppedRangesCodegenTestData.
2020-05-13 13:54:35 +02:00
Mark Punzalan
03ef3724f4 ForLoopsLowering: Add support for unsigned progressions. 2020-05-13 13:54:35 +02:00
Mikhael Bogdanov
9fdb1ff4f8 Call visit method on ClassWriter in IC caching in proper order 2020-05-13 13:45:10 +02:00
Igor Yakovlev
df8031945b Allow UL class for KtEnumEntry declaration 2020-05-13 12:14:12 +03:00
Roman Golyshev
762f38a394 KT-38832 Add additional check to RemoveCurlyBracesFromTemplateInspection
- Expression in curly braces can change between the report of inspection
and quickfix application
- ^KT-38832 Fixed
2020-05-13 09:05:10 +00:00
Roman Golyshev
150708069c KT-38831 Use safe casts in ReplaceWithOperatorAssignmentInspection
- Assigned expression can change between reporting of inspection and
applying it
- ^KT-38831 Fixed
2020-05-13 09:05:10 +00:00
Roman Golyshev
225d354604 KT-38829 Add additional check to RemoveRedundantBackticksQuickFix
- Identifier's name can change between reporting of inspection and
applying a quickfix
- ^KT-38829 Fixed
2020-05-13 09:05:09 +00:00
Jinseong Jeon
6034fcdc46 FIR2IR: apply SAM conversion to arguments if needed 2020-05-13 11:28:48 +03:00
Alexander Udalov
0ce16b9d8c Support non-reified type parameters in typeOf in JVM and JVM_IR
#KT-30279 Fixed
2020-05-13 10:04:28 +02:00
Alexander Udalov
6fb40878c4 Minor, do not report "no reflection" error on KTypeParameter
Since an implementation of KTypeParameter for stdlib is coming, an
instance of which can be obtained through `typeOf`.
2020-05-13 10:04:27 +02:00
Alexander Udalov
37cf7316bc Do not calculate maxStack size manually when generating typeOf 2020-05-13 10:04:27 +02:00
Alexander Udalov
82603f3853 Move some codegen utilities to callableReferenceUtil.kt
Some of them were declared in ClosureCodegen near generation of function
references, and some in PropertyReferenceCodegen, which was confusing.
2020-05-13 10:04:27 +02:00
Alexander Udalov
4fe8754ba1 Minor, extract generation of typeOf out of inlineIntrinsics.kt 2020-05-13 10:04:27 +02:00
Alexander Udalov
ea413cefb4 Remove TypeOfChecker for JVM frontend
This is needed to support typeOf with non-reified type parameters.

 #KT-30279
2020-05-13 10:04:26 +02:00
Mikhail Glukhikh
0c0f4ef3db FIR CFG: handle 'Dead' properly in edge kind merging 2020-05-13 10:37:08 +03:00
Mikhail Glukhikh
41f241f608 FIR CFG: merge DFA + CFA edge in Simple edge 2020-05-13 10:37:08 +03:00
Mikhail Glukhikh
32cfee50e0 FIR CFG: remove duplicating lambda enter -> exit connection 2020-05-13 10:37:08 +03:00
Mikhael Bogdanov
5ef37148ea Add flag for proper array convention with default args calls 2020-05-13 08:51:57 +02:00
Mikhail Bogdanov
adc770b604 Process default arguments in array convention calls
#KT-16520 Fixed
2020-05-13 08:51:57 +02:00
Mikhail Bogdanov
3134832396 Call missed visit method on ClassWriter in IC caching
Otherwise ASM fails with error on invalid frames because bytecode version is 0
2020-05-13 06:29:23 +02:00
Sergey Rostov
4daac14008 Revert due to massive flaky tests 2020-05-12 23:01:01 +03:00
Vladimir Ilmov
5228da2ebc (CoroutineDebugger) 192/as36 compilation fix 2020-05-12 19:50:27 +02:00
Alexander Udalov
4597fff18a Prohibit OptionalExpectation on nested annotation classes
Because the new generation scheme based on module metadata does not
support them, and we don't plan to have them in the standard library
yet.
2020-05-12 19:28:58 +02:00
Alexander Udalov
012ffa2993 Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on
JVM, serialize their metadata to the .kotlin_module file, and load it
when compiling dependent multiplatform modules.

The problem with generating them as package-private was that
kotlin-stdlib for JVM would end up declaring symbols from other
platforms, which would include some annotations from package
kotlin.native. But using that package is discouraged by some tools
because it has a Java keyword in its name. In particular, jlink refused
to work with such artifact altogether (KT-21266).

 #KT-38652 Fixed
2020-05-12 19:28:57 +02:00
Sergey Rostov
63e355d979 Scripting IDE cache: unblocking concurrent update
#KT-38875 Fixed
2020-05-12 19:49:43 +03:00
Jinseong Jeon
30e5748fec FIR: set proper visibility of property accessors. 2020-05-12 19:47:37 +03:00
Ilya Gorbunov
5d724a8cbc Fix samples package import
Dokka can only clean samples.* import when converting samples to
runnable.
2020-05-12 17:35:33 +03:00
Kirill Shmakov
84c6c365db Wizard: Reorder build phases in iOS template (fix KT-38810) 2020-05-12 17:32:37 +03:00
Kirill Shmakov
cc7b8cc558 Wizard: Add KMM-related property in iOS template gradle.properties 2020-05-12 17:32:37 +03:00
Igor Yakovlev
84a582c618 Fix escaping const string literals in UL
Fixed #KT-38247
2020-05-12 17:04:16 +03:00
Igor Yakovlev
9f8044ff1b Fix ultraKtLightClassForFacade compiler backend call
+minor fixes
2020-05-12 17:04:16 +03:00
Igor Yakovlev
62c24c95b5 Add support for UltraLightScripts 2020-05-12 17:04:15 +03:00
Mikhail Glukhikh
6a2461f2c6 [FIR] Refactor boolean flags related to constructors: !no -> include 2020-05-12 16:57:08 +03:00
Mikhail Glukhikh
db694dd7ab [FIR] Extract ConstructorScopeTowerLevel 2020-05-12 16:57:08 +03:00
Mikhail Glukhikh
22e7264460 [FIR] Use all implicit receivers for del. constructors, not just one 2020-05-12 16:57:08 +03:00
Mikhail Glukhikh
535b4434a8 [FIR TEST] Add extra test for inner classes inside hierarchy 2020-05-12 16:57:08 +03:00
Mikhail Glukhikh
f48ff2679e [FIR] Branch delegating constructor call resolve by isInner from start 2020-05-12 16:57:07 +03:00
Mikhail Glukhikh
28c0dac36f [FIR] Set FirJavaClass.isInner properly 2020-05-12 16:57:07 +03:00
Mikhail Glukhikh
3aca40538b [FIR TEST] Fix error in exposedSupertype test 2020-05-12 16:57:07 +03:00
Mikhail Glukhikh
457fb09e3a [FIR] Use tower to resolve delegated constructors, set dispatch receiver 2020-05-12 16:57:07 +03:00
Yaroslav Chernyshev
0b8c497d2e [Import] Downgrade jvmTarget & move Models and ModelBuilderServices
Fixed KT-35921
Fixed KT-36673
2020-05-12 16:52:01 +03:00
Vladimir Ilmov
385ddba2d9 (CoroutineDebugger) Keep coroutine info list reference from collection
#KT-38606 Fixed
2020-05-12 15:39:36 +02:00
Vladimir Ilmov
5a5c1c3420 (CoroutineDebugger) Local variables should have precedence over restored. 2020-05-12 15:39:35 +02:00
Sergey Rostov
f19f49711c Scripting: minor changes 2020-05-12 16:22:48 +03:00
Sergey Rostov
800fcc511a JPS: ignore removed java files
#KT-27458 Fixed
2020-05-12 16:22:48 +03:00
Sergey Rostov
14bd6fe781 scripting ucache: update synchronously in unit test mode 2020-05-12 16:22:48 +03:00
Sergey Rostov
ac70234342 201: proper implementation for AsyncFileChangeListenerHelper.kt
updateFile is called before changes in vfs, so the timestamp is old there.
The proper implementation is to collect changed files in list and get timestamp in apply.
2020-05-12 16:22:48 +03:00
Sergey Rostov
9aa5f0c31a Scripting unified cache: update sdks synchronously on changes 2020-05-12 16:22:48 +03:00
Sergey Rostov
9e96885586 GradleBuildRoot: don't store references to virtual files 2020-05-12 16:22:48 +03:00
Sergey Rostov
35765fe6e6 remove stale GradleScriptInputsWatcher references 2020-05-12 16:22:47 +03:00
Sergey Rostov
ed6e369735 minor: ScriptingSupport.Provider -> ScriptingSupport, KDoc 2020-05-12 16:22:47 +03:00
Sergey Rostov
33d79f9135 GradleScriptOutOfProjectTest: roots are already registered as legacy 2020-05-12 16:20:47 +03:00
Sergey Rostov
fc59e28610 Fix lastIndexOfOrNull 2020-05-12 16:20:47 +03:00
Sergey Rostov
a4c7981424 Scripting, minor: updateScriptDefinitions -> updateScriptDefinitionReferences 2020-05-12 16:20:47 +03:00
Sergey Rostov
0e5b981363 ScriptClassRootsCache, sdk: use toSystemIndependentName 2020-05-12 16:20:47 +03:00
Sergey Rostov
0404f4fd57 gradle.kts, minor: remove unused code 2020-05-12 16:20:47 +03:00
Sergey Rostov
4575a8cade GradleScriptListenerTest: add gradle-wrapper.properties to specify gradle version explicitly 2020-05-12 16:20:47 +03:00
Sergey Rostov
fa679129d1 ScriptClassRootsUpdater, updateSynchronously: cancel before waiting for lock 2020-05-12 16:20:46 +03:00
Sergey Rostov
75e8f15b5e ScriptClassRootsUpdater: fix clearing scheduledUpdate and check cancelled in sync 2020-05-12 16:20:46 +03:00
Sergey Rostov
a498171400 gradle.kts: remove LastModifiedFiles fs data when removing gradle root 2020-05-12 16:20:46 +03:00
Sergey Rostov
06e43027cf gradle.kts, minor: move isInAffectedGradleProjectFiles inside GradleBuildRootsManager 2020-05-12 16:20:46 +03:00
Sergey Rostov
b2729f977a GradleScriptListenerTest: link gradle project 2020-05-12 16:20:46 +03:00
Sergey Rostov
c0e9092f94 GradleBuildRootsManager: fix onProjectsLinked 2020-05-12 16:20:46 +03:00
Sergey Rostov
9302a620c2 GradleLegacyScriptListener: call from GradleScriptListener
GradleScriptListener is called from VFS listener
2020-05-12 16:20:46 +03:00
Sergey Rostov
80991f7c56 gradle.kts: use toSystemIndependentName for paths coming from Gradle 2020-05-12 16:20:46 +03:00
Sergey Rostov
4e07e4c8fe ScriptClassRootsUpdater: run synchronously in unit test mode 2020-05-12 16:20:46 +03:00
Sergey Rostov
c6be0a8213 UnusedSymbolInspection: load script configurations from cache 2020-05-12 16:20:45 +03:00
Sergey Rostov
b199531f0e gradle.kts, scheduleLastModifiedFilesSave: fix race condition 2020-05-12 16:20:45 +03:00
Sergey Rostov
5962bd7955 gradle.kts, minor: areRelatedFilesUpToDate -> areRelatedFilesChangedBefore 2020-05-12 16:20:45 +03:00
Sergey Rostov
cb318a63ad GradleScriptListener: update lastModifiedFiles on document change 2020-05-12 16:20:45 +03:00
Sergey Rostov
9b0a2f63a9 GradleBuildRoot: fix loading lastModifiedFiles 2020-05-12 16:20:45 +03:00
Sergey Rostov
34bc52f3d4 LastModifiedFiles: fix in case of sequential changes in same file 2020-05-12 16:20:45 +03:00
Sergey Rostov
cde53285c6 .gradle.kts, listener: support multiple gradle projects linked to one IntelliJ project
GradleScriptInputsWatcher moved to GradleScriptListener.kt and GradleBuildRootsManager.kt
2020-05-12 16:20:45 +03:00
Sergey Rostov
258064d82d gradle.kts: docs 2020-05-12 16:20:45 +03:00
Sergey Rostov
64682ad550 ScriptConfigurationManager: take OutsidersPsiFileSupport into account 2020-05-12 16:20:44 +03:00
Sergey Rostov
e7c19ab3ef Scripts, minor: get rid of ScriptingSupportHelper 2020-05-12 16:20:44 +03:00
Sergey Rostov
b42d5eda0a gradle.kts: merge data on failed gradle sync, fix updates scheduling in corner cases 2020-05-12 16:20:44 +03:00
Sergey Rostov
e972203a2a gradle.kts: solve the linked gradle builds hell 2020-05-12 16:20:44 +03:00
Sergey Rostov
6fe3365dd3 gradle.kts, imported gradle build root: fix equality 2020-05-12 16:20:44 +03:00
Sergey Rostov
0ff95ee516 ScriptConfigurationManager, outsider files: search in roots cache too 2020-05-12 16:20:44 +03:00
Sergey Rostov
751d167f66 ScriptConfigurationManager: rebuild cache synchronously from default loader 2020-05-12 16:20:44 +03:00
Sergey Rostov
ab51292da8 gradle.kts: cache definitions 2020-05-12 16:20:44 +03:00
Sergey Rostov
fc7be92c42 gradle.kts: remove useless gradle build root kinds 2020-05-12 16:20:44 +03:00
Sergey Rostov
802c03b934 Script configuration: fix getting javaHome 2020-05-12 16:20:43 +03:00
Sergey Rostov
b04fabf1e8 CompositeScriptConfigurationManager: unified caching 2020-05-12 16:20:43 +03:00
Sergey Rostov
8f8902a85f GradleScriptConfigurationLoader: KDocs 2020-05-12 16:20:43 +03:00
Victor Petukhov
11d05c1abd NI: propagate isNullabilityConstraint flag into constraint injector and inherit it
^KT-37510 Fixed
2020-05-12 16:15:07 +03:00
Roman Artemev
19e352a1b5 [ANDROID] Simplify parcelize ir plugin code
- avoid direct usages of CommonBackendContext & Backend Symbols
2020-05-12 14:29:55 +03:00
Roman Artemev
c20aa297f1 [ANDROID] Fix Parcelize reslove extension plugin
- make it provide its synthetic members names
2020-05-12 14:29:55 +03:00
Roman Artemev
6bdd473eff [JVM IR] Fix plugin API for JVM IR
- Unmute ktx.serialization test
2020-05-12 14:29:55 +03:00
Roman Artemev
a794052f86 [IR] Mark Value Parameters which have default argument 2020-05-12 14:29:55 +03:00
Roman Artemev
7737c76540 [PLUGIN API] Do postprocess after symbol resolve 2020-05-12 14:29:55 +03:00
Roman Artemev
92befaac5d [IR] Remove IrExtensionGenerator 2020-05-12 14:29:55 +03:00
Roman Artemev
9f99094780 [IR] Clean up linker interface 2020-05-12 14:29:54 +03:00
Roman Artemev
1e9c9ef7e0 [IR] Clean up linker code 2020-05-12 14:29:54 +03:00
Roman Artemev
1949b11bb2 [KTX.SERIALIZATION] Refactor plugin once again 2020-05-12 14:29:54 +03:00
Roman Artemev
d41bbbae0d [IR] Deprecate some API 2020-05-12 14:29:54 +03:00
Roman Artemev
2f0840388d [IR] Fix context 2020-05-12 14:29:54 +03:00
Roman Artemev
559b654a4f [IR] Provide new plugin API to access declaration via FqName in the safe way 2020-05-12 14:29:53 +03:00
Roman Artemev
8335ce8665 [IR] Fix to make K/N work 2020-05-12 14:29:53 +03:00
Roman Artemev
aac4649845 [JS IR] Remove usage of LazyIr from JS 2020-05-12 14:29:53 +03:00
Roman Artemev
3d24665c0d [IR] Use ReferenceSymbolTable in BuiltinSymbolsBase 2020-05-12 14:29:53 +03:00
Roman Artemev
3c50b47333 [IR] Add new API into IrBuiltIns to access functional interfaces 2020-05-12 14:29:53 +03:00
Roman Artemev
a477aa7289 [KLIB] Pass IrFunctionFactory from outside 2020-05-12 14:29:53 +03:00
Roman Artemev
318568636e [IR] Pass IrBuiltIns to BuiltinSymbolsBase 2020-05-12 14:29:53 +03:00
Roman Artemev
da661e4db7 [IR BE] Remove usage of KotlinType from ir loop optimization 2020-05-12 14:29:53 +03:00
Roman Artemev
c38ba45c1b [JVM IR] Fix jvm linker 2020-05-12 14:29:52 +03:00
Roman Artemev
5ea309d578 [PSi2IR] Generate synthetic declaration during psi2ir
- Make sure any declaration from currently generating module is bound.
 - Implement standalone declaration generator
2020-05-12 14:29:52 +03:00
Roman Artemev
66543131c2 [IR] Add referenceScript to SymbolTable 2020-05-12 14:29:52 +03:00
Pavel Kirpichenkov
003ba1c8f5 [NI] CST: add preemptive recursion detection
For single super type constructor create star projection argument when types for that argument are equal to the original types.
Captured star projections are replaced with their corresponding supertypes during this check.
Skip check for `in` parameters, for which recursive cst calculation does not happen.
Adjust constant in fallback recursion condition.

^KT-38544 Fixed
2020-05-12 11:13:43 +03:00
Ilya Muradyan
7cde9b4355 Add tests for analyze return type in REPL IDE services
also refactor existing tests infrastructure
2020-05-11 10:45:49 +02:00
Ilya Muradyan
8a1b44cc2b Add snippet result type to analysis output of REPL IDE services 2020-05-11 10:45:49 +02:00
Ilya Chernikov
c496b93218 [minor] refactor repl API file layout 2020-05-11 10:45:48 +02:00
Dmitriy Novozhilov
a47bab2466 [FIR] Fix build scripts for plugin prototype 2020-05-10 22:52:00 +03:00
Abduqodiri Qurbonzoda
0c7b04a495 Document fromIndex and toIndex parameters #KT-38388 2020-05-09 23:34:03 +03:00
Toshiaki Kameyama
3c1b41c020 Move statement: move into lambda correctly
#KT-17887 Fixed
2020-05-09 22:08:02 +02:00
Toshiaki Kameyama
19824201e2 Move statement: do not move into lambda beyond 'if/when/try/for/while'
#KT-9065 Fixed
2020-05-09 22:08:02 +02:00
Nikolay Krasko
ee5ecb232a Long test execution on 201: remove repeating calls to startup activities (KTI-185)
Method was refactored in 735c98d153

 #KTI-185 Fixed
2020-05-09 22:12:16 +03:00
Jinseong Jeon
fd584e6f13 FIR2IR: fix offsets for calls. 2020-05-09 21:11:40 +03:00
Victor Petukhov
b49dc46e6c NI: improve reporting errors about mismatch number of anonymous function parameters 2020-05-09 12:34:08 +03:00
Victor Petukhov
585e98a835 NI: support inferring lambda receiver type by explicit receiver of anonymous function (which is another postponed argument) 2020-05-09 12:34:06 +03:00
Kirill Shmakov
a590fe3d65 Wizard: Use simpler debug information settings 2020-05-08 23:23:52 +03:00
Nikolay Krasko
67fdc5db3b Update to 201.7223.91 (KT-38561)
#KT-38561 Fixed
2020-05-08 22:13:34 +03:00
Ilmir Usmanov
d6d331de2a Minor. Fix test 2020-05-08 19:36:02 +02:00
Dmitriy Dolovov
e92adf3d4e [Commonizer] Don't preserve annotations on types
This may lead to leakage of specific annotation classes to common module

^KMM-53
2020-05-08 23:52:24 +07:00
Dmitriy Dolovov
5bb5d7f892 [Commonizer] Limited annotation commonization. Tests
^KMM-238
^KMM-53
2020-05-08 23:52:17 +07:00
Dmitriy Dolovov
600daaa320 [Commonizer] Reformat tests 2020-05-08 23:52:10 +07:00
Dmitriy Dolovov
413e6552ef [Commonizer] Simplify creation of individual commonizers 2020-05-08 23:52:04 +07:00
Dmitriy Dolovov
735387b685 [Commonizer] Limited annotation commonization (@Deprecated for functions)
^KMM-238
^KMM-53
2020-05-08 23:51:58 +07:00
Dmitriy Dolovov
be04fbd5bb [Commonizer] More accurate verification of annotations in tests 2020-05-08 23:51:52 +07:00
Dmitriy Dolovov
ae570e4acf [Commonizer] Don't filter out @Deprecated non-top-level functions
^KMM-238
2020-05-08 23:51:46 +07:00
Svyatoslav Kuzmich
312072d6ce Revert accidental .idea/misc.xml change 2020-05-08 18:49:17 +03:00
Mikhail Glukhikh
1dd50ba1f2 [FIR] Use JvmGeneratorExtensions also from CLI 2020-05-08 17:57:55 +03:00
Jinseong Jeon
eac9af521e [FIR2IR] differentiate external Java stub origin from external stub 2020-05-08 17:45:39 +03:00
Mikhail Glukhikh
b271b6d7a8 [FIR2IR] Add conversion of value parameter annotations 2020-05-08 17:30:28 +03:00
Mikhail Glukhikh
76f6e27e37 [FIR2IR] Add initial support of collection literals 2020-05-08 17:30:24 +03:00
Mikhail Glukhikh
f3e2dbf360 [FIR2IR] Add conversion of function annotations 2020-05-08 17:30:19 +03:00
Dmitry Gridin
ad00d28631 TypingIndentation: add large test 2020-05-08 20:15:49 +07:00
Mikhail Zarechenskiy
36f6ccffde Add test for obsolete issue
#KT-38667 Obsolete
2020-05-08 15:42:43 +03:00
Alexander Udalov
91ef053fbc IR: keep local scope with counter maps across LDL invocations
Since LocalDeclarationsLowering is a BodyLoweringPass, local
functions inside one declaration are handled independently of local
functions in the other declaration. This can lead to name clashes, in
case a local function with the same name and signature is declared in
overloads in the same container, which results in a signature clash
error in JVM IR.

The issue became more common with the introduction of adapted function
references, where psi2ir generates a local adapter-function with a
predefined name, which can easily clash with another reference to the
same target in an overload. This led to a compilation error when
bootstrapping Kotlin with JVM IR, for example in GradleIRBuilder.kt
where there are a lot of references to the same function.
2020-05-08 14:33:34 +02:00
Dmitry Gridin
50506658c0 fix some tests for as36 2020-05-08 19:13:28 +07:00
Dmitriy Novozhilov
ad09eb5416 [FIR] Add ability to rewrite attributes in FirDeclarationAttributes 2020-05-08 15:10:13 +03:00
Dmitriy Novozhilov
239837fd14 [FIR] Introduce FirDeclarationAttributes for FirDeclaration 2020-05-08 15:10:12 +03:00
Dmitriy Novozhilov
b348ae689a [FIR] Introduce different implementations of ArrayMapOwner
- ComponentArrayOwner for services
- AttributeArrayOwner for attributes like userdata or type attributes
2020-05-08 15:10:12 +03:00
Dmitriy Novozhilov
edd7d5b0b0 [FIR-TEST] Add tests of compiler plugin prototype to :firAllTest 2020-05-08 15:10:02 +03:00
Dmitriy Novozhilov
959ecceaf7 [FIR-PLUGIN] Move fir plugin prototype out from :compiler module 2020-05-08 15:10:02 +03:00
Dmitriy Novozhilov
ab7613f6a4 [FIR-PLUGIN] Rename FirExtensionPoint to FirExtension 2020-05-08 15:10:02 +03:00
Dmitriy Novozhilov
4eb9eb0537 [FIR] Rename FirExtensionPoint to FirExtension
Also rename `FirExtensionPointService` to `FirExtensionsService`
2020-05-08 15:10:02 +03:00
Dmitriy Novozhilov
a1e719a127 [FIR] Register extensions in CLI 2020-05-08 15:10:01 +03:00
Dmitriy Novozhilov
6af3b289a3 [FIR-PLUGIN] Add plugin key to allopen extensions 2020-05-08 15:10:01 +03:00
Dmitriy Novozhilov
78b8a7b388 [FIR] Store extensions by plugin key 2020-05-08 15:10:01 +03:00
Dmitriy Novozhilov
e5365cec87 [FIR-PLUGIN] Change allopen plugin according to previous commit 2020-05-08 15:10:01 +03:00
Dmitriy Novozhilov
fac57344a3 [FIR] Split plugin annotations for two groups. Introduce modes for meta annotations 2020-05-08 15:10:01 +03:00
Dmitriy Novozhilov
4022a57a4b [FIR-PLUGIN] Add simple implemetation of class generator extension point 2020-05-08 15:10:00 +03:00
Dmitriy Novozhilov
2b24317358 [FIR-PLUGIN] Add test with meta annotation in plugin 2020-05-08 15:10:00 +03:00
Dmitriy Novozhilov
343928b97e [FIR] Add proper extension key to FirExtensionPoint 2020-05-08 15:10:00 +03:00
Dmitriy Novozhilov
941e43a226 [FIR] Fix collecting annotations with meta annotations 2020-05-08 15:10:00 +03:00
Dmitriy Novozhilov
b52452ef84 [FIR] Don't resolve annotation to error types on annotation phase 2020-05-08 15:10:00 +03:00
Dmitriy Novozhilov
17434c34b4 [FIR-PLUGIN] Enable lib with annotation in plugin tests 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
7e5024fb88 [FIR-PLUGIN] Add lib with annotations for allopen plugin 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
728e0604ac [FIR] Add prototype of first generation phase 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
b31981619e [FIR] Skip annotations resolve phase if no extensions registered 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
4ed6d7fddb [FIR] Add stage for resolving annotations from plugins 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
f9c37cfa6c [FIR] Add transformAnnotationTypeRef to FirAnnotationCall 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
ab2177f8a4 [FIR] Extract withScopesCleanup from FirAbstractBodyResolveTransformer 2020-05-08 15:09:59 +03:00
Dmitriy Novozhilov
bb645a7962 [FIR] Add transformSuperTypeRefs to FirClass 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
bad4497970 [FIR] Add transformDeclarations to FirFile 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
4b580b4e06 [FIR] Refactor FirResolvePhase.requiredToLaunch 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
3d30ba9c19 [FIR] Add ability to register user defined annotations for plugins 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
8ecd3d8efe [FIR-PLUGIN] Fix allopen plugin due to previous commits 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
ab831179e2 [FIR] Add different modes for extensions and annotations 2020-05-08 15:09:58 +03:00
Dmitriy Novozhilov
8f293acb2e [FIR] Add prototype of declaring plugin annotations 2020-05-08 15:09:57 +03:00
Dmitriy Novozhilov
d1b709e632 [FIR] Extract FirExtensionPointService to separate file 2020-05-08 15:09:57 +03:00
Dmitriy Novozhilov
35cce7eedd [FIR] Initialize extension service in all FIR tests 2020-05-08 15:09:57 +03:00
Dmitriy Novozhilov
cb0a7a5bf7 [FIR] Rename FirExtensionRegistrarExtension to FirExtensionRegistrar 2020-05-08 15:09:57 +03:00
Dmitriy Novozhilov
dd2b7f87f7 [FIR-PLUGIN] Add prototype of allopen plugin for FIR compiler 2020-05-08 15:09:56 +03:00
Dmitriy Novozhilov
9b43c66f80 [FIR] Add status transformer extension 2020-05-08 15:09:56 +03:00
Dmitriy Novozhilov
7f8a8ca099 [FIR] Add ability to register extension points in diagnostic tests 2020-05-08 15:09:56 +03:00
Dmitriy Novozhilov
a37975ab21 [FIR] Add compiler extension for plugin registration 2020-05-08 15:09:56 +03:00
Dmitriy Novozhilov
ff4a71386e [FIR] Register extension point component in fir sessions 2020-05-08 15:09:56 +03:00
Dmitriy Novozhilov
262d1472f2 [FIR] Add service for fir extension points 2020-05-08 15:09:56 +03:00
Mads Ager
1f4a3b0d1c [JVM_IR] Avoid safe-call conversions from Byte? and Short? to Int? for
comparisons.

Having those conversions leads to unnecesary boxing and null checks.

This change does it only for JVM in the optimization lowering. It
is unclear to me if the other backends can get away with something
similar.
2020-05-08 11:39:30 +03:00
Svyatoslav Kuzmich
3d5003d476 [JS_IR] Use new plugin to build Kotlin/JS stdlib with IR compiler
- Switch to building stdlib with bootstrap compiler since IR is stable
  enough
- Build stdlib with coreLibs by default
- Include JS IR stdlib to kotlin distribution
2020-05-08 10:37:48 +03:00
Sergey Rostov
14edc26cf1 Revert due to test failing in 201 2020-05-08 10:13:07 +03:00
Ilmir Usmanov
05797afaf8 Replace last SourceInterpreter with specific one in inliner
#KT-38489: Fixed
2020-05-07 23:04:03 +02:00
Ilmir Usmanov
2c88844409 Replace SourceInterpreter with interpreter, which track only
functional arguments.
2020-05-07 23:04:01 +02:00
Ilmir Usmanov
3173113cb3 Use BasicInterpreter instead of SourceInterpreter in LocalReturnsTransformer 2020-05-07 23:03:59 +02:00
Sergey Rostov
841e588c87 AsyncFileChangeListenerHelper: 191 and 201 2020-05-07 22:11:13 +03:00
Sergey Rostov
fbaf639784 AsyncFileChangeListenerHelper: 191 and 201 2020-05-07 21:54:33 +03:00
Sergey Rostov
c76c983614 minor: ScriptingSupport.Provider -> ScriptingSupport, KDoc 2020-05-07 21:48:50 +03:00
Sergey Rostov
541e6dc119 GradleScriptOutOfProjectTest: roots are already registered as legacy 2020-05-07 21:48:50 +03:00
Sergey Rostov
e099ee3af8 Fix lastIndexOfOrNull 2020-05-07 21:48:50 +03:00
Sergey Rostov
5474d55795 Scripting, minor: updateScriptDefinitions -> updateScriptDefinitionReferences 2020-05-07 21:48:49 +03:00
Sergey Rostov
0d6c7f2b41 ScriptClassRootsCache, sdk: use toSystemIndependentName 2020-05-07 21:48:49 +03:00
Sergey Rostov
f1789e910b gradle.kts, minor: remove unused code 2020-05-07 21:48:49 +03:00
Sergey Rostov
3e6f827885 GradleScriptListenerTest: add gradle-wrapper.properties to specify gradle version explicitly 2020-05-07 21:48:49 +03:00
Sergey Rostov
7de0bc9cdc ScriptClassRootsUpdater, updateSynchronously: cancel before waiting for lock 2020-05-07 21:48:49 +03:00
Sergey Rostov
bc0255890d ScriptClassRootsUpdater: fix clearing scheduledUpdate and check cancelled in sync 2020-05-07 21:48:49 +03:00
Sergey Rostov
6c3a6f8bc2 gradle.kts: remove LastModifiedFiles fs data when removing gradle root 2020-05-07 21:48:49 +03:00
Sergey Rostov
f196085e41 gradle.kts, minor: move isInAffectedGradleProjectFiles inside GradleBuildRootsManager 2020-05-07 21:48:49 +03:00
Sergey Rostov
c764ebfbac GradleScriptListenerTest: link gradle project 2020-05-07 21:48:48 +03:00
Sergey Rostov
9e18df87dc GradleBuildRootsManager: fix onProjectsLinked 2020-05-07 21:48:48 +03:00
Sergey Rostov
15c6c9f530 GradleLegacyScriptListener: call from GradleScriptListener
GradleScriptListener is called from VFS listener
2020-05-07 21:48:48 +03:00
Sergey Rostov
3a98ed96a2 gradle.kts: use toSystemIndependentName for paths coming from Gradle 2020-05-07 21:48:48 +03:00
Sergey Rostov
c79858e965 ScriptClassRootsUpdater: run synchronously in unit test mode 2020-05-07 21:48:48 +03:00
Sergey Rostov
d8692a78ba UnusedSymbolInspection: load script configurations from cache 2020-05-07 21:48:48 +03:00
Sergey Rostov
b8866078d2 gradle.kts, scheduleLastModifiedFilesSave: fix race condition 2020-05-07 21:48:48 +03:00
Sergey Rostov
b089f4dd2e gradle.kts, minor: areRelatedFilesUpToDate -> areRelatedFilesChangedBefore 2020-05-07 21:48:48 +03:00
Sergey Rostov
f5ac45ea08 GradleScriptListener: update lastModifiedFiles on document change 2020-05-07 21:48:48 +03:00
Sergey Rostov
d626184cee GradleBuildRoot: fix loading lastModifiedFiles 2020-05-07 21:48:47 +03:00
Sergey Rostov
3ba7c52fe8 LastModifiedFiles: fix in case of sequential changes in same file 2020-05-07 21:48:47 +03:00
Sergey Rostov
39c6efd40f .gradle.kts, listener: support multiple gradle projects linked to one IntelliJ project
GradleScriptInputsWatcher moved to GradleScriptListener.kt and GradleBuildRootsManager.kt
2020-05-07 21:48:47 +03:00
Sergey Rostov
02940f9f17 gradle.kts: docs 2020-05-07 21:48:47 +03:00
Sergey Rostov
0e7cf60b04 ScriptConfigurationManager: take OutsidersPsiFileSupport into account 2020-05-07 21:48:47 +03:00
Sergey Rostov
316c7ce60f Scripts, minor: get rid of ScriptingSupportHelper 2020-05-07 21:48:47 +03:00
Sergey Rostov
0cadcec27c gradle.kts: merge data on failed gradle sync, fix updates scheduling in corner cases 2020-05-07 21:48:47 +03:00
Sergey Rostov
b7e1cd7489 gradle.kts: solve the linked gradle builds hell 2020-05-07 21:48:47 +03:00
Sergey Rostov
6213c6187d gradle.kts, imported gradle build root: fix equality 2020-05-07 21:48:46 +03:00
Sergey Rostov
7942b4a0d2 ScriptConfigurationManager, outsider files: search in roots cache too 2020-05-07 21:48:46 +03:00
Sergey Rostov
eb672c02fa ScriptConfigurationManager: rebuild cache synchronously from default loader 2020-05-07 21:48:46 +03:00
Sergey Rostov
e6528a26e9 gradle.kts: cache definitions 2020-05-07 21:48:46 +03:00
Sergey Rostov
4de1381649 gradle.kts: remove useless gradle build root kinds 2020-05-07 21:48:46 +03:00
Sergey Rostov
aca1771619 Script configuration: fix getting javaHome 2020-05-07 21:48:46 +03:00
Sergey Rostov
6ad0ed7f40 CompositeScriptConfigurationManager: unified caching 2020-05-07 21:48:46 +03:00
Sergey Rostov
368e6f93df GradleScriptConfigurationLoader: KDocs 2020-05-07 21:48:46 +03:00
Ilya Chernikov
7e3dfb245b Avoid skipping lambda argument processing in case of explicit type param
#KT-38691 fixed
2020-05-07 18:39:57 +02:00
Ilya Goncharov
ec98d61520 Fix TeamCity badge
Now TeamCity badge points on archive configuration.
This PR make it to point on relevant Compiler Build
2020-05-07 17:27:24 +03:00
Dmitry Gridin
fb9562ca70 Add ThrowableRunnable to fix CCE 2020-05-07 12:36:47 +00:00
Dmitry Gridin
988c89602d tests: wrap tearDown with RunAll 2020-05-07 12:36:46 +00:00
Dmitry Gridin
f50e289033 fix psi tree in moveFunctionLiteralOutsideParentheses 2020-05-07 12:36:46 +00:00
Dmitry Gridin
afb15eb7cf BranchedFoldingUtils: fix psi tree after tryFoldToAssignment
#KT-38677 Fixed
2020-05-07 12:36:45 +00:00
Dmitry Gridin
ee0b7426c4 KotlinFunctionCallUsage: fix psi tree
#KT-38632
2020-05-07 12:36:44 +00:00
Dmitry Gridin
11a3482970 tests: apply official code style
#KT-38632 Fixed
2020-05-07 12:36:44 +00:00
Mikhail Glukhikh
d8f9643650 [FIR2IR] Use intersection type approximation for receivers 2020-05-07 15:27:17 +03:00
Sergey Igushkin
292563451c Fix falsely skipped shared-native source sets in HMPP (KT-38746)
Issue #KT-38746 Fixed
2020-05-07 11:55:29 +00:00
Alexander Udalov
a0400f59c2 Add -Xskip-prerelease-check compiler argument
#KT-38070 Fixed
2020-05-07 13:24:26 +02:00
Anton Yalyshev
37e676a4a6 Bump Gradle (6.3) and Android-build-tools (3.6.3) versions in new project wizards 2020-05-07 14:19:03 +03:00
Steven Schäfer
821aca984b JVM IR: Take superQualifierSymbols into account when lowering inline classes 2020-05-07 11:44:09 +02:00
Mikhail Glukhikh
52abc2ae1a [FIR] Fix spec test data according to a new diagnostic 2020-05-07 12:10:56 +03:00
Mikhail Glukhikh
38fc4d0f1f FIR: set & use dispatch receiver for q. access with super reference 2020-05-07 12:02:57 +03:00
Mikhail Glukhikh
b058ca635c FIR: make both ImplicitReceiverStack.get implementations consistent 2020-05-07 12:02:57 +03:00
Mikhail Glukhikh
cd2f5895a6 FIR: add minor fix of super reference handling 2020-05-07 12:02:57 +03:00
Jinseong Jeon
7b01cf7b04 FIR: handle labeled super reference properly 2020-05-07 12:02:56 +03:00
Victor Petukhov
260683c20e NI: Improve postponed arguments analysis
Introduce seven stages:
1) Analyze postponed arguments with fixed parameter types
2) Collect parameter types from constraints and lambda parameters' declaration
3) Fix not postponed variables for parameter types of all postponed arguments
4) Create atoms with revised expected types if needed
5) Analyze the first ready postponed argument and rerun stages if it has been analyzed
6) Force fixation remaining type variables: fix if possible or report not enough information
7) Force analysis remaining not analyzed postponed arguments and rerun stages if there are

^KT-37952 Fixed
^KT-32156 Fixed
^KT-37249 Fixed
^KT-37341 Fixed
2020-05-07 11:42:00 +03:00
subroh0508
50151e0e01 [Gradle, JS]AbstractNpmDependencyExtension -> DefaultNpmDependencyExtension 2020-05-07 10:21:51 +03:00
subroh0508
abf942b928 [Gradle, JS]Add optionalNpm methods 2020-05-07 10:21:51 +03:00
subroh0508
34e8b11475 [Gradle, JS]Add directoryNpmDependency method 2020-05-07 10:21:51 +03:00
subroh0508
121897133e [Gradle, JS]Delete peerNpm method used by file argument 2020-05-07 10:21:51 +03:00
subroh0508
231324d119 [Gradle, JS]Add peerNpm method for peerDependencies to KotlinDependencyHandler 2020-05-07 10:21:51 +03:00
subroh0508
3e2feac4ea [Gradle, JS]Add devNpm method for devDependencies to KotlinDependencyHandler 2020-05-07 10:21:51 +03:00
Dmitriy Novozhilov
726a871c07 [FIR] Add dependency of :dist to :firAllTest 2020-05-07 09:42:21 +03:00
Dmitriy Novozhilov
41545cd2b4 [FIR] Initialize origin in all places with creating of declarations 2020-05-07 09:42:20 +03:00
Dmitriy Novozhilov
e515b1c823 [FIR] Add origin field to FirDeclaration 2020-05-07 09:42:20 +03:00
Alexander Udalov
7a369b3a6a Mark PureIrGenerationExtension as deprecated to prevent more usages
The IR plugin extension mechanism is being reworked and in the new
scheme, this new extension point won't be necessary.
2020-05-06 22:51:32 +02:00
Steven Schäfer
9fc210224d Parcelize: Fix IBinderIInterface test 2020-05-06 22:51:12 +02:00
Steven Schäfer
518c7a32b8 Parcelize: Add a test for efficient Parcelable serialization within the same module 2020-05-06 22:51:12 +02:00
Steven Schäfer
a4e6dbb0d7 Parcelize: Add test for TypeParceler scoping behavior 2020-05-06 22:51:12 +02:00
Steven Schäfer
b35e8e208a Parcelize: Add a test for Parcelize with persistable bundles 2020-05-06 22:51:12 +02:00
Steven Schäfer
43bccff135 Parcelize: Add a test for parcelize of IBinder and IInterface 2020-05-06 22:51:12 +02:00
Steven Schäfer
6cf3e0e38e Parcelize: Add a test for exceptions in parcels (KT-31830) 2020-05-06 22:51:12 +02:00
Steven Schäfer
21637c828e Parcelize: Add a test for Java interop (KT-25807) 2020-05-06 22:51:12 +02:00
Steven Schäfer
aa0eeba327 Parcelize: Add a test for KT-36658 2020-05-06 22:51:12 +02:00
Steven Schäfer
01ea2a641f Parcelize: Add test for KT-26221 2020-05-06 22:51:12 +02:00
Steven Schäfer
1552e55474 Parcelize: Add an exhaustive test for primitive types 2020-05-06 22:51:12 +02:00
Steven Schäfer
1f97486fdd Parcelize: Improve testing infrarstructure
- Support newer android versions
- Allow testing against Java files using android APIs
- Update test expectations
- Auto-generate ParcelBoxTests
- Create tests for the JVM IR backend
2020-05-06 22:51:12 +02:00
Steven Schäfer
d62b353ab5 Parcelize: Fix metadata and remap synthetic descriptor stubs 2020-05-06 22:51:12 +02:00
Steven Schäfer
779133e71e Parcelize: Implement support for the JVM IR backend. 2020-05-06 22:51:12 +02:00
Steven Schäfer
7cad2be329 IR: Add an extension point after IR construction
The existing IrGenerationExtension is in the middle of IR construction
and basically requires plugins to work with the (deprecated) descriptors.

Since there are plans to change the IR extension point it makes sense to
introduce a temporary work-around to allow pure IR plugins to be
developed now, which could be ported to a more permanent API later.
2020-05-06 22:51:12 +02:00
Nicolay Mitropolsky
6ae7d53a93 Uast: support extendsList for reified types (KT-38173) 2020-05-06 15:31:20 +03:00
Nicolay Mitropolsky
43549baf58 Revert "Uast: forcing kotlin.uast.force.uinjectionhost=true always"
This reverts commit e4b7c391
2020-05-06 15:31:20 +03:00
Nicolay Mitropolsky
00b44c1e68 Uast: making KotlinStringTemplateUPolyadicExpression.operands always non-empty (EA-231393) 2020-05-06 15:31:19 +03:00
Nicolay Mitropolsky
b7e715045a Uast: skip KtWhenConditionWithExpression in UAST (KT-38521)
when building parents, because they are anyway ignored in converter
2020-05-06 15:31:19 +03:00
Nicolay Mitropolsky
903f35ce0c Uast: don't fall on empty when entries (EA-231339) 2020-05-06 15:31:19 +03:00
Dmitry Petrov
3143b15a17 Generate widening cast for Byte and Short to Int 2020-05-06 14:42:37 +03:00
Mikhail Glukhikh
427973fe48 FIR serializer: fix typo in finding argument name 2020-05-06 13:10:13 +03:00
Jinseong Jeon
deb8e1f9db IR: cleanup unused implementation in WrappedDescriptors
This is partial revert of 08ca6f5, which set metadata field of IR
symbols during FIR2IR conversion, triggering some paths in IR
codegen to use wrapped descriptors copy builder and others to
serialize. Now FIR element-based metadata serialization is in,
those additions were not needed anymore.
2020-05-06 13:10:07 +03:00
Jinseong Jeon
0c7ed04260 FIR: make (K)SuspendFunctionX derived from (K)Function 2020-05-06 13:09:32 +03:00
Mikhail Glukhikh
9eee089740 FIR: regenerate diagnostic tests 2020-05-06 13:09:26 +03:00
Mikhail Glukhikh
f7137fe860 Slightly polish FirAnnotationClassDeclarationChecker 2020-05-06 10:42:39 +03:00
Likholetov Mikhail
aa706d322d [FIR] Support several annotation class diagnostics 2020-05-06 10:32:01 +03:00
Mikhail Zarechenskiy
1e8dff6a7c Fix bunch files after removing IDE option
Follow-up of c01a171d
2020-05-04 15:48:33 +03:00
Mikhail Zarechenskiy
b2ca61e8a5 Fix compilation, remove import 2020-05-04 15:43:46 +03:00
Mikhail Zarechenskiy
c01a171d4c Revert "Add option to enable new inference only for IDE analysis"
This reverts commit a3247b1b92.

 #KT-37378 Fixed
2020-05-04 15:14:43 +03:00
Mikhail Zarechenskiy
d7dfe9e1e5 FUS Collector: remove metric about using new inference in IDE
Now it's not needed as new inference is enabled by default
2020-05-04 15:14:28 +03:00
Alexander Udalov
54f9f130e2 Do not generate references as adapted with -Xno-optimized-callable-references
The reason for this is that this flag is used right now in 'cli-common'
to workaround the problem that this module is compiled with API version
1.4, but runs with stdlib of version 1.3 (bundled to Gradle). The same
problem would appear with adapted function references, since we use
kotlin/jvm/internal/AdaptedFunctionReference in the bytecode, only
available since 1.4.

The fix is to generate adapted references in this case as subclasses of
the already existing kotlin/jvm/internal/FunctionReference. This can
change behavior in some extreme corner cases (because such references
can now be observed to have reflection capabilities), but it's an -X
argument anyway.

Another option would be to introduce another compiler argument
specifically for this, but it looks like it would only complicate things
without much benefit.
2020-05-04 13:24:53 +02:00
Mikhail Bogdanov
4f7599076c Postpone JvmDefault deprecation. Revert "Deprecate @JvmDefault"
This reverts commit c11f3868
2020-05-04 10:02:16 +02:00
Vladimir Dolzhenko
911dfde0fe Add highlighting perf test with empty profile 2020-05-04 09:48:17 +02:00
Dmitry Gridin
32be4c03ca ExtractSuperRefactoring: add quoteSegmentsIfNeeded() 2020-05-04 03:49:32 +00:00
Dmitry Gridin
86de734f26 KotlinExtractSuperclassDialog: cleanup code 2020-05-04 03:49:31 +00:00
Dmitry Gridin
ccfea97390 CopyKotlinDeclarationsHandler: fix for package with backticks
#KT-38543 Fixed
2020-05-04 03:49:30 +00:00
Dmitry Gridin
b058dc12df packageUtils: cleanup code 2020-05-04 03:49:30 +00:00
Dmitry Gridin
ac9ad30681 SetterBackingFieldAssignmentInspection: fix exception
#KT-38520 Fixed
2020-05-04 03:49:29 +00:00
Dmitry Gridin
6f5b3aebe1 KotlinIntroduceVariableHandler: fix CCE for destruction declaration
#EA-219701 Fixed
2020-05-04 03:49:28 +00:00
Dmitry Gridin
8e35b7a29c KotlinIntroduceVariableHandler: fix for declarations with expression body
#KT-38449 Fixed
2020-05-04 03:49:28 +00:00
Dmitry Gridin
d21e383094 KotlinIntroduceVariableHandler: cleanup code 2020-05-04 03:49:27 +00:00
Dmitry Petrov
b574917314 Minor: update FIR2IR testData 2020-05-01 17:55:49 +03:00
Mads Ager
6257b32954 [JVM_IR] Avoid boxing when comparing primitive to object. 2020-05-01 17:53:34 +03:00
Vladimir Dolzhenko
7e55336300 Add yourKit profiler to perfTests 2020-05-01 12:35:38 +02:00
Dmitry Petrov
a564d47158 Minor: unmute FIR black box test
Guys, please, can you do it yourself?
2020-05-01 13:14:21 +03:00
Dmitry Petrov
1d10776db4 Minor: update FIR2IR testData 2020-05-01 13:14:21 +03:00
Mads Ager
db17184cfd [JVM_IR] Avoid some boxing when comparing boxed primitives to primitives. 2020-05-01 13:14:20 +03:00
Dmitry Savvinov
f3830cb07e Make KotlinNativeTasks.konanTargetsForManifest non-nullable, otherwise Gradle fails 2020-05-01 12:56:10 +03:00
Dmitry Savvinov
686d00ddf5 Collect and pass to K2Native actual targets of native-shared compilation
^KT-38658 Fixed
2020-04-30 20:05:45 +03:00
Yunir Salimzyanov
550aa1ba59 Remove partial quotes in csv files
Cause: github do not want to render fields with such kind of quotes
2020-04-30 19:30:56 +03:00
Yunir Salimzyanov
cf8b29a636 Add missing commas to csv files 2020-04-30 19:30:56 +03:00
Yunir Salimzyanov
856d8e64a2 Escape fields with extra commas in csv for muted tests 2020-04-30 19:30:55 +03:00
Valentin Kipyatkov
5d60572cfd Temporarily disabled optimization because of failing tests 2020-04-30 15:45:24 +03:00
Vladimir Ilmov
1128d659a4 (CoroutineDebugger) No restored frames in coroutine context found. 2020-04-30 13:14:41 +02:00
Mikhail Glukhikh
87393398f2 FIR serializer: fix isLambda copying 2020-04-30 13:54:27 +03:00
Natalia Selezneva
d716c47f17 Gradle Project importing: move ModelBuilders and ModelProviders to kotlin-gradle-tooling
^KT-36673 Fixed
2020-04-30 13:41:13 +03:00
simon.ogorodnik
6ca3a994d9 [FIR2IR] Disable initializer generation for external enum entries 2020-04-30 13:31:12 +03:00
simon.ogorodnik
4133749ee7 [FIR2IR] Fix property fake overrides 2020-04-30 13:22:17 +03:00
simon.ogorodnik
a11866ab5a [FIR2IR] Fix labeled this references 2020-04-30 13:15:43 +03:00
Mikhail Glukhikh
3d60fdfed1 Raw FIR: don't check class kind for data / inline modifiers 2020-04-30 13:15:24 +03:00
Jinseong Jeon
9a561f4a7c FIR2IR: generate synthetic members for inline class 2020-04-30 13:09:53 +03:00
simon.ogorodnik
ef8bcceb8e [FIR2IR] Use only data class primary constructor parameters for equals 2020-04-30 13:03:30 +03:00
Jinseong Jeon
0890b8bad3 FIR2IR: set superQualifierSymbol for property access 2020-04-30 12:26:47 +03:00
Jinseong Jeon
a084c5bf7d FIR2IR: populate overriddenSymbols for overriding properties 2020-04-30 12:25:48 +03:00
rapturemain
02aa11a0a0 [FIR] Support for EXPOSED_TYPE_PARAMETER_BOUND 2020-04-30 12:08:43 +03:00
Abduqodiri Qurbonzoda
bfffcf6b23 Update BoxJsTest expected reachable nodes because of new collection builders 2020-04-30 02:28:41 +03:00
Abduqodiri Qurbonzoda
ec166db506 Implement collection builders 2020-04-30 02:28:41 +03:00
Anton Yalyshev
1bf41ba7d2 Remove 191 support because of outdated platform whitelist API 2020-04-30 01:06:04 +03:00
Anton Yalyshev
658c30b6b3 Combine usage of kotlin.ide.settings FUS collector
#KT-38620 Fixed
2020-04-30 01:06:03 +03:00
Vladimir Dolzhenko
a407605f63 Turn off highlight perf tests for kotlin/gradle/*kts 2020-04-29 22:49:46 +02:00
Vyacheslav Karpukhin
ba993ba0fe Provide an extension point that allows plugins to handle renaming of references in other languages 2020-04-29 20:56:46 +02:00
pyos
df4f1365ec PSI2IR: support SAM conversion to substituted types
i.e. in arguments to `f(T x)` where `T` is a type parameter bound to a
SAM type.
2020-04-29 18:50:40 +03:00
Dmitry Petrov
d9fd51c608 JVM_IR: basic suspend conversion on argument test passed 2020-04-29 18:28:05 +03:00
Victor Turansky
819634c4cd Official logo for Toolbox icon & IDEA Welcome screen 2020-04-29 18:24:53 +03:00
rapturemain
54cfd1f625 [FIR] Handle protected effective visibility relation properly
#KT-38401 Fixed
2020-04-29 17:25:19 +03:00
Mikhail Glukhikh
07e9b9517a [FIR] Extract interface FirEffectiveVisibility 2020-04-29 17:25:12 +03:00
Mikhail Glukhikh
e81c2c5c6d FirStatusResolveTransformer: don't enter property accessor bodies 2020-04-29 17:25:05 +03:00
Mikhail Glukhikh
9e413bde11 [FIR] Don't visit locals in status resolve transformer 2020-04-29 17:24:47 +03:00
Dmitry Gridin
aafb4482c3 CodeToInlineBuilder: cleanup code 2020-04-29 20:19:42 +07:00
Toshiaki Kameyama
bcefee0105 Replace deprecated symbol usage: do not add 'this' receiver for imported object function
#KT-26361 Fixed
2020-04-29 20:19:41 +07:00
Dmitriy Dolovov
9d27ba5b59 HMPP: Backward-compatible Kotlin facet serialization
^KT-38634
2020-04-29 19:19:54 +07:00
Mikhail Zarechenskiy
1a26d2e157 Fix exception during resolution of incorrect fun interface
#KT-37541 Fixed
2020-04-29 14:15:25 +03:00
Mikhail Zarechenskiy
780bc1f607 Fix fun interfaces with extension receivers
#KT-37712 Fixed
2020-04-29 14:15:25 +03:00
Mikhail Zarechenskiy
fa50d66afe [NI] Fix SAM conversion for projected-out members
#KT-25290 Fixed
2020-04-29 14:15:25 +03:00
Mikhail Zarechenskiy
e3fe1bcf7c [NI] Place varargs at the end of value arguments list
This is needed to preserve behavior with the OI
2020-04-29 14:15:15 +03:00
Mikhail Bogdanov
639af69185 Minor. Fix test data 2020-04-29 12:54:47 +02:00
Ilya Goncharov
e17e3401eb [Gradle, JS] Use disambiguation classifier in platform only for both
#KT-38635 fixed
2020-04-29 13:27:48 +03:00
Alexander Udalov
9fa8e009c6 Support equals/hashCode for fun interfaces in JVM and JVM_IR
#KT-33455 Fixed
2020-04-29 12:15:50 +02:00
Alexander Udalov
de461dd9a5 Minor, extract function in FunctionReferenceLowering
Also simplify the expectedArity computation a few lines above.
2020-04-29 12:15:50 +02:00
Alexander Udalov
b77e5a21ec Report error if fun interface method has JVM name getFunctionDelegate
This is needed so that it wouldn't clash with the corresponding member
from the kotlin/jvm/internal/FunctionAdapter interface, which all fun
interface wrappers will implement to get proper equals/hashCode. The
workaround is to rename the fun interface method.

 #KT-33455
2020-04-29 12:15:50 +02:00
Andrey Uskov
55934ff63a Fixed collecting MPP targets in gradle statistics 2020-04-29 13:01:24 +03:00
Andrey Uskov
96887d6e9f Fixed import of JS source sets with Both mode
Added flag indicating that source set naming contract is violated. In this case disambiguition classifier is ignored in IDE.
#KT-37562 Fixed
2020-04-29 13:01:21 +03:00
Ilya Goncharov
1f40a71cbe [Gradle, JS] No create target on import if no target in DSL
#KT-38469 fixed
2020-04-29 12:59:35 +03:00
Vladimir Dolzhenko
84ad9dd8de Increase warm-up, test iterations in PerformanceTypingIndentationTest 2020-04-29 11:40:04 +02:00
Ilya Chernikov
4a0d1b0b9d Use precalculated intersection type in JVM backend
also test all backends for the problem in the issue
#KT-37715 fixed
2020-04-29 11:12:22 +02:00
Ilya Chernikov
45ac81c585 Do not check type depth for constrains generated on subtyping
#KT-38143 fixed
2020-04-29 11:12:21 +02:00
Ilya Gorbunov
1bcccca007 j2k: insert kotlin.Throws annotation instead of kotlin.jvm.Throws 2020-04-29 09:17:55 +03:00
Dmitry Gridin
844e567421 AddThrowsAnnotationIntention: fix compatibility for old annotation
#KT-38391
2020-04-29 09:17:55 +03:00
Ilya Gorbunov
6bf85beba7 AddThrowsAnnotationIntention: add common kotlin.Throws
Partially fixes KT-38391
2020-04-29 09:17:55 +03:00
Denis Zharkov
0f9718bf0d Add test on kotlin.native.Throws ambiguity
KT-35468
2020-04-29 09:17:55 +03:00
Denis Zharkov
c6ae423816 Add tests for KT-35468
^KT-35468 Fixed
2020-04-29 09:17:54 +03:00
Ilya Gorbunov
9c2e149b5b Expect/actual kotlin.Throws annotation
#KT-34848
2020-04-29 09:17:54 +03:00
Ilya Gorbunov
9c0b49d3ed Advance bootstrap to 1.4.0-dev-7751 2020-04-29 09:17:54 +03:00
Dmitry Gridin
2f015b4c7a Fix testKotlin_moveTopLevelDeclarations_movePrivatePropertyWithDefaultAccessors_MovePrivatePropertyWithDefaultAccessors test 2020-04-29 13:05:36 +07:00
Dmitriy Dolovov
b1bef8485d [Commonizer] Capitalize messages to be printed at console 2020-04-29 12:11:50 +07:00
Dmitriy Dolovov
0f6dbed03b [Commonizer] Don't fail when one of targets is not supported at the host
^KMM-214
2020-04-29 12:11:44 +07:00
Mike Samuel
580ffc1d99 Reformat FrameworkAdapter example code in comment
The example code shows up all on one line in the generated docs.

https://kotlinlang.org/api/latest/kotlin.test/kotlin.test/-framework-adapter/ shows

> suite('a suite', false, function() { suite('a subsuite', false, ...

Use a fenced code block with a language identifier.
2020-04-29 07:36:46 +03:00
Vadim Semenov
f4cea1b0cd Fix typo in KDoc for Element.getPolymorphicElement 2020-04-29 07:35:22 +03:00
Ilya Gorbunov
886c4eb492 Report kotlin bootstrap version for integrity test build 2020-04-29 04:49:34 +03:00
Ilya Gorbunov
86d098b8ad Infer internal artifacts bootstrap repository
This allows taking these artifacts from buildserver if the
bootstrap itself is taken from there.
2020-04-29 04:49:34 +03:00
Dmitry Petrov
f9bb07e128 JVM_IR: generate flags for adapted function references 2020-04-29 00:55:52 +03:00
Ilya Kirillov
94bc8eaf83 Wizard: remove copyrights from iOS template 2020-04-28 21:34:48 +03:00
Ilya Kirillov
6a9a97006b Wizard: fix not created by default xcode framework in shared module
the runForXcode task is not generating xcode framework
if there is no source files in shared module
2020-04-28 21:34:47 +03:00
Ilya Kirillov
47125553cb Wizard: fix android project template
It was not able to be built as lint task required com.android.tools.build:gradle
in classpath to work

#KT-38579 fixed
2020-04-28 21:34:46 +03:00
Ilya Kirillov
72030ee94e Wizard: do not run whole JPS project importing in write action 2020-04-28 21:34:45 +03:00
Ilya Kirillov
b404e6324f Wizard: always allow user to choose project JDK 2020-04-28 21:34:43 +03:00
Ilya Kirillov
56eebed1d8 Wizard: fix kotlin and resources directory names in Android module
#KT-38428 fixed
2020-04-28 21:34:42 +03:00
Ilya Kirillov
ccb8a93ee3 Wizard: minor, move message to bundle 2020-04-28 21:34:42 +03:00
Ilya Kirillov
1a68e40ebd Wizard: add common target to FullStackWebApplicationProjectTemplate 2020-04-28 21:34:40 +03:00
Ilya Kirillov
78b5be94e9 Wizard: validate project path for emptiness
#KT-38567 fixed
2020-04-28 21:34:39 +03:00
Ilya Kirillov
5f79ffbe50 Wizard: reduce buildsystem buttons sizes 2020-04-28 21:34:37 +03:00
Ilya Kirillov
d9889e449f Wizard: do not create project with snapshot version 2020-04-28 21:34:31 +03:00
Ilya Kirillov
730cce93ed Wizard: add arrows for module selection popup 2020-04-28 21:34:27 +03:00
Ilya Kirillov
7286fcbf39 Wizard: use new api from gradle to import project on >= 193 2020-04-28 21:34:26 +03:00
Dmitriy Novozhilov
e6d8e67a3a [FIR] Generify ComponentArray 2020-04-28 21:05:06 +03:00
Dmitriy Novozhilov
a4a58a9d74 [FIR] Get rid of FirSession.service 2020-04-28 21:05:06 +03:00
Leonid Startsev
52933e161e Use AssociatedObjects on JS too
because JS IR now supports them
2020-04-28 20:51:24 +03:00
Steven Schäfer
905a8ca0d0 Reflect: Handle methods with inline class default parameters 2020-04-28 19:49:35 +02:00
Pavel Kirpichenkov
86d6470ced Update test data forgotten in 36a57973
KT-38544
2020-04-28 20:26:11 +03:00
Anton Bannykh
2992d49a1d JS IR: fix findAssociatedObjects for primitive type KClass'es 2020-04-28 19:08:44 +03:00
Dmitry Petrov
878e838f0b JVM: Suspend converted references inherit AdaptedFunctionReference 2020-04-28 18:56:37 +03:00
pyos
deecb6a28e JVM: move synthetic line number generation to the inliner
This makes the behavior of JVM and JVM_IR the same without having to
deal with PSI nodes.
2020-04-28 17:21:07 +02:00
pyos
91b6daeacc JVM: fix debug info for script file classes 2020-04-28 17:21:07 +02:00
Georgy Bronnikov
1e8a660fda IR: use default parameters in Ir...Impl constructors 2020-04-28 18:19:46 +03:00
Georgy Bronnikov
9561cc8270 JVM_IR: JvmNameProvider 2020-04-28 18:19:46 +03:00
Georgy Bronnikov
52df54ae49 IR: add NameProvider 2020-04-28 18:19:46 +03:00
Georgy Bronnikov
82d55e1a67 Minor: remove unused parameters, reformat code 2020-04-28 18:19:46 +03:00
Alexander Podkhalyuzin
6372c01e49 Added missing specificity comparator to FIR
This is required to correctly resolve overloading in cases when we
need to find most specific alternative in Java between int and Integer.
2020-04-28 17:34:42 +03:00
Steven Schäfer
b6b8dd1eab JVM IR: Avoid unnecessary CHECKCASTs in enum classes 2020-04-28 16:31:13 +02:00
Steven Schäfer
cb3a4727cf JVM IR: Optimize field initializers in secondary constructors 2020-04-28 16:27:54 +02:00
Mads Ager
fed6272de4 [JVM_IR] Use ifne and ifeq for integer zero comparisons. 2020-04-28 16:27:10 +02:00
Anton Bannykh
e8a6ddceaa JS IR: hide runtime helpers from users 2020-04-28 16:40:07 +03:00
Mikhail Glukhikh
9f20e65595 FIR resolve completion: extract prepareQualifiedTransform 2020-04-28 16:32:07 +03:00
Mikhail Glukhikh
eecf33a31d FIR resolve completion: add delegated completion for variable access 2020-04-28 16:32:07 +03:00
Mikhail Glukhikh
4866e7a988 FIR resolve completion: move transformFunctionCall upper 2020-04-28 16:32:06 +03:00
Mikhail Glukhikh
d910a4cf23 FirCallResolver: perform completion for var access with ILT receiver
#KT-38473 Fixed
2020-04-28 16:32:06 +03:00
Mikhail Glukhikh
b0b198119d FIR resolve completion: transform receivers for variable accesses 2020-04-28 16:32:06 +03:00
Mikhail Glukhikh
ab79e60b63 FIR2IR: consider integer literal type as error type 2020-04-28 16:32:06 +03:00
Leonid Startsev
205f29128a Updated testdata to a new generation strategy
Fix IR generation problems

(partially reverts cd931796bc)

Regenerate diagnostic testdata according to runtime changes
2020-04-28 15:48:14 +03:00
Dmitry Gridin
a11e6b2eed KotlinChangePackageRefactoring: fix formatting for long qualifier names
#KT-38627 Fixed
2020-04-28 12:37:18 +00:00
Dmitry Gridin
db5751616a MoveKotlinDeclarationsProcessor: fix formatting for long qualifier names
#KT-35338 Fixed
2020-04-28 12:37:17 +00:00
Dmitry Gridin
2b8bb30744 Change signature: fix formatting for long qualifier names
#KT-12878 Fixed
2020-04-28 11:58:16 +00:00
Sergey Igushkin
8336119557 Kotlin/Native 1.4-M3-dev-15453 2020-04-28 14:19:12 +03:00
Alexander Udalov
94346e8a03 Add JVM target bytecode version 14
#KT-38413 Fixed
2020-04-28 13:00:23 +02:00
Alexander Udalov
098a935aa7 Fix exponential string table size of anonymous classes during inlining
When we inline an anonymous object which captures something such as
crossinline values or reified parameters, we copy and transform its
metadata in `AnonymousObjectTransformer.transformMetadata`. Basically we
read the metadata of the original class, add a minor protobuf extension
and write it to the new class.

This also includes copying the string table. We read the string table
into `JvmNameResolver` (a representation of string table used in
deserialization), then construct a `JvmStringTable` (a representation
used in _serialization_) and then write it back.

There's a few optimizations in the string table representation in JVM
metadata which allow to store less strings and thus take less space. See
`StringTableTypes.Record` in `jvm_metadata.proto` for more information.
One of the optimizations `Record.range` allows to avoid storing the same
record many times in a sequence. For example, if we have N different
strings in the string table but none of them require any operation (such
as substring, char replacement, etc.), then we only store the record
with all default values (no operation, no predefined string, etc.) and
set its `range` to N. Upon reading such optimized record list in
`JvmNameResolver`, we "expand" it back to normal, so that we could index
it quickly and figure out what operation needs to be performed on each
string from the string table.

The problem was that when we expanded this list, we didn't set the range
of the expanded record entry to 1. So each record in
`JvmNameResolver.records` still has its original range. It doesn't cause
any problems most of the time because the range in this expanded list is
almost unused. However, when copying/transforming metadata for anonymous
objects, we mistakenly passed this expanded list with incorrect ranges
to `JvmStringTable`. So the metadata in the copied anonymous object
ended up being incorrect: each record now was present the number of
times equal to its range. Copying such metadata once again led to
another multiplication of the record list size. Multiple copies resulted
in exponential increase in memory consumption and quickly led to OOM.

For the fix, we now take the original, unexpanded list of records when
creating `JvmStringTable` out of `JvmNameResolver` for transformation of
anonymous object metadata.

Note that another possible fix would be to make range for each record in
`JvmNameResolver.records` equal to 1. This is undesirable though, since
then we'd need to copy each `JvmProtoBuf.StringTableTypes.Record`
instance, of which there could be many, and use some memory for no
apparent gain (since ranges in that expanded list are now not used at
all).

 #KT-38197 Fixed
2020-04-28 12:59:52 +02:00
Mikhail Glukhikh
65065a15a3 FIR DFA: stabilize type order 2020-04-28 13:12:15 +03:00
Pavel Kirpichenkov
36a57973b5 [NI] CST: remove max depth offset from recursion detection
Recursive type with several recursive anscestors can create a number of identical
common supertype calculations, growing exponentially on every step of recursion.
Previously the number of calculations was limited by D + 3, where D is a type depth.
Since the limit is dynamic, it seems that extra +3 offset can be dropped thus
reducing the number of recursions. The proper solution is to detect such a recursion
and fold recursive type preemtively, but for now this may improve performance in some use cases.

^KT-38544 In progress
2020-04-28 12:53:09 +03:00
Pavel Kirpichenkov
dfc86dbf63 [NI] Avoid type rendering in member scope for intersection type
KT-38544
2020-04-28 12:53:09 +03:00
Dmitry Petrov
802372ceff PSI2IR: suspend conversion on arbitrary arguments 2020-04-28 12:41:56 +03:00
Sergey Igushkin
e3d33cdc10 Drop Gradle < 6.0 support for Kotlin MPP Gradle plugin
This is required due to issues with dependency resolution of the
kotlinx library modules published in a way that their root MPP module
contains the JVM artifacts so that consumers that can't read Gradle
module metadata get the JVM JAR and POM. Gradle 6.0+ fails to resolve
those modules in a variant-aware way, always choosing the JVM artifacts.

To avoid issues on the consumer side when these dependencies are used,
we decided to drop support for Gradle < 6.0 in the MPP plugin.

Issue #KMM-233 Fixed
2020-04-28 09:33:17 +00:00
Andrey Uskov
89777f8bf3 Move GradleQuickFixTest checks in EDT Thread 2020-04-28 11:53:30 +03:00
Andrey Uskov
aa6801569a Fix compilation of ExternalSystem tests in legacy branches 2020-04-28 11:53:28 +03:00
Dmitry Savvinov
3b7fbeb71b Fallback to M2-implementation of dependsOn in AS + M3
^KT-33809
2020-04-28 10:42:56 +03:00
Dmitriy Dolovov
151890dde5 Add test for overloading expect MemberDescriptors discrimination
Issue #KT-38298
2020-04-28 13:16:23 +07:00
Dmitriy Dolovov
90e888a1b6 Discriminate overloading expect MemberDescriptors
Issue #KT-38298
2020-04-28 13:16:18 +07:00
Mikhail Glukhikh
34ae35b2aa Move FirJvmClassCodegen inside fir:fir2ir:jvm-backend #KT-38156 Fixed
This removes dependency of IR JVM backend from FIR
2020-04-28 07:35:13 +03:00
Mikhail Glukhikh
dbd4cecff6 FIR serializer: accept FirClass instead of IrClass to get rid of IR deps 2020-04-28 07:35:12 +03:00
Mikhail Glukhikh
8d85e7a401 FIR serializer: add forgotten type alias serialization 2020-04-28 07:35:10 +03:00
Mikhail Glukhikh
a545ec41a0 FIR serializer: consider exotic types as errors (breaks 4 BB tests) 2020-04-28 07:35:09 +03:00
Mikhail Glukhikh
ec7522c675 FIR serializer: introduce nonSourceAnnotations 2020-04-28 07:35:08 +03:00
Mikhail Glukhikh
7adb4eb872 FIR serializer: extract annotation argument visiting to separate object 2020-04-28 07:35:07 +03:00
Mikhail Glukhikh
394fa7affc FIR serializer: add bad test data changes 2020-04-28 07:35:06 +03:00
Mikhail Glukhikh
f98c73cb30 [FIR] Support FirMetadataSource.File in FIR2IR & serializer (KT-38156) 2020-04-28 07:35:04 +03:00
Mikhail Glukhikh
95a17eadb2 FIR serializer: refactor typeProto + add some suspend types support 2020-04-28 07:35:02 +03:00
Mikhail Glukhikh
6af66cd3a2 FIR: don't serialize static enum members fixing testEnumNameOrdinal 2020-04-28 07:35:01 +03:00
Mikhail Glukhikh
c2c85365e6 Use FIR metadata in FIR2IR data class member generator (KT-38156) 2020-04-28 07:34:59 +03:00
Mikhail Glukhikh
c6c848f929 Introduce & use FirJvmSerializerExtension & FirBasedClassCodegen
#KT-38156 In Process
2020-04-28 07:34:56 +03:00
Mikhail Glukhikh
7ae98485b8 IR: separate ClassCodegen & DescriptorBasedClassCodegen 2020-04-28 07:34:55 +03:00
Mikhail Glukhikh
03be3c108a [FIR2IR] Introduce FirMetadataSource and use it (KT-38156) 2020-04-28 07:34:52 +03:00
Mikhail Glukhikh
2aae735a8e Introduce FIR serializer (isn't in use yet, KT-38156) 2020-04-28 07:34:50 +03:00
Sergey Igushkin
2c63a15af2 Add a test for KT-38338
^KT-38338
2020-04-28 02:39:32 +03:00
Vladimir Dolzhenko
ce7ea00178 Added missed language for fileType
#KT-38571 Fixed
2020-04-27 22:45:07 +02:00
Dmitry Petrov
000757c75b JVM: Add suspend conversion bit for function references equals/hashCode 2020-04-27 21:02:37 +03:00
Dmitry Petrov
c7a96810bf JVM: Suspend conversion for function references 2020-04-27 21:02:37 +03:00
Dmitry Petrov
6b9a7464f5 PSI2IR: Support suspend conversion for function references 2020-04-27 21:02:37 +03:00
Mikhail Glukhikh
10cda4b54f [FIR] Minor: regenerate diagnostic tests 2020-04-27 19:42:47 +03:00
Yuku Kotani
de28a41caa KT-32163: Open Quick Documentation when cursor inside function / constructor brackets (#2502)
* Show function docs when cursor is in args of the function call

* Show constructor docs when cursor is in args of the constructor call

* Show function docs when cursor is in args of the kt function call

* Add some tests

* Use JavaDocumentationProvider to fetch java method document

* Support caret in params

#KT-32163 fixed
2020-04-27 18:15:24 +03:00
Ilya Goncharov
6b5b23f37b [Gradle, JS] Remove propagation moduleName from legacy to ir target
#KT-38614 fixed
2020-04-27 18:01:29 +03:00
Natalia Selezneva
8e93ac0df7 Merge pull request #3331 from gharrma/fix-script-change-listener
Move vFile.isValid() check inside read action
2020-04-27 17:59:13 +03:00
Anton Bannykh
442331acc9 IR JS: support findAssociatedObject feature (KT-37418 fixed) 2020-04-27 17:23:19 +03:00
Vladimir Dolzhenko
f4b6e1bff6 Reworked deprecated fileTypeFactory EP usage
Relates to #KT-38571
2020-04-27 14:08:17 +00:00
Vladimir Dolzhenko
639cc69920 Reworked deprecated defaultLiveTemplatesProvider EP usage
Relates to #KT-38571
2020-04-27 14:08:16 +00:00
Konstantin Tskhovrebov
6d7e428d89 Get first platform from platformCompilations instead host platform.
Fixed #KMM-234
2020-04-27 16:54:29 +03:00
Mikhail Glukhikh
90fd2c6c4c FirCallResolver: perform int literal approximation also for var access
Partial fix of KT-38473
2020-04-27 16:04:05 +03:00
Mikhail Glukhikh
5446795d12 FirCallResolver: reuse collectCandidates for variable access 2020-04-27 16:04:04 +03:00
Nikolay Krasko
4230a17427 Revert "Force bootstrap stdlib in modules that used in composite build"
This reverts commit ad76562c
2020-04-27 15:58:38 +03:00
Nikolay Krasko
ad76562cbc Force bootstrap stdlib in modules that used in composite build 2020-04-27 15:36:49 +03:00
rapturemain
49593d308c [FIR] Add EXPOSED_SUPER_(CLASS/INTERFACE) checker 2020-04-27 13:00:49 +03:00
Jinseong Jeon
ef09850df8 FIR2IR: set superQualifierSymbol for super call 2020-04-27 11:50:26 +03:00
Jinseong Jeon
57fe01c375 FIR2IR: populate overriddenSymbols for overriding functions
#KT-38416 Fixed
2020-04-27 11:50:24 +03:00
Andrey Uskov
b51649dcc6 Fix tests compilation in 201 2020-04-27 10:00:32 +03:00
Mikhail Zarechenskiy
11390d9de3 Add test for obsolete issue
#KT-38420 Obsolete
2020-04-27 01:55:39 +03:00
Andrey Uskov
27384d29d4 Move inspection checks in EDT thread 2020-04-27 00:21:17 +03:00
Andrey Uskov
d2a10cbb2d Merge changes in ExternalSystemTestCase into KotlinGradleTests 2020-04-27 00:21:12 +03:00
Denis Zharkov
45481b214a Use kotlin.Throws in NativeThrowsChecker
KT-35468
2020-04-26 23:08:45 +03:00
Denis Zharkov
d0f4631192 Resolve ambiguity between kotlin.Throws and kotlin.native.Throws
KT-35468
2020-04-26 23:08:40 +03:00
Denis Zharkov
d3f541a715 Overcome ambiguity between kotlin.Throws and kotlin.jvm.Throws
^KT-35468 In Progress
2020-04-26 23:08:22 +03:00
Denis Zharkov
534ff58d9c Minor. Introduce constant JVM_THROWS_ANNOTATION_FQ_NAME
KT-35468
2020-04-26 23:08:18 +03:00
Vladimir Dolzhenko
1565fc0211 Call expression changes in property initializer are OCB
#KT-38443 Fixed
2020-04-25 20:57:14 +00:00
Vladimir Dolzhenko
1cc58518c0 Compatify KotlinCodeBlockModificationListener p.2
Relates to #KT-38443
2020-04-25 20:57:14 +00:00
Vladimir Dolzhenko
5a36da90b6 Compatify KotlinCodeBlockModificationListener p.1
Relates to #KT-38443
2020-04-25 20:57:13 +00:00
Vladimir Ilmov
38622d8d92 (CoroutineDebugger) SkipCoroutineStackFrameProxy logic added 2020-04-24 21:02:18 +02:00
pyos
887165a23b JVM_IR: avoid copying when optimizing ?:/?. 2020-04-24 21:00:07 +03:00
Abduqodiri Qurbonzoda
2307692064 Remove String.format with non-null locale
Introducing new overloads with @SinceKotlin(1.4) annotation
and marking the old ones @LowPriorityInOverloadResolution breaks
all code that uses the format(locale, args) overload with
-api-version 1.3. Because the low priority of the non-1.4 version makes
format(args) preferable in all cases.
For example, "%02X".format(Locale.ROOT, 1) throws
IllegalFormatConversionException: x != java.util.Locale.
2020-04-24 18:00:37 +03:00
Anton Yalyshev
f356ff36b4 Update group id for refactoring fus collector in 201 bunch 2020-04-24 17:38:27 +03:00
Dmitry Gridin
1e69e89f41 update misc.xml 2020-04-24 21:12:14 +07:00
Nick
96238cbe1f [FIR] Support diagnostic QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE 2020-04-24 16:48:28 +03:00
Ilya Goncharov
7a928dfed2 [Gradle, JS] Build gradle node module with only package.json content 2020-04-24 16:32:54 +03:00
Ilya Goncharov
c64a80d132 [Gradle, JS] Move suppress gson null issue for particular fields
[Gradle, JS] Fix package json creation from existed package json w/o version

[Gradle, JS] Add task for publishing package json

[Gradle, JS] Add skip on empty npm dependencies

[Gradle, JS] Publishing package json with installed modules

[Gradle, JS] Add publishingPackageJson for compilation npm resolution

[Gradle, JS] Add publishingPackageJson to jar task

[Gradle, JS] PublishingPackageJsonTask now in jar

[Gradle, JS] Actual skipping of package json creation

[Gradle, JS] jar task depends only on main publishing package json

[Gradle, JS] Move calculation of packageJson

[Gradle, JS] Filter file dependencies
2020-04-24 16:32:54 +03:00
Dmitry Gridin
c91089be59 AddJvmNameAnnotationFix: fix case with top-level functions
#KT-17209 Fixed
2020-04-24 18:53:11 +07:00
Toshiaki Kameyama
f494b4ce11 Add 'Add JvmName annotation' quick fix for CONFLICTING_JVM_DECLARATIONS
#KT-17209
2020-04-24 18:53:10 +07:00
Dmitry Gridin
9bc51be287 i18n, MoveKotlinTopLevelDeclarationsDialog: replace RefactoringBundle with KotlinBundle 2020-04-24 17:10:22 +07:00
Dmitry Savvinov
b07f89864e Allow dependencies to see internals from main module as well
^KT-38338 Fixed
2020-04-24 12:54:39 +03:00
Sergey Igushkin
af09cb0e57 fix testLanguageSettingsApplied 2020-04-24 12:54:39 +03:00
Sergey Igushkin
60c49d26e3 Add Gradle integration tests running the IDE HMPP highlighting tests 2020-04-24 12:54:38 +03:00
Sergey Igushkin
4b0da0688a Fix expect discrimination with actual typealias in deserialization
* For types encountered during deserialization, search for a classifier,
  not necessarily a class, across module dependencies (i.e. accept type
  aliases, returned when actual type alias discriminates an expect
  class).

* When the referenced type is a type alias, expand it, so that when
  the descriptor is compared to the expansion in other places,
  they match.

* Also, when resolving an abbreviation, don't expand the type aliases,
  as there are assumptions in the code base that an abbreviation is a
  type alias.
2020-04-24 12:54:38 +03:00
Sergey Igushkin
d4a0844a77 Support additional module descriptor dependencies in klib descriptors 2020-04-24 12:54:37 +03:00
Sergey Igushkin
a9dd194383 Fix wrong assumption in getHostSpecificSourceSets (KMM-225)
The assumption that each source set is already registered in at least
one compilation would break Android targets which are configured later
on the execution path, and also fail when there are unused source sets.

Issue #KMM-225 Fixed
2020-04-24 12:54:37 +03:00
Sergey Igushkin
67f4b7e2b0 Add a dependency from all klib-originated modules to the main module
This is required, for instance, to properly resolve supertypes across
the modules.

Issue #KT-37832 Fixed
2020-04-24 12:54:36 +03:00
Vladimir Dolzhenko
8979b98fc0 Dropping components cleanup
#KT-38407 Fixed
2020-04-24 09:39:49 +00:00
Vladimir Dolzhenko
d2a26e9049 Fix memory leakage via Library in KotlinMavenImporter
Relates to #KT-38407
2020-04-24 09:39:48 +00:00
Vladimir Dolzhenko
4908d7a78c Convert KotlinImporterComponent into a module service
Relates to #KT-38407
2020-04-24 09:39:47 +00:00
Vladimir Dolzhenko
c2c8d81b49 Convert MavenImportListener into an application service
Relates to #KT-38407
2020-04-24 09:39:47 +00:00
Vladimir Dolzhenko
6e5b288500 Compatify maven.xml p.1
Relates to #KT-38407
2020-04-24 09:39:46 +00:00
Vladimir Dolzhenko
951215e606 Convert ScratchFileModuleInfoProvider into a startup activity
Relates to #KT-38407
2020-04-24 09:39:45 +00:00
Vladimir Dolzhenko
346cc40f44 Convert KotlinCompilerManager into a startup activity
Relates to #KT-38407
2020-04-24 09:39:45 +00:00
Vladimir Dolzhenko
4f99ac406a Kotlinify KotlinCompilerManager p.2
Relates to #KT-38407
2020-04-24 09:39:44 +00:00
Vladimir Dolzhenko
bbd4116b67 Kotlinify KotlinCompilerManager p.1
Relates to #KT-38407
2020-04-24 09:39:43 +00:00
Vladimir Dolzhenko
d3585f1d24 Convert JvmPluginStartupComponent into a startup activity
Relates to #KT-38407
2020-04-24 09:39:43 +00:00
Vladimir Dolzhenko
fa2fb667e6 Kotlinify JvmPluginStartupComponent p.2
Relates to #KT-38407
2020-04-24 09:39:42 +00:00
Vladimir Dolzhenko
fe3cf88e45 Kotlinify JvmPluginStartupComponent p.1
Relates to #KT-38407
2020-04-24 09:39:42 +00:00
Vladimir Dolzhenko
d6b4836ae0 Convert KlibLoadingMetadataCache into an application service
Relates to #KT-38407
2020-04-24 09:39:41 +00:00
Vladimir Dolzhenko
4535584f16 Convert KotlinUpdatePluginComponent into a startup activity
Relates to #KT-38407
2020-04-24 09:39:40 +00:00
Dmitry Gridin
60dc2f9674 i18n, MoveKotlinNestedClassesToUpperLevelDialog: add missing bundles for 201
#KT-38527 Fixed
2020-04-24 16:14:51 +07:00
Dmitry Gridin
6524e2b764 i18n, debugger: add missing bundles for 201
#KT-38487 Fixed
2020-04-24 16:13:44 +07:00
Matthew Gharrity
e0ca94279a Move vFile.isValid() check inside read action
Fixes KT-38541
2020-04-23 19:30:02 -04:00
Alexander Udalov
403cdedf2e Remove unnecessary dependencies of 'fir2ir:jvm-backend' 2020-04-23 23:16:30 +02:00
Alexander Udalov
2815bb88c2 Remove unnecessary dependency of 'fir2ir' on 'ir.backend.common'
Move some lookup utilities which are used in
`OperatorExpressionGenerator`, to 'ir.tree'.
2020-04-23 23:16:29 +02:00
Valentin Kipyatkov
0c3c8b64ce Optimization for faster search of references to top-level members 2020-04-23 22:12:26 +03:00
Valentin Kipyatkov
ec057a6c00 Minor change after review 2020-04-23 22:12:26 +03:00
Valentin Kipyatkov
56b20b0f31 Data Flow from Here: do not include named argument references 2020-04-23 22:12:25 +03:00
Valentin Kipyatkov
7c81d93db0 Data Flow to Here: process data-class copy-method calls 2020-04-23 22:12:25 +03:00
Natalia Selezneva
7f8b3b6a79 Minor: rename function 2020-04-23 20:14:03 +03:00
Natalia Selezneva
574f57e604 Minor: extract class to separate file 2020-04-23 20:14:02 +03:00
Natalia Selezneva
25dc8b7766 Minor: rename files 2020-04-23 20:14:02 +03:00
Natalia Selezneva
294df3a7e9 201: Implement floating notification update 2020-04-23 20:14:02 +03:00
Natalia Selezneva
2fba813a53 Rework the notification for scripts out of project
Add an option to link external gradle project
remove an option to load configuration manually because it cannot be implemented properly: script configurations for those scripts shouldn't be loaded during import for Gradle 6.0

^KT-37178 Fixed
2020-04-23 20:14:02 +03:00
Natalia Selezneva
85141b753b Show notification that gradle project is needed to be imported to get code insight for kotlin scripts 2020-04-23 20:14:01 +03:00
Natalia Selezneva
69d86a2972 Fix getting default sdk for scripts after refactoring 2020-04-23 20:14:01 +03:00
Sergey Rostov
73760effee Refactor GradleScriptingSupport to support multiple gradle projects linked to one idea project
For each externalGradleProject separate GradleScriptingSupport is created.
This allows to save script configurations by gradle projects

^KT-37806 Obsolete
^KT-35151 Fixed
2020-04-23 20:14:01 +03:00
Natalia Selezneva
34df3066b3 Fix messages for script configuration loading
Remove word "dependencies" from UI, use "configuration" instead
2020-04-23 20:14:01 +03:00
Natalia Selezneva
f3687dcd00 Extract utils methods for getting gradle project settings 2020-04-23 20:14:01 +03:00
Natalia Selezneva
f5f69ccc1b Fix getting gradle version for new project 2020-04-23 20:14:01 +03:00
Natalia Selezneva
3904e0f97c Fix indexing for force load configuration action 2020-04-23 20:14:00 +03:00
Natalia Selezneva
c52e5d180a Fix compilation for AS35 2020-04-23 20:14:00 +03:00
Natalia Selezneva
b472e915e6 Minor: rename files 2020-04-23 20:14:00 +03:00
Natalia Selezneva
217696fad5 Minor: rename class 2020-04-23 20:14:00 +03:00
Natalia Selezneva
3008010d73 Minor: extract class 2020-04-23 20:13:59 +03:00
Natalia Selezneva
59bdf67aa2 Refactoring: extract separate manager to update script configurations of gradle scripts
The main goal is to extract logic that is related to Gradle scripts only to separate place.
Configurations for gradle scripts are updated during import simultaneously, there is no need to manage script configuration update for one file
Note that for Gradle less than 6.0 The DefaultScriptingSupport is used
2020-04-23 20:13:59 +03:00
Natalia Selezneva
c6609e9a97 Temporary remove flacky assert from GradleKtsImportTest 2020-04-23 20:13:59 +03:00
Natalia Selezneva
da76fff83c Remove unused parts 2020-04-23 20:13:59 +03:00
Natalia Selezneva
7ecaf35647 Fix javaHome storing KotlinDslScriptModels 2020-04-23 20:13:58 +03:00
Natalia Selezneva
a35523b6d0 Implement global notification for configurations update of gradle scripts
For 193: it will be a simple notification at the bottom of the IDEA window
For 201: a floating notification in the editor is implemented near "Load Gradle Changes" icon
^KT-34443 Fixed
2020-04-23 20:13:58 +03:00
Natalia Selezneva
e300b30de1 Do not use hard coded string literals in UI 2020-04-23 20:13:58 +03:00
Natalia Selezneva
1b7f72020e GradleScriptListener should be applicable for all gradle scripts
Not only for those that are in project
Otherwise changes in those unrelated to gradle project script will affect up to date of other scripts
2020-04-23 20:13:58 +03:00
Natalia Selezneva
426c0c9ff0 201: Run partial import in IDEA 2020.1 to get script configurations
It only requests for KotlinDslScriptsModel
^KT-34481 Fixed
2020-04-23 20:13:58 +03:00
Natalia Selezneva
10aeead925 Run gradle import instead of usage of scripting API during configurations update
For Gradle 6.0 or higher
^KT-34481
2020-04-23 20:13:57 +03:00
Natalia Selezneva
97e5ff858d Add ability to postpone script configuration loading
Show notification for scripts with out of date configurations

^KT-35573
2020-04-23 20:13:57 +03:00
Natalia Selezneva
7f5715f5da 201: KotlinDslScriptsModel: use ProjectModelContributor to process models
Instead of populateProjectExtraModels in Resolver
2020-04-23 20:13:57 +03:00
Ilya Goncharov
9e4c1ee4e8 [Gradle, JS] Add explanation comment on compiler type in KotlinJsCompilerTypeHolder 2020-04-23 18:43:19 +03:00
Georgy Bronnikov
565874b3a0 Pass along type in IfNullExpressionFusionLowering 2020-04-23 18:18:34 +03:00
Ilya Goncharov
f95ff049c6 [Gradle, JS] Test check several ways to configure compiler type
#KT-38519 fixed
2020-04-23 18:09:59 +03:00
Ilya Goncharov
9a3bf54d9d [Gradle, JS] Add compiler type values on extension type
#KT-38519 fixed
2020-04-23 18:09:49 +03:00
Alexander Udalov
025d1ca64d psi2ir: rework representation of bound adapted function references
This fixes the problem in JVM IR backend which didn't pass bound
receiver value of an adapted function reference to the superclass
(kotlin/jvm/internal/AdaptedFunctionReference), which caused equals to
work incorrectly on such references (see changes in box tests).

Previously, bound adapted function reference was represented as
IrFunctionExpression to an adapter function which calls the callee. The
value of the bound receiver in that case could only be found in the body
of that adapter function. This is not very convenient, so this change
makes psi2ir produce a block of the adapter function + reference to it.
The bound receiver value is then found in the reference. This is
basically similar to what ProvisionalFunctionExpressionLowering is doing
for all function expressions. And since this IR structure is already
supported in FunctionReferenceLowering, the problem in the JVM IR is
fixed without any additional modifications.

However, inliners do not support this IR structure yet, see KT-38535 and
KT-38536.
2020-04-23 16:47:23 +02:00
Alexander Udalov
22bf23025a Minor, workaround IDE exception KT-38521 2020-04-23 16:46:32 +02:00
Konstantin Tskhovrebov
73a6dc6d1e Fix dependency for idea-fir module on 191 IDEA. 2020-04-23 17:22:59 +03:00
Ilya Goncharov
f87f32c5a8 [Gradle, JS] root package json must run after simple package jsons
KT-34832
2020-04-23 17:21:17 +03:00
Jinseong Jeon
39e1635c41 [FIR2IR] Pre-cache original function type parameters for fake overrides 2020-04-23 17:19:44 +03:00
Martin Petrov
bc96e42585 Produce deterministic klib files.
Build systems like bazel rely on the output of a compilation being
deterministic. File checksums determine when an artifact is safe to
cache across builds. One can produce a klib deterministically by using a
fixed timestamp during klib compression.

Before this change:

```
$ kotlinc-native  -produce library -output /tmp/first/color.klib Color.kt
$ kotlinc-native  -produce library -output /tmp/second/color.klib Color.kt
$ shasum  /tmp/first/color.klib /tmp/second/color.klib
bc3f73678ff025cfbec9009f9a851a8ca74e1037  /tmp/first/color.klib
65aa37886fbd53285f2e449a4dab6a2ad02732e6  /tmp/second/color.klib
```

After this change:

```
$ kotlinc-native  -produce library -output /tmp/first/color.klib Color.kt
$ kotlinc-native  -produce library -output /tmp/second/color.klib Color.kt
$ shasum  /tmp/first/color.klib /tmp/second/color.klib
fcba304493916ae34d372188991f87b60a113cf3  /tmp/first/color.klib
fcba304493916ae34d372188991f87b60a113cf3  /tmp/second/color.klib
```
2020-04-23 15:53:45 +03:00
Ilya Goncharov
923986d6a0 [Gradle, JS] Replace close on prepare
#KT-34832 fixed
2020-04-23 15:49:35 +03:00
Ilya Goncharov
7fa0faf48c [Gradle, JS] Fix registering yarn extension before node plugin
#KT-34832 fixed
2020-04-23 15:49:35 +03:00
Ilya Goncharov
bded8443f1 [Gradle, JS] Root package json must run after all package json
#KT-34832 fixed
2020-04-23 15:49:35 +03:00
Ilya Goncharov
b0efd1d7ce [Gradle, JS] Commonize root package json to prepared files for extensibility via other npm package managers
#KT-34832 fixed
#KT-35194 fixed
2020-04-23 15:49:33 +03:00
Ilya Goncharov
2f8649a337 [Gradle, JS] up-to-date check on npm install, not on root package.json
#KT-34832 fixed
2020-04-23 15:46:58 +03:00
Ilya Goncharov
742e27d7f5 [Gradle, JS] Rearrange
#KT-34832 fixed
2020-04-23 15:46:47 +03:00
Ilya Goncharov
e412224572 [Gradle, JS] Resolve -> install
#KT-34832 fixed
2020-04-23 15:46:36 +03:00
Ilya Goncharov
0af6454e44 [Gradle, JS] Add new state for npm resolution
#KT-34832 fixed
2020-04-23 15:46:25 +03:00
Ilya Goncharov
9174e184d3 [Gradle, JS] Rename Installed on prepared
#KT-34832 fixed
2020-04-23 15:46:13 +03:00
Ilya Goncharov
578a33767b [Gradle, JS] Npm resolution plugins work in resolve phase too
#KT-34832 fixed
2020-04-23 15:46:01 +03:00
Ilya Goncharov
910f60b731 [Gradle, JS] Not run task if root package.json doesn't exist
#KT-34832 fixed
2020-04-23 15:45:50 +03:00
Ilya Goncharov
86573c6dd1 [Gradle, JS] Divide creating root package and install tasks
#KT-34832 fixed
2020-04-23 15:45:34 +03:00
Alexey Trilis
3ad597ca5c Introduce MSE and EME APIs to Kotlin/JS stdlib
#KT-37910 Fixed
2020-04-23 15:35:04 +03:00
pyos
456469eb3b JVM: fix remapping of new T inside regenerated copies of T
In general, `InliningContext.findAnonymousTransformationInfo` was not
reliable because it mapped each type to *some* info for that type,
preferring ones with `shouldRegenerate == true` if those exist. Thus, it
returned incorrect results if one type was regenerated multiple times,
e.g. in a nested inlining context or because of a `finally` (which
duplicates anonymous objects). The solution is to avoid a global map and
attach the current transformation info directly to the current inlining
context.
2020-04-23 14:20:54 +02:00
Sinan Kozak
3f8ffb5ea7 KT-24750 Blank line after class header formatter should use user setting 2020-04-23 18:48:38 +07:00
Konstantin Tskhovrebov
e6f527f1d0 Update tests: disable tests run gutters for Object. 2020-04-23 14:16:22 +03:00
Mikhail Glukhikh
57b4a54766 [FIR] Calculate effective visibility inside anonymous object properly
#KT-38432 Fixed
2020-04-23 13:57:27 +03:00
Mikhail Glukhikh
bb73681b62 [FIR] Avoid integer literal types in lambda analysis
Partial fix of KT-38473
2020-04-23 13:46:40 +03:00
Mikhail Glukhikh
2805108061 [FIR2IR] Slightly refactor ConversionUtils 2020-04-23 13:44:13 +03:00
Mikhail Glukhikh
09f9e767ed [FIR2IR] Slightly refactor DataClassMembersGenerator 2020-04-23 13:44:13 +03:00
Jinseong Jeon
07add635eb FIR2IR: generate synthetic members for data class only if needed 2020-04-23 13:44:13 +03:00
Vladimir Ilmov
acced52384 (CoroutineDebugger) Tests added for no creation stack frame information 2020-04-23 11:36:15 +02:00
Vladimir Ilmov
57214aa453 (CoroutineDebugger) Exception if no creationStackTrace available
#KT-38484 Fixed
2020-04-23 11:36:15 +02:00
Ilya Chernikov
8616864e6b Revert "Drop unnecessary dependency from embeddable compiler to daemon"
The commit breaks gradle plugin, because it relies on this dependency.
This reverts commit 86d47b49
2020-04-23 11:21:27 +02:00
Mark Punzalan
b74652aa5b [FIR] Use ieee754equals for floating-point equality operations 2020-04-23 11:50:54 +03:00
Denis Zharkov
d66281d11f FIR: Fix test data for spec test after c4b7ac994b 2020-04-23 11:24:49 +03:00
Ilya Kirillov
1a90866ce1 FIR: handle member scope for anonymous objects
#KT-37120 fixed
2020-04-23 10:38:41 +03:00
Ilya Kirillov
fdfb544730 FIR: use Kotlin String constructors instead of java.lang ones
#KT-38437 fixed
2020-04-23 10:37:41 +03:00
Ilya Kirillov
9b943e3a5a FIR: fix Long primitive type JVM signature 2020-04-23 10:37:41 +03:00
nataliya.valtman
f9ebce331c remove execOperation for compiler workers 2020-04-23 07:59:57 +03:00
Abduqodiri Qurbonzoda
5af76a07d4 Fix CharArray sort in JS IR-backend 2020-04-22 23:46:50 +03:00
Ilya Chernikov
284d413603 Fix daemon test task name 2020-04-22 21:49:39 +02:00
Nikolay Krasko
b439dd62c5 Allow to force snapshot build 2020-04-22 21:19:35 +03:00
Vladimir Ilmov
9b0e37f627 (CoroutineDebugger) Minor issued fixed, log level adjusted for missing classes in JVM. 2020-04-22 17:44:11 +02:00
Mads Ager
eec3263518 [psi2ir] Properly link corresponding property symbols.
Do not rely on PatchDeclarationParents to do so.
2020-04-22 16:26:59 +02:00
Mads Ager
8bc360fa0c Properly link properties and their getter/setters.
This allows removing a hack in the MethodSignatureMapper.

When introducing non-getter methods that dispatch to a getter
we have to be careful to use the right name.

DeepCopyIrTreeWithSymbols should create the link between new
properties and their new getter/setter.
2020-04-22 16:26:59 +02:00
Ilya Goncharov
ac11bc6710 [Gradle, JS] Remove copypaste in js compiler argument
#KT-38485 fixed
2020-04-22 16:34:14 +03:00
Ilya Goncharov
8e282e8aad [Gradle, JS] Change byArgument on byArgumentOrNull
#KT-38485 fixed
2020-04-22 16:33:41 +03:00
Ilya Goncharov
47c27726b9 [Gradle, JS] Fix test
#KT-38485 fixed
2020-04-22 16:33:22 +03:00
Ilya Goncharov
c7f7f2bcbb [Gradle, JS] Add string sompiler setting in js plugin
#KT-38485 fixed
2020-04-22 16:33:03 +03:00
Ilya Chernikov
dfb8fea2c7 Fix project structure after moving daemon tests to separate project 2020-04-22 15:15:45 +02:00
Mikhail Zarechenskiy
0b227c1d66 Explicitly disable suspend-conversion while work in BE isn't ready 2020-04-22 16:10:45 +03:00
Mikhail Zarechenskiy
cb975bde7c Add test for questionable chained fun -> suspend conversion 2020-04-22 16:10:45 +03:00
Mikhail Zarechenskiy
ac642cf175 Support suspend conversion in callable reference adaptation
#KT-15917 In Progress
2020-04-22 16:10:45 +03:00
Mikhail Zarechenskiy
537a59d6ca Introduce basic suspend conversion in FE
#KT-15917 In Progress
2020-04-22 16:10:44 +03:00
Mikhail Zarechenskiy
9e04ebdace Minor: fix typo 2020-04-22 14:27:40 +03:00
Anton Bannykh
de25d13f1a JS: fix JsName renamer (KT-36484 fixed)
The following code was treated incorrectly:
```
function (_) {

  function foo() {
      try {} catch (_) {}
      try {} catch (_) {}
  }

  // _ is linked to the catch parameter here
}
```
2020-04-22 14:08:24 +03:00
Igor Yakovlev
7d917634d0 Remove object name and type in project view 2020-04-22 12:28:28 +03:00
Igor Yakovlev
72303fd2ad Fixed possible NPE in LightClasses
Fixed #EA-218014
2020-04-22 12:26:51 +03:00
Igor Yakovlev
8a7aac728d Fix invalid signature for UL method
Fixed #KT-32245
2020-04-22 12:26:51 +03:00
Igor Yakovlev
ed3ae785fb Fix invalid signature for generic UL method
Fixed #KT-38348
2020-04-22 12:26:51 +03:00
Ilya Muradyan
6f40ad7de2 Add test for not evaluated snippet 2020-04-22 11:07:32 +02:00
Ilya Muradyan
ea1a6fbee7 Add history consistency check 2020-04-22 11:07:32 +02:00
Ilya Muradyan
e5ca572b91 Forward diagnostics to the evaluation result 2020-04-22 11:07:32 +02:00
Natalia Selezneva
962a767e54 Set jvm target for scratch files
#KT-38455 fixed
2020-04-22 08:31:07 +02:00
Ilya Chernikov
b5be2abb1a Set jvm target for REPL from the context module
#KT-38454 fixed
2020-04-22 08:31:07 +02:00
Ilya Matveev
87159b5428 [Gradle] Use : as a separator for group and name in klib unique names 2020-04-22 10:50:28 +07:00
Ilya Matveev
0d9364c1dd [Gradle, native] Make tests tolerate to stacktrace format changes
The K/N compiler changed the way in which inline functions are shown
in stacktraces. When an exception is thrown from an inline function,
the stacktrace refers to a line in the body of the inline function
while in 1.3.7x it referred to a line when the inline function is called.

This patch gets rid of inline functions in the corresponding test
to make it independent on such changes in the stacktrace format.
2020-04-22 10:50:27 +07:00
Ilya Matveev
a3a6c3f0d5 [Gradle, native] Improve logging in CacheBuilder 2020-04-22 10:50:27 +07:00
Ilya Matveev
edf2b18f4f [Gradle, Native/JS] Specify FQ module name for klibs
By default, a unique name for a klibrary equals to a klib
file name. In the MPP plugin, the file name equals to a
Gradle project name. But the project name is not unique
enough. E.g. there is a situation when there are several projects
with the same simple name inside a single Gradle build. If
one of these projects depends on another, the compiler
will report a false cyclic dependency error.

This patch partially fixes this problem by specifying a custom
unique name for produced klibs based on project group and name.
We still can get a unique name clash in a case of equal groups
and project names. But in this case the cyclic dependency error
looks much more logical for user.

Also this patch specifies short names for native klibs to avoid
long declaration prefixes in framework headers.

Issue #KT-36721 Fixed
Issue #KT-38220 Fixed
2020-04-22 10:50:27 +07:00
Ilya Matveev
e4f4b4eef0 [JS IR] Support setting custom module name (= unique name)
Required for #KT-36721.
2020-04-22 10:50:26 +07:00
Ilya Matveev
d7558112ec Update K/N: 1.4-M3-dev-15378 2020-04-22 10:50:26 +07:00
Georgy Bronnikov
3bb32941a0 IR: bugfix in KotlinNothingValueExceptionLowering 2020-04-21 21:00:16 +03:00
Ilya Chernikov
1fb325d56e Fix generateTests task
adding TestMessageCollector that was moved with daemon tests back
2020-04-21 18:04:22 +02:00
Ilya Chernikov
ec64869d39 Extract daemon tests to separate module 2020-04-21 16:49:11 +02:00
Ilya Chernikov
86d47b496b Drop unnecessary dependency from embeddable compiler to daemon 2020-04-21 16:49:10 +02:00
Ilya Chernikov
c2eaa3d955 Fix ThreadDeath exception on stopping daemon thread
#KT-30086 fixed
2020-04-21 16:49:10 +02:00
Vladimir Ilmov
2bd6714e39 (CoroutineDebugger) Unneccesary log record removed. 2020-04-21 16:30:27 +02:00
Ilya Muradyan
887d6eb197 Fix writeIvyXml to be independent from system charset (#3319)
Co-authored-by: Ilya Muradyan <ilya.muradyan@jetbrains.com>
2020-04-21 15:58:55 +03:00
Sergey Bogolepov
0ed0152ee0 [Linker] Add option to control scope of DescriptorByIdSignatureFinder
Currently DescriptorByIdSignatureFinder performs lookup of descriptor
not only in the given module but also in its dependencies.
This behaviour is incorrect if we have some kind of
relation (e.g. mapping) between moduleDescriptor and found descriptor.
Thus, we add a handle to control search scope.
2020-04-21 19:09:07 +07:00
Dmitry Petrov
318d4d17ba KT-38337 Fix inline class value coercion in delegated members 2020-04-21 13:21:58 +03:00
Ilya Kirillov
29f19c78f2 Add missing fir-common dependency to kotlin plugin jar 2020-04-21 13:05:17 +03:00
Mikhail Bogdanov
d83a35d898 Minor. Update test data to support Corretto JVM 11 2020-04-21 12:03:02 +02:00
Vladimir Ilmov
38bfcc7ac6 (CoroutineDebugger) Unstable tests muted 2020-04-21 09:48:14 +02:00
Vladimir Ilmov
73f5e48518 (CoroutineDebugger) Minor fixes, kotlinx.coroutines version fix 2020-04-21 09:48:13 +02:00
Vladimir Ilmov
0ce8ca7bcd (CoroutineDebugger) negative frames removed from coroutine stack 2020-04-21 09:48:13 +02:00
Vladimir Ilmov
be2185ec01 (CoroutineDebugger) kotlinx.coroutines.core:1.3.5 support / dynamicProxy(interface) classes 2020-04-21 09:48:13 +02:00
Vladimir Ilmov
c018cf0ce5 (CoroutineDebugger) kotlinx.coroutines compatibility version fix 2020-04-21 09:48:12 +02:00
Vladimir Ilmov
c96d30a8ce (CoroutineDebugger) Added setting to disable coroutine agent 2020-04-21 09:48:12 +02:00
Vladimir Ilmov
68c6e9e2d6 (CoroutineDebugger) kotlinx-coroutines-core:1.3.5 support 2020-04-21 09:48:12 +02:00
Vladimir Ilmov
6f42ed7248 (CoroutineDebugger) PreflightFrame support in tests via CoroutineAsync 2020-04-21 09:48:11 +02:00
Vladimir Ilmov
276cf36d6b (CoroutineDebugger) Fixed CombinedContext information, default group renamed to empty dispatcher 2020-04-21 09:48:11 +02:00
Vladimir Ilmov
677ca2b9ae (CoroutineDebugger) unused classes removed / code cleanup 2020-04-21 09:48:11 +02:00
Vladimir Ilmov
3cd0eb0fca (CoroutineDebugger) Stack printing logic extracted to the single place
for DebugMetadata and CoroutinePanel, some corner cases fixed, test
cases added.
Added:
 - external maven dependencies in test scenarios
 - comparing stack traces + variables on breakpoint
2020-04-21 09:48:10 +02:00
Vladimir Ilmov
153056b4fd (CoroutineDebugger) Added check if agent is not available in target jvm 2020-04-21 09:48:10 +02:00
Vladimir Ilmov
38ec388429 (CoroutineDebugger) Group coroutines by dispatcher
Kotlin Script support added.

 #KT-37917 fixed
2020-04-21 09:48:09 +02:00
Denis Zharkov
7aa9b81604 FIR: Add analysis-tests/ReadMe.md 2020-04-21 10:16:45 +03:00
Denis Zharkov
64eeedd21a FIR: Minor. Add some minor fixes and clarifications to CallableId 2020-04-21 10:16:44 +03:00
Denis Zharkov
8aea75d8b9 FIR: Add spec tests to "Fast FIR" run configuration 2020-04-21 10:16:43 +03:00
Denis Zharkov
3bb6aa6f28 Mark as FIR_IDENTICAL passing spec tests 2020-04-21 10:16:42 +03:00
Denis Zharkov
82b2825b7a FIR: Ignore flaky spec tests
^KT-38340 Submitted
2020-04-21 10:16:41 +03:00
Denis Zharkov
b375e021e5 FIR: Ignore failing spec test
^KT-38397
2020-04-21 10:16:40 +03:00
Denis Zharkov
4c4f220fd0 FIR: Ignore failing spec tests
^KT-38336 Submitted
2020-04-21 10:16:39 +03:00
Denis Zharkov
c4d72d6906 FIR: Ignore failing spec test
^KT-38334 Submitted
2020-04-21 10:16:38 +03:00
Denis Zharkov
26f0b044fc FIR: Ignore failing spec test
^KT-38333 Submitted
2020-04-21 10:16:37 +03:00
Denis Zharkov
39d4231894 FIR: Adjust testData for spec tests: discrepancy in DEBUG_INFO_CALL format
In old FE, there are fake overrides rendered, while in FIR there are
real declarations
2020-04-21 10:16:36 +03:00
Denis Zharkov
bddea7d163 FIR: Adjust testData for spec tests: local scopes in overload resolution
The behavior of FIR seems to be the correct one

^KT-36475
2020-04-21 10:16:35 +03:00
Denis Zharkov
706ccb2cf9 FIR: Adjust testData for spec tests: invoke on nullable receiver
It's a design problem, see related issue

^KT-30415
2020-04-21 10:16:34 +03:00
Denis Zharkov
f0d35a2478 FIR: Adjust testData for spec tests: operator priority
^KT-38351 Submitted
2020-04-21 09:52:52 +03:00
Denis Zharkov
5c7c4b4cb6 FIR: Adjust testData for spec tests: infix priority
^KT-37374 Please, fix the tests
2020-04-21 09:52:52 +03:00
Denis Zharkov
54546eb890 FIR: Adjust testData for spec tests: unsupported DEBUG_INFO_CALL format 2020-04-21 09:52:52 +03:00
Denis Zharkov
f8791549f3 FIR: Adjust testData for spec tests: enum "values" priority
^KT-38350 Submitted
2020-04-21 09:52:52 +03:00
Denis Zharkov
2ced716268 FIR: Adjust testData for spec tests: controversial infix calls
^KT-37374 Please, take a look at these tests
2020-04-21 09:52:52 +03:00
Denis Zharkov
12ceaf24e2 FIR: Adjust testData for spec tests: resolution ambiguity
Renaming AMBIGUITY -> OVERLOAD_RESOLUTION_AMBIGUITY may help

^KT-38342 Submitted
2020-04-21 09:52:52 +03:00
Denis Zharkov
76bb45b46f FIR: Adjust testData for spec tests: other small things 2020-04-21 09:52:52 +03:00
Denis Zharkov
7c8e2724e1 FIR: Adjust testData for spec tests: type-system 2020-04-21 09:52:52 +03:00
Denis Zharkov
2f0f552880 FIR: Adjust testData for spec tests: annotations 2020-04-21 09:52:52 +03:00
Denis Zharkov
798fe9b7d1 FIR: Adjust testData for spec tests: statements 2020-04-21 09:52:52 +03:00
Denis Zharkov
0df6354896 FIR: Adjust testData for spec tests: conditional-expressions 2020-04-21 09:52:52 +03:00
Denis Zharkov
00bf1858cc FIR: Adjust testData for spec tests: declarations 2020-04-21 09:52:52 +03:00
Denis Zharkov
ee75347bb0 FIR: Adjust testData for spec tests: expressions 2020-04-21 09:52:52 +03:00
Denis Zharkov
06bae1e52f FIR: Adjust testData for spec tests: when-expression 2020-04-21 09:52:52 +03:00
Denis Zharkov
0d34299b7a FIR: Adjust testData for spec tests: dfa 2020-04-21 09:52:52 +03:00
Denis Zharkov
86e1aadd31 FIR: Adjust testData for spec tests: contracts 2020-04-21 09:52:52 +03:00
Denis Zharkov
243f9bb758 FIR: Adjust testData for spec tests: constant-literals 2020-04-21 09:52:52 +03:00
Denis Zharkov
04076ea748 Add FIR version of spec diagnostic tests 2020-04-21 09:52:52 +03:00
Denis Zharkov
3cb2b0cab1 Ignore irrelevant diagnostics in overload-set related spec tests 2020-04-21 09:52:52 +03:00
Denis Zharkov
0aed7375e6 Ignore irrelevant diagnostics in overload-set related spec tests 2020-04-21 09:52:52 +03:00
Denis Zharkov
26cb0ba144 Prepare spec tests for FIR version 2020-04-21 09:52:52 +03:00
Denis Zharkov
13efabc764 FIR: Add reflection JPS module of test-spec 2020-04-21 09:52:52 +03:00
Denis Zharkov
1d891561cf Fix spec tests metadata
It has been working fine on OS X with its case-independent FS
2020-04-21 09:52:52 +03:00
Denis Zharkov
9be2fc9b12 Sort excluded dirs in generated spec tests
To make the order more stable and platform-independent
2020-04-21 09:52:52 +03:00
Denis Zharkov
477e8bbcd4 FIR: Add test case for qualifier-based call resolution 2020-04-21 09:52:52 +03:00
Denis Zharkov
6fdbc38cf1 FIR: Fix label/receiver for lambda within infix calls
While this fix only changes label name, it's important for proper
lambda resolution because receiver is set for a lambda
only in presence of a label

This commit fixes a lot of checkType calls in diagnostic tests
2020-04-21 09:52:52 +03:00
Denis Zharkov
65e444a39c FIR: Properly support local functions in DEBUG_INFO_CALL 2020-04-21 09:48:03 +03:00
Denis Zharkov
fa3b3e7a9a FIR: Fix false positive INAPPLICABLE_INFIX_MODIFIER 2020-04-21 09:48:03 +03:00
Denis Zharkov
27b860682b FIR: Support DEBUG_INFO_EXPRESSION_TYPE 2020-04-21 09:48:03 +03:00
Denis Zharkov
6cd1ae9c82 Prepare AbstractFirOldFrontendDiagnosticsTest to RawFirBuilders failures 2020-04-21 09:48:03 +03:00
Denis Zharkov
7612f37c85 FIR: Prohibit calling singletons' constructors 2020-04-21 09:48:03 +03:00
Denis Zharkov
b62400124a FIR: Support DEBUG_INFO_CALL calls in tests 2020-04-21 09:48:03 +03:00
Dmitriy Dolovov
22dc837e26 IDE. Allow expect declarations in completion in shared native modules
Issue #KMM-218
2020-04-21 10:21:19 +07:00
Abduqodiri Qurbonzoda
d6472aa700 Reverse range and sortDescending range #KT-36955 2020-04-20 22:06:28 +03:00
Dmitry Petrov
05cb0e8994 KNVE: support in JVM_IR and JS_IR 2020-04-20 20:07:52 +03:00
Dmitry Petrov
b06780988d KNVE: add doc comment and mark as PublishedApi 2020-04-20 20:07:51 +03:00
Vyacheslav Gerasimov
8d06744a6a Set local build version to 1.4.255-SNAPSHOT
#KT-36128

(cherry picked from commit a8650ccfd2)
2020-04-20 18:48:00 +03:00
Mikhail Glukhikh
4b819aa028 Remove incorrect comment from old FE diagnostic test 2020-04-20 18:40:48 +03:00
Mikhail Glukhikh
790a517fa3 [FIR TEST] Add bad test data (submitted KT-38400) 2020-04-20 18:33:40 +03:00
Nick
c4b7ac994b [FIR] Support diagnostic ABSTRACT_SUPER_CALL 2020-04-20 18:33:40 +03:00
rapturemain
8960829c01 [FIR] Cast error on the element name instead of the whole body 2020-04-20 17:27:16 +03:00
Mikhail Glukhikh
4c639a840d [FIR] Apply bad test data (protected eff. visibility related, KT-38401) 2020-04-20 17:27:11 +03:00
rapturemain
6d63de01ac [FIR] Fix effective visibility calculation & relevant test data 2020-04-20 17:25:26 +03:00
rapturemain
d811f6f4a6 [FIR] Support for EXPOSED_PARAMETER_TYPE 2020-04-20 17:25:25 +03:00
rapturemain
216eea6a20 [FIR] Fix EXPOSED_RECEIVER_TYPE 2020-04-20 17:25:25 +03:00
rapturemain
2e8f73adba [FIR] Change errors location from Errors.java to FirErrors.kt 2020-04-20 17:25:25 +03:00
rapturemain
4e577caa99 [FIR] Support for EXPOSED_FUNCTION_RETURN_TYPE 2020-04-20 17:25:25 +03:00
rapturemain
0f16c88dd2 [FIR] Support for FIR_EXPOSED_RECEIVER_TYPE 2020-04-20 17:25:24 +03:00
rapturemain
15d4891c92 [FIR} Test data for EXPOSED_PROPERTY_TYPE 2020-04-20 17:25:24 +03:00
rapturemain
02c90c6576 [FIR] Support for EXPOSED_PROPERTY_TYPE 2020-04-20 17:25:24 +03:00
rapturemain
cc86767a23 [FIR] Support for EXPOSED_TYPEALIAS_EXPANDED_TYPE 2020-04-20 17:25:24 +03:00
Mikhail Glukhikh
42de83c21a FIR: fix lambda labeling in light tree builder 2020-04-20 17:05:39 +03:00
Mikhail Glukhikh
29114fe7b5 FIR: leave 'isSuspend' in functional & resolved type references only 2020-04-20 17:05:38 +03:00
Mikhail Glukhikh
96d8b0bea3 FIR: make KFunctionX derived from KFunction 2020-04-20 17:05:37 +03:00
Mikhail Glukhikh
4bb6410ce3 [FIR TEST] Temporary ignore overrideDefaultArgument test (KT-38416)
This test enters an infinite loop and can't finish
2020-04-20 17:05:35 +03:00
Mikhail Glukhikh
fe02c2bab3 FIR: return Unit from empty lambda 2020-04-20 17:05:34 +03:00
Mikhail Glukhikh
c5dea02074 FIR: handle suspend functions in SAM resolution properly 2020-04-20 17:05:33 +03:00
Mikhail Glukhikh
aada7bfe51 FIR: handle suspend functions in callable reference resolve properly 2020-04-20 17:05:31 +03:00
Jinseong Jeon
c26adf53dd FIR: resolve suspend lambda properly 2020-04-20 17:05:30 +03:00
Jinseong Jeon
88f81b9b71 FIR: record 'suspend' function modifier in type references 2020-04-20 17:05:28 +03:00
Ilya Kirillov
bf97391c51 Wizard: enable new wizard by default in registry key
It was forgotten in 0e199ae94c
2020-04-20 16:14:46 +03:00
Ilmir Usmanov
f13d31c7bd Cleanup process in LauncherScriptTest
Remove the hack.
2020-04-20 13:48:19 +02:00
Dmitry Gridin
2d64ded3c7 i18n: fix text in AbstractKotlinInlineDialog
#KT-37822 Fixed
2020-04-20 11:35:58 +00:00
Vladimir Dolzhenko
d8b4ff9eab Post KotlinNativeABICompatibilityChecker startup activity conversion clean up
Relates to #KT-38318
2020-04-20 10:29:23 +02:00
Vladimir Dolzhenko
3d4c5b0091 Fix NPE in LookupCancelService$Reminiscence
#EA-228125 Fixed
2020-04-20 08:16:25 +00:00
Vladimir Dolzhenko
061bc9af07 Avoid using containingKtFile in PerFileAnalysisCache
Relates to #EA-230153
2020-04-20 08:16:25 +00:00
Vladimir Dolzhenko
a53a12b68a Do not search TODOs in non KT and non physical files
#KT-37896 Fixed
#EA-230407 Fixed
2020-04-20 08:16:24 +00:00
Vladimir Dolzhenko
67fec903f6 Read file content under readAction in ToFromOriginalFileMapper
Relates to #EA-212072
2020-04-20 08:16:24 +00:00
Vladimir Dolzhenko
8ea7fc1d47 Add file content on analysis failure
Relates to #EA-222075
2020-04-20 08:16:23 +00:00
Vladimir Dolzhenko
7bbe1ba8c2 Improve error reporting on KotlinSliceUsage#copy
Relates to #EA-231211
2020-04-20 08:16:23 +00:00
Dmitry Gridin
3ad7e74ecb AbstractPerformanceTypingIndentationTest: fix compilation for 191 2020-04-20 15:12:11 +07:00
Pavel Kirpichenkov
b91cf13259 [NI] Fix expicit super receiver check
^KT-37497 Fixed
2020-04-20 10:56:13 +03:00
Ilya Muradyan
af147017b4 Fix REPL completion after "final" expressions
Final expressions here are literals, "closed" function calls,
expressions in brackets. Completion variants should not appear after
them if they are not followed by by dot (.) or double colon (::).

Note that identifiers are not considered as final expressions.
2020-04-20 08:55:29 +02:00
Mikhail Zarechenskiy
befa1e114c Add tests for obsolete issues
#KT-38092 Obsolete
 #KT-38179 Obsolete
 #KT-35105 Obsolete
 #KT-36696 Obsolete
 #KT-36947 Obsolete
 #KT-37337 Obsolete
 #KT-37309 Obsolete
 #KT-37727 Obsolete
 #KT-37735 Obsolete
 #KT-37853 Obsolete
 #KT-37920 Obsolete
 #KT-37709 Obsolete
 #KT-37706 Obsolete
2020-04-20 04:10:37 +03:00
Abduqodiri Qurbonzoda
57597f5900 Fix String.toHashSet tests 2020-04-20 04:08:29 +03:00
Abduqodiri Qurbonzoda
4d7597fa5a Document 'reduce' operation behavior on empty collections #KT-23322 2020-04-20 03:37:12 +03:00
Valentin Kipyatkov
0b66330d9f Fixed compilation 2020-04-20 01:05:53 +03:00
Ilya Matveev
5f53986f47 [klibs] Allow resolving klibs which names are not valid file names 2020-04-19 19:08:43 +07:00
Abduqodiri Qurbonzoda
3a99b3d5a4 Small refactoring to use Family.CodeExtension.size when appropriate 2020-04-19 07:59:09 +03:00
Abduqodiri Qurbonzoda
0d5ec27ac4 toHashSet is suboptimal for inputs with a lot of duplicates #KT-23142 2020-04-19 07:58:49 +03:00
Georgy Bronnikov
2c4fcebfec IR: handle adapted bound references 2020-04-18 20:31:57 +03:00
Vladimir Dolzhenko
1827465f48 Convert KotlinNativeABICompatibilityChecker into a startup activity
Relates to #KT-38318
2020-04-18 11:39:53 +02:00
Vladimir Dolzhenko
6fe800eea0 Convert KotlinNativeABICompatibilityChecker into a startup activity
Relates to #KT-38318
2020-04-18 11:36:35 +02:00
Vladimir Dolzhenko
86a02c07f6 Fix KotlinNativeABICompatibilityChecker.getLibrariesToNotifyAbout freeze
Get rid of O(n^2) in copyProperties
make ModuleProductionSourceInfo.stableName lazy
add checkCanceled in loops in IdeaModelInfosCache

#KT-38318 Fixed
2020-04-18 11:36:21 +02:00
Alexey Tsvetkov
06275a201c JPS: remove outputs for additional dirty files for current iteration
JPS does not remove output files for files marked as dirty
for current iteration. This is a problem for adding complementary files
during JPS MPP IC.
If output files are not removed, the compiler might raise an error
for duplicated actual declarations.
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov
4ccec5218f Remove dirty output files when expanding IC scope early
Previously IC could go to the next iteration without removing
outputs for the files compiled during the last iteration.
For example, it could happen, when a multifile part is changed
(we add sources for other parts and recompile everything together).

In case of MPP it could lead to compile error, because
the compiler would see the same actual declarations from dirty sources
and dirty outputs from previous iteration (which should have been removed).
That behaviour did not raise an error before dc8240c24e
because actual declarations from binaries (e.g. compile classpath) were ignored.

    #KT-35957 Fixed
2020-04-18 06:05:44 +03:00
Alexey Tsvetkov
2442abadc3 Add test for KT-35957 2020-04-18 06:05:44 +03:00
Alexey Tsvetkov
876d6d209f Minor: move non-JPS MPP IC tests under incremental/mpp dir 2020-04-18 06:05:44 +03:00
Valentin Kipyatkov
e1ee75c864 Fix to avoid test flickering (SlicerNullnessGroupingTestGenerated.testInlineFunctionManyCalls()) 2020-04-18 01:25:05 +03:00
Valentin Kipyatkov
e6cfced54a Don't collect all usages at once 2020-04-18 01:25:05 +03:00
Valentin Kipyatkov
31a1b2ddd3 No BodyResolveMode.FULL in slicer 2020-04-18 01:25:05 +03:00
Valentin Kipyatkov
91a793d575 Slicer tree view: better highlighting range inside nodes and in the editor 2020-04-18 01:25:04 +03:00
Valentin Kipyatkov
64fec54c48 Slicer: underline element range in addition to bold font (better do it in IDEA code) 2020-04-18 01:25:04 +03:00
Valentin Kipyatkov
03126ba469 Container presentation in slicer tree: no type for properties and show accessor 2020-04-18 01:25:04 +03:00
Valentin Kipyatkov
2ee776a0d8 Container presentation in slicer tree: limit number of parameters shown by 2 2020-04-18 01:25:03 +03:00
Valentin Kipyatkov
3e5820e4c1 Slice tree: shorter container rendering for properties in primary constructor 2020-04-18 01:25:03 +03:00
Valentin Kipyatkov
23ead3c805 Added container text into slicer tests output 2020-04-18 01:25:03 +03:00
Valentin Kipyatkov
2d2d9337ca Do not include line numbers from librarys source into test output otherwise it will change to often when upgrading libs 2020-04-18 01:25:02 +03:00
Valentin Kipyatkov
d6e8cdebfb Fixing compilation in bunch 201 2020-04-18 01:25:02 +03:00
Valentin Kipyatkov
411f2c833c Process inline functions from libraries (if sources available) + process source libraries if analysis scope includes them 2020-04-18 01:25:02 +03:00
Valentin Kipyatkov
06de3de1a6 Do not show doc-comment references in data flow 2020-04-18 01:25:01 +03:00
Valentin Kipyatkov
84a786dde3 Renames and test output format improvement 2020-04-18 01:25:01 +03:00
Valentin Kipyatkov
33082d8661 Added missing text in the tree rendering 2020-04-18 01:25:01 +03:00
Valentin Kipyatkov
63095f9ec9 Handling of method references 2020-04-18 01:25:00 +03:00
Valentin Kipyatkov
7dd30eb943 Support other kinds of variables for invoke receiver 2020-04-18 01:25:00 +03:00
Valentin Kipyatkov
5a7f74c250 Extracted method 2020-04-18 01:25:00 +03:00
Valentin Kipyatkov
8a1ea7b45e One more test 2020-04-18 01:24:59 +03:00
Valentin Kipyatkov
cc6090347a Handling other types of expressions as invoke receiver 2020-04-18 01:24:59 +03:00
Valentin Kipyatkov
bf79c3f279 Minor 2020-04-18 01:24:59 +03:00
Valentin Kipyatkov
9624f8afa3 Flaky test? 2020-04-18 01:24:59 +03:00
Valentin Kipyatkov
67021d23e2 Minor 2020-04-18 01:24:58 +03:00
Valentin Kipyatkov
f3b26e1c9a Correct detection of parameter index or receiver from invoke call 2020-04-18 01:24:58 +03:00
Valentin Kipyatkov
83ef8def4d Hacked SliceNullnessAnalyzerBase from IDEA to take into account SliceUsage.isLeaf() and give reasonable and stable results for Kotlin 2020-04-18 01:24:58 +03:00
Valentin Kipyatkov
e4d9801388 Process only correct implicit receivers 2020-04-18 01:24:58 +03:00
Valentin Kipyatkov
fdfae5260f Parameter to receiver 2020-04-18 01:24:57 +03:00
Valentin Kipyatkov
04d4f7444e Tracking of receiver for incoming lambda's for outflow analysis + better handling of invoke and operator calls 2020-04-18 01:24:57 +03:00
Valentin Kipyatkov
8f01427534 Tracking of incoming lambda's for outflow analysis 2020-04-18 01:24:57 +03:00
Valentin Kipyatkov
a09a9a65ff Special handling of inline function to track values from individual calls 2020-04-18 01:24:57 +03:00
Valentin Kipyatkov
269420a0e0 Processing implicit extension receiver usages in outflow processing 2020-04-18 01:24:56 +03:00
Valentin Kipyatkov
5040d37e2f Code refactoring 2020-04-18 01:24:56 +03:00
Valentin Kipyatkov
6928700320 Moving declarations 2020-04-18 01:24:56 +03:00
Valentin Kipyatkov
52ff1c62dd Tracking of implicit receiver from enclosing lambda 2020-04-18 01:24:56 +03:00
Valentin Kipyatkov
4e88e2697c Replaced [LAMBDA OUT] in test data to [LAMBDA CALLS] which is less confusing 2020-04-18 01:24:55 +03:00
Valentin Kipyatkov
7bcd6619cf Tracking inflow of lambda receiver 2020-04-18 01:24:55 +03:00
Valentin Kipyatkov
61d4383cb9 Merged LambdaResultOutflowBehaviour and LambdaCallsBehaviour into one 2020-04-18 01:24:55 +03:00
Valentin Kipyatkov
1e39d4a63c Code refactoring + better handling of incoming data flow to java super methods 2020-04-18 01:24:55 +03:00
Valentin Kipyatkov
b5b0fd62a9 Track anonymous function parameters in inbound data flow analysis as well 2020-04-18 01:24:54 +03:00
Valentin Kipyatkov
f0d4d7bb86 Added correctness check of test data + fixed huge amount of incorrect code in test data 2020-04-18 01:24:54 +03:00
Valentin Kipyatkov
c19a16f1e0 Track lambda parameters in inbound data flow analysis 2020-04-18 01:24:54 +03:00
Valentin Kipyatkov
799b2d7291 Refactoring: abstraction of idea with "lambdaLevel" in slices 2020-04-18 01:24:54 +03:00
Valentin Kipyatkov
03e894f75d Use partial body resolve 2020-04-18 01:24:53 +03:00
Valentin Kipyatkov
86c98b0d62 Refactoring 2020-04-18 01:24:53 +03:00
Valentin Kipyatkov
b4b58d1d99 Handling implicit receivers in InflowSlicer 2020-04-18 01:24:53 +03:00
Valentin Kipyatkov
90188ef44f Data flow to/from here: supported expected/actual declarations and extension receivers 2020-04-18 01:24:52 +03:00
Valentin Kipyatkov
bfa3fb0589 Do not check scope for super declaration 2020-04-18 01:24:52 +03:00
Valentin Kipyatkov
179b59032a Do not create JavaSliceUsage directly 2020-04-18 01:24:52 +03:00
Valentin Kipyatkov
0b2aff4e70 KT-38003 works for Java implementations of extension method 2020-04-18 01:24:52 +03:00
Valentin Kipyatkov
84c9692332 KT-38003 works for Java implementations too 2020-04-18 01:24:51 +03:00
Valentin Kipyatkov
2b83e3721a KT-38003 "Analyze Data Flow from Here" should work on parameter of abstract method
#KT-38003 Fixed
2020-04-18 01:24:51 +03:00
Vladimir Dolzhenko
612629f3cb Fix compilation AbstractTypingIndentationTestBase for 191 2020-04-17 22:41:18 +02:00
Vladimir Dolzhenko
5531ec3d28 Fix compilation AbstractTypingIndentationTestBase for 191 2020-04-17 21:36:36 +02:00
Alexander Udalov
4d7d407e87 Update bootstrap to 1.4.0-dev-6123 2020-04-17 18:34:45 +02:00
Alexander Udalov
72c52d37ae Add some -X flags for compatibility to kotlin-reflect build
"-Xno-kotlin-nothing-value-exception" is needed to temporarily prevent
the problem happening in the composite build with Kotlin/Native
(ClassNotFoundException from KClassImpl.Data).
"-Xno-optimized-callable-references" is added just in case of any
similar problem.
2020-04-17 18:34:45 +02:00
Dmitriy Dolovov
a6064ecda6 [Commonizer] Generate correct TA types for callable descriptors
Issue #KMM-217
2020-04-17 23:08:01 +07:00
Ilya Matveev
2938b69ff5 [Gradle, native] Disable platform libraries generation by default
Since there are a lot of changes around klibs in 1.4-M2, it was
decided to postpone enabling user-side platform libraries generation
by default. This patch switches the default distribution type to
prebuilt.

It also slightly refactors the code allowing user to choose the
distribution type. Now, there are only two distribution types
available:

- prebuilt - the default type, contains prebuilt platform libs.
             A distribution archive has the "-prebuilt-" classifier.
- light    - doesn't contain platform libs in an archive and
             generates them at the user side. The archive has no
             classifier to avoid changes in the K/N build logic and
             TC configurations.

The same types are also available for 1.3 but with sightly different
convention:

- prebuilt - the default type, contains prebuilt platform libs.
             A distribution archive has no classifier.
- light    - aka "restricted" distribution, doesn't contain
             platform libs for Apple platforms. The archive has
             the "-restricted-" suffix. Doesn't have a facility
             to build the libraries at the user side.

Issue #KT-38174 Fixed
2020-04-17 20:07:00 +07:00
Ilya Matveev
7ee4f4853d [Gradle, native] Rename native distribution kind: regular -> light 2020-04-17 20:06:42 +07:00
Ilya Kirillov
9c156c1a93 Wizard: run Gradle wrapper task in background
#KT-38225 fixed
2020-04-17 15:12:15 +03:00
Ilya Kirillov
c734069cde New J2K: do not show inline dialog during J2K
#KT-35169 fixed
2020-04-17 15:08:52 +03:00
Ilya Kirillov
e4a721d03e New J2K: do not create erroneous conversion from Java accessors to property
#KT-38004 fixed
2020-04-17 15:08:51 +03:00
Ilya Chernikov
d1a59e8da6 Fix js repl tests compilation 2020-04-17 13:38:51 +02:00
Dmitriy Novozhilov
f489e4044f [FIR-TEST] Update testdata after removal bodies of synthetic data class funs 2020-04-17 13:22:19 +03:00
Jinseong Jeon
9f1ecadd65 IR: more consolidation of synthetic member generation for data class. 2020-04-17 12:38:38 +03:00
Dmitriy Novozhilov
7f02d57d88 [FIR] Correctly detect super type in delegated constructor call 2020-04-17 12:37:29 +03:00
Dmitriy Novozhilov
adfd478361 [FIR] Hold all containers in body resolve context, not only last one 2020-04-17 12:37:29 +03:00
Dmitriy Novozhilov
a446aa2266 [FIR] Set implicit type for delegated constructor calls in fir builder 2020-04-17 12:37:28 +03:00
Dmitriy Novozhilov
276754260a [FIR] Add replaceCalleeReference to all FirResolvable
Also improve tree generator: now it generates abstract overrides
  for `replace` functions and correctly generates replace for fields
  with overriden type
2020-04-17 12:37:28 +03:00
Dmitriy Novozhilov
fa1e5f9593 [FIR] Add transformations for delegated constructor call 2020-04-17 12:37:28 +03:00
Dmitry Gridin
30ac024011 Regenerate IntentionTestGenerated 2020-04-17 15:14:26 +07:00
Dmitry Gridin
97a8bde64d Convert AbstractTypingIndentationTestBase to Kotlin 2020-04-17 15:14:26 +07:00
Dmitry Gridin
cbd5d29457 Add performance tests for typing indentation 2020-04-17 15:14:25 +07:00
Ilya Muradyan
400ea13f07 Fix scripting REPL completion after literals 2020-04-17 09:37:35 +02:00
Ilya Muradyan
d2fec96f38 Add new REPL API JVM implementation 2020-04-16 21:16:08 +02:00
Ilya Muradyan
4c2c44b106 Add new REPL API 2020-04-16 21:16:08 +02:00
Ilya Muradyan
b240fce224 Add incompleteCode diagnostic type 2020-04-16 21:16:08 +02:00
Ilya Muradyan
af251cafa4 Add info about the end of range in scripting REPL compiler messages 2020-04-16 21:16:08 +02:00
Ilya Muradyan
a70a128d9e Fix typo in property name 2020-04-16 21:16:08 +02:00
Ilmir Usmanov
5ab55fbb57 Support -J<jvm-param> and "-Dname=value" in windows runner script
Otherwise, -J-ea has no effect on windows, which breaks assert tests.
Wrap parameters with delimeters in quotes.
 #KT-30211 Fixed
2020-04-16 21:11:50 +02:00
Dmitry Petrov
ec50b1c85e Add '-Xno-kotlin-nothing-value-exception' to compiler args in kotlin 2020-04-16 19:38:30 +03:00
Dmitry Petrov
ac5411c32e Command-line option disabling KotlinNothingValueException generation 2020-04-16 19:38:30 +03:00
simon.ogorodnik
3c4e691e62 [FIR] Fix getClassDeclaredCallableSymbols for constructors 2020-04-16 18:38:18 +03:00
Toshiaki Kameyama
eff57001dc Create secondary constructor: fill 'this()' arguments
#KT-11865 Fixed
2020-04-16 17:04:09 +02:00
Ilya Kirillov
e271015382 Minor: don't use deprecated HashSet class in KotlinChangeSignatureUsageProcessor 2020-04-16 15:43:15 +03:00
Ilya Kirillov
00a85f03ca Do not search for non Kotlin/Java usages in KotlinChangeSignatureUsageProcessor
It may break some other language plugins

#KT-37637 fixed
2020-04-16 15:41:41 +03:00
Ilya Kirillov
1535873c07 Do not try to lazy parse a block without opening bracket
It can consume the whole file in such case
which will result PsiBuilder going crazy

#KT-36191 fixed
2020-04-16 15:40:21 +03:00
LepilkinaElena
4f9364f997 Native specific frontend checker for @ThreadLocal (#3293) 2020-04-16 15:23:06 +03:00
Georgy Bronnikov
41a28bde5c JVM_IR: repair synthetic accessors to fields 2020-04-16 15:08:11 +03:00
Mikhail Bogdanov
461c368ee0 Minor. Unmute test 2020-04-16 13:49:48 +02:00
Nicolay Mitropolsky
d3f357ee47 Uast: KotlinUastReferencesTest falling in 193 fix 2020-04-16 14:14:29 +03:00
Igor Chevdar
6d86d6ccdc [box-tests] Turned on some tests on fun interfaces for JS & Native 2020-04-16 16:01:17 +05:00
Mikhail Zarechenskiy
4ffcbc0c2f [NI] Properly support UnsafeVariance annotation
#KT-38134 Fixed
 #KT-34433 Fixed
 #KT-31823 Fixed
2020-04-16 13:55:47 +03:00
Ilya Goncharov
1614c1b8a6 [Gradle, JS] Move TeamCity related classes to internal
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:50:35 +03:00
Ilya Goncharov
4a4ce98f24 [Gradle, JS] Make execHandle private
#KT-38109 fixed
2020-04-16 13:50:28 +03:00
Ilya Goncharov
75af8f958a [Gradle, JS] Remove redundant webpack plugin in karma
Because it is applied in webpack config too

#KT-38109 fixed
2020-04-16 13:50:17 +03:00
Ilya Goncharov
2e1735735a [Gradle, JS] Remove redundant spaces in stacktrace
#KT-38286 fixed
2020-04-16 13:50:00 +03:00
Ilya Goncharov
77d8864abd [Gradle, JS] Refactor check on error
#KT-38109 fixed
2020-04-16 13:49:46 +03:00
Ilya Goncharov
5969f1dd4d [Gradle, JS] LogType on Enum
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:49:32 +03:00
Ilya Goncharov
fa4003bac5 [Gradle, JS] Useful message on exception for webpack
#KT-38286 fixed
2020-04-16 13:49:21 +03:00
Ilya Goncharov
f8c44be865 [Gradle, JS] Config errors in webpack
#KT-38286 fixed
2020-04-16 13:49:07 +03:00
Ilya Goncharov
36525d6534 [Gradle, JS] Not all karma messages go through log appenders
#KT-38109 fixed
2020-04-16 13:48:54 +03:00
Ilya Goncharov
480a9c16fb [Gradle, JS] Stack trace processor
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:48:41 +03:00
Ilya Goncharov
3c033c168c [Gradle, JS] Beautiful log for webpack
#KT-38286 fixed
2020-04-16 13:48:30 +03:00
Ilya Goncharov
60dc423f17 [Gradle, JS] Don't debug twice
#KT-38109 fixed
2020-04-16 13:48:17 +03:00
Ilya Goncharov
61e9d13fbd [Gradle, JS] Save stack trace for nodejs errors
#KT-38109 fixed
2020-04-16 13:48:04 +03:00
Ilya Goncharov
fb638c24f0 [Gradle, JS] Debug non test output
#KT-38109 fixed
2020-04-16 13:47:50 +03:00
Ilya Goncharov
bd94387293 [Gradle, JS] Move common process message logic
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:47:38 +03:00
Ilya Goncharov
ee218e9855 [Gradle, JS] Less verbosity for karma parsing
#KT-38109 fixed
2020-04-16 13:47:26 +03:00
Ilya Goncharov
df41397a32 [Gradle, JS] Add cohesion for console method and message type
#KT-38286 fixed
2020-04-16 13:47:13 +03:00
Ilya Goncharov
567ebfb180 [Gradle, JS] Remove copypaste for webpack and karma parse log
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:46:58 +03:00
Ilya Goncharov
db41c65240 [Gradle, JS] Typed message for log type
#KT-38109 fixed
#KT-38286 fixed
2020-04-16 13:46:46 +03:00
Ilya Goncharov
dccf670849 [Gradle, JS] Simple message to message
#KT-38109 fixed
2020-04-16 13:46:18 +03:00
Ilya Goncharov
47d7424d4d [Gradle, JS] Fix formatting logic
#KT-38109 fixed
2020-04-16 13:46:01 +03:00
Ilya Goncharov
7347c44cb1 [Gradle, JS] Divide tc message type on stdout and stderr
#KT-38109 fixed
2020-04-16 13:45:43 +03:00
Ilya Goncharov
70f6ad7691 [Gradle, JS] All karma output to debug
#KT-38109 fixed
2020-04-16 13:45:24 +03:00
Ilya Goncharov
e1793c59be [Gradle, JS] Add custom log4js appender to KotlinKarma
#KT-38109 fixed
2020-04-16 13:44:02 +03:00
Ilya Goncharov
005ecc5f29 [Gradle, JS] Add TeamCity simple message log4js appender
#KT-38109 fixed
2020-04-16 13:39:19 +03:00
Ilya Goncharov
91a25417f5 [Gradle, JS] Add custom log4js appender for karma
#KT-38109 fixed
2020-04-16 13:38:56 +03:00
Ilya Goncharov
f0e033b97c [Gradle, JS] Process Karma messages to Gradle log
#KT-38109 fixed
2020-04-16 13:38:37 +03:00
Ilya Goncharov
0534773545 [Gradle, JS] Parse karma output to find problem with browser launch
#KT-38109 fixed
2020-04-16 13:37:09 +03:00
Toshiaki Kameyama
831fbba0c1 Redundant qualifier name: don't report for EnumClass.Companion
#KT-37181 Fixed
2020-04-16 10:48:06 +02:00
Toshiaki Kameyama
f747f8543e Redundant qualifier name: don't report for EnumClass.values/EnumClass.valueOf
#KT-34696 Fixed
2020-04-16 10:48:05 +02:00
Georgy Bronnikov
611c4fe052 JVM_IR: repair super calls to methods of Any 2020-04-16 10:53:48 +03:00
Toshiaki Kameyama
4d1b5b84f8 AddMissingClassKeywordIntention: use 'KotlinBundle.lazyMessage' 2020-04-16 09:19:48 +02:00
Dmitry Petrov
e2ee3d1d18 Unmute passing tests 2020-04-16 09:07:35 +03:00
Steven Schäfer
74791495d7 JVM IR: Box inline classes in covariant overrides (KT-30419) 2020-04-16 09:07:35 +03:00
Dmitry Gridin
52524235f7 i18n: add missing codestyle.name.kotlin property
#KT-38293 Fixed
2020-04-16 10:35:06 +07:00
Toshiaki Kameyama
77b6881032 Replace 'when' with 'if': do not suggest if 'when' is used as expression and it has no 'else' branch
#KT-35329 Fixed
2020-04-15 22:47:30 +02:00
Ilya Gorbunov
893021f22b Introduce runningFold and runningReduce operations
runningFold is a synonym for scan,
runningReduce replaces scanReduce.

#KT-38060
2020-04-15 23:28:07 +03:00
Toshiaki Kameyama
37277d71de Condition of 'if' expression is constant: remove else keyword if needed
#KT-34713 Fixed
2020-04-15 21:53:16 +02:00
Toshiaki Kameyama
1b0fac4a67 Add quick fix for PROPERTY_TYPE_MISMATCH_ON_OVERRIDE on constructor parameter
#KT-29934 Fixed
2020-04-15 21:32:29 +02:00
Toshiaki Kameyama
e2a7170b2f Fix false positive "Collection count can be converted to size" with Iterable
#KT-34677 Fixed
2020-04-15 18:38:37 +02:00
Mikhail Glukhikh
d906c814cf [FIR] Fix lookup tag creation for values() & valueOf() 2020-04-15 19:32:53 +03:00
Ilya Gorbunov
ea1e16e309 Delegate properties to property references
#KT-8658
2020-04-15 18:37:33 +03:00
Anton Bannykh
81798282b9 JS: support explicit SAM constructor invocation 2020-04-15 17:13:21 +03:00
Lilia
0ee32ea9c5 Added 1.3.71, 1.3.72 changelogs 2020-04-15 15:33:03 +02:00
Georgy Bronnikov
7ea4ac9e9a [FIR] Regenerate FIR tree 2020-04-15 16:26:44 +03:00
Mikhail Bogdanov
1de0fbfc3a Add delegation tests for new default modes 2020-04-15 15:25:03 +02:00
Mikhail Bogdanov
4822d1e2ae Enable d8 by default 2020-04-15 15:25:03 +02:00
Mikhail Bogdanov
dda2f53993 Support JVM 8 target on Android 2020-04-15 15:25:02 +02:00
Georgy Bronnikov
284533f72b IR: put resolution of unbound type parameter symbols behind a language version flag 2020-04-15 16:08:35 +03:00
Georgy Bronnikov
a1a2da3c0f Revert "IR: put resolution of unbound type parameter symbols behind a language version flag"
This reverts commit 9634e6fba3.
2020-04-15 15:58:44 +03:00
Toshiaki Kameyama
b4c62cdb52 Introduce "Add missing 'class' keyword" intention
#KT-14884 Fixed
2020-04-15 14:53:52 +02:00
Georgy Bronnikov
9634e6fba3 IR: put resolution of unbound type parameter symbols behind a language version flag 2020-04-15 15:51:20 +03:00
Kristoffer Andersen
7ec4c9990a [JVM] Improve debug step behavior around lambdas.
- Add tests to clarify problematic behavior
- Avoid line numbers on return instructions of lambdas without explicit returns
2020-04-15 14:33:49 +02:00
Steven Schäfer
fc7d667282 Psi2Ir: Bind unbound type parameters 2020-04-15 15:32:53 +03:00
Toshiaki Kameyama
8c4fdd1edd Unused import: do not report for 'invoke' function import that is used from same file
#KT-24281 Fixed
2020-04-15 14:00:41 +02:00
Toshiaki Kameyama
8aa120576b Add quick fix for TOPLEVEL_TYPEALIASES_ONLY 2020-04-15 13:28:37 +02:00
Dmitry Gridin
cd880c779b Remove DisplayPriority from KotlinLanguageCodeStyleSettingsProvider
#KT-38217
2020-04-15 17:10:16 +07:00
Yan Zhulanow
65e06c86cc Revert dist_root removed by mistake 2020-04-15 18:19:32 +09:00
Mikhail Bogdanov
10b9ff1066 Minor. Rollback test data change
There is inconsistent behaviour between JS and JVM in case of package presence
2020-04-15 11:04:01 +02:00
Juan Chen
a1e0e8b0e7 [FIR] Handle receiver types of extension methods when computing maximally specific types.
Test case (from testPrimitiveReceiver):

fun Short.foo() = 3
fun Int.foo() = 4

1::foo
2020-04-15 11:16:33 +03:00
Dmitriy Novozhilov
f7dc06a772 [FIR] Approximate integer constants in lhs of callable reference 2020-04-15 11:13:01 +03:00
Dmitriy Novozhilov
c71f9d9640 [FIR] Use argument mapping from resolved call for contract argument mapping 2020-04-15 11:13:01 +03:00
Dmitriy Novozhilov
5b660d2457 [FIR] Ignore FirStubStatement in visit/transform consistency test 2020-04-15 11:13:01 +03:00
Dmitriy Novozhilov
2e4183db7d [FIR-TEST] Update testdata of old FE contracts tests 2020-04-15 11:13:01 +03:00
Dmitriy Novozhilov
fea7872359 [FIR] Add contracts resolve for local classes 2020-04-15 11:13:01 +03:00
Dmitriy Novozhilov
cecbf53ee8 [FIR] Add processing of FirStubStatement to Fir2IrVisitor 2020-04-15 11:13:00 +03:00
Dmitriy Novozhilov
67c8030706 [FIR] Update resolve phase for all declaration in contracts stage 2020-04-15 11:13:00 +03:00
Dmitriy Novozhilov
d718b596bc [FIR] Add transform declaration and companion to regular class 2020-04-15 11:13:00 +03:00
Dmitriy Novozhilov
a01bbbb0a0 [FIR] Add processing conditional contracts on property accessors 2020-04-15 11:13:00 +03:00
Dmitriy Novozhilov
1074e4bf29 [FIR] Add contracts resolve for property accessors 2020-04-15 11:13:00 +03:00
Dmitriy Novozhilov
d808f3e4fb [FIR-TEST] Add tests for contracts resolve 2020-04-15 11:12:59 +03:00
Dmitriy Novozhilov
17c6122987 [FIR] Make STATUS resolve phase as required for body resolve 2020-04-15 11:12:59 +03:00
Dmitriy Novozhilov
452fb3e723 [FIR] Add stage for resolve contract desription 2020-04-15 11:12:59 +03:00
Dmitriy Novozhilov
9b903b5e13 [FIR] Process implicit receivers in calls with contract 2020-04-15 11:12:59 +03:00
Dmitriy Novozhilov
300c3c30fb [FIR] Fix erasing existing data flow statements 2020-04-15 11:12:59 +03:00
Dmitriy Novozhilov
3c33ee9c68 [FIR-TEST] Move existing contract tests to fromLibrary directory 2020-04-15 11:12:58 +03:00
Dmitriy Novozhilov
ba35c43fe9 [FIR] Add forgotten kind initialization in ConeConditionalEffectToFirVisitor 2020-04-15 11:12:58 +03:00
Dmitriy Novozhilov
cef6cd765c [FIR] Make ConeEffectDeclaration an abstract class 2020-04-15 11:12:58 +03:00
Dmitriy Novozhilov
258bc62bac [FIR] Replace deprecation on transformer adapters with opt in annotation 2020-04-15 11:12:57 +03:00
Dmitriy Novozhilov
eef9b87047 [FIR] List for unresolved effects to resolved contract node 2020-04-15 11:12:57 +03:00
Dmitriy Novozhilov
4e1bf5f1e2 [FIR] Add extracting contracts in raw fir builder and light tree builder 2020-04-15 11:12:57 +03:00
Dmitriy Novozhilov
25cee12421 [FIR] Add contracts to FIR renderer 2020-04-15 11:12:57 +03:00
Dmitriy Novozhilov
50627f2c83 [FIR] Add contract renderer 2020-04-15 11:12:57 +03:00
Dmitriy Novozhilov
a89e0123c7 [FIR] Add fir node for raw contract description 2020-04-15 11:12:56 +03:00
Dmitriy Novozhilov
ba272101f2 Check for ESReceiver for contracts with is check 2020-04-15 11:12:56 +03:00
Toshiaki Kameyama
9b3c3ae4ba "Replace 'invoke' with direct call" intention: do not add unnecessary parenthesis
#KT-37967 Fixed
2020-04-15 09:59:23 +02:00
Toshiaki Kameyama
2f29b38b19 "Replace 'invoke' with direct call" intention: fix false positive when function is not operator
#KT-37977 Fixed
2020-04-15 09:16:50 +02:00
Mikhail Zarechenskiy
e0da30fb13 Remove JavaResolverUtils.java as its usages were moved to core 2020-04-15 02:37:35 +03:00
Mikhail Zarechenskiy
9607739d30 Introduce synthetic scope for constructors of fun interfaces
#KT-37434 Fixed
2020-04-15 02:37:34 +03:00
Mikhail Zarechenskiy
e9e21caeaf Refactoring: move utils to create & initialize SAM constructors to core 2020-04-15 02:29:57 +03:00
Mikhail Zarechenskiy
04223f5711 Extract Java specific check from common method out
This is needed for further refactoring
2020-04-15 02:29:53 +03:00
Mikhail Zarechenskiy
cf90fe81ac Move Sam(TypeAlias)ConstructorDescriptor to core 2020-04-15 02:06:32 +03:00
Mikhail Zarechenskiy
54497d11ac Move SyntheticMemberDescriptor.kt to core
This is a first part of unification SAM constructors for all platforms
2020-04-15 02:06:32 +03:00
simon.ogorodnik
6d3dccab83 [FIR] Fix obsolete transforms & visit consistency 2020-04-14 20:05:47 +03:00
Nicolay Mitropolsky
738e2f813c Uast: expression type for assigning arrays (KT-34187) 2020-04-14 18:27:34 +03:00
Nicolay Mitropolsky
9674643254 Uast: support for UYieldExpression (KT-35574) 2020-04-14 18:27:34 +03:00
Dmitriy Dolovov
0a2429c6f6 Minor. Remove redundant import 2020-04-14 21:14:33 +07:00
Dmitriy Dolovov
c3e20bffd7 Fix launching Gradle import test from master
No need to depend on org.jetbrains.kotlin:kotlin-native-utils artifact.
It's already packed inside of kotlin-compiler.jar
2020-04-14 21:08:04 +07:00
Dmitriy Dolovov
c35420eaf6 Minor. Add comments 2020-04-14 21:07:59 +07:00
Dmitriy Dolovov
7be9a2ef17 HMPP. Avoid leaking platform-specific dependencies into common libraries
Issue #KMM-217
2020-04-14 21:07:54 +07:00
Dmitriy Dolovov
b67a48f220 HMPP. Rewrite LibraryDependenciesCache on using LibraryInfo/SdkInfo
... instead of pure IJ Library/SDK.
2020-04-14 21:07:49 +07:00
Dmitriy Dolovov
6d0e73191c HMPP: Fix detection of NativePlatform in CompositeResolverForModuleFactory 2020-04-14 21:07:44 +07:00
Dmitriy Dolovov
757d77600a HMPP: Evaluate exact TargetPlatform for each K/N KLIB library 2020-04-14 21:07:38 +07:00
Dmitriy Dolovov
90398fd087 Minor. Specify explicit property types 2020-04-14 21:07:33 +07:00
Dmitriy Dolovov
753ef971f9 HMPP: Fix serialization of TargetPlatform in tests 2020-04-14 21:07:27 +07:00
Dmitriy Dolovov
fee6a752e0 HMPP: Fix serialization of TargetPlatform in Kotlin facet 2020-04-14 21:07:22 +07:00
Dmitriy Dolovov
adc457548b Minor. Formatted 2020-04-14 21:07:16 +07:00
Dmitriy Dolovov
e3e1c2cb3b HMPP: Fix detection of PlatformDependentAnalyzerServices for TargetPlatform 2020-04-14 21:07:11 +07:00
Dmitriy Dolovov
76b0e7994b JVM, JS: Use faster checks in IdePlatformKind.supportsTargetPlatform() 2020-04-14 21:07:06 +07:00
Dmitriy Dolovov
0f60b5a71e HMPP: Avoid false positive detection of "common native" as "common" 2020-04-14 21:07:00 +07:00
Dmitriy Dolovov
b108b0f8c4 HMPP. Fix tests after parameterization of NativePlatform 2020-04-14 21:06:54 +07:00
Dmitriy Dolovov
8d2e999776 HMPP: Parameterize NativePlatform with KonanTarget 2020-04-14 21:06:48 +07:00
Dmitriy Dolovov
1b281d623b HMPP: Propagate K/N flavor into each imported K/N module 2020-04-14 21:06:42 +07:00
Dmitry Gridin
585177bcf7 Formatter: fix indent for multiline expression in string template
#KT-35359 Fixed
2020-04-14 13:54:12 +00:00
Dmitry Gridin
decbe99391 Merge KotlinCodeStyleSettingsProvider to KotlinLanguageCodeStyleSettingsProvider 2020-04-14 19:46:56 +07:00
Dmitry Gridin
d04f63b7ab Make settings searchable
#KT-31169 Fixed
#KT-38217 Fixed
2020-04-14 19:44:35 +07:00
Ilya Goncharov
fbac2f5ea3 [Gradle, JS] Make inputFileProperty optional 2020-04-14 15:42:29 +03:00
Ilya Chernikov
4ecedf2e3b Get rid of KTUsefulTestCase, improve stability of the tests 2020-04-14 14:15:11 +02:00
Mikhail Bogdanov
850681f5e3 Rollback JVM 8 target support on Android 2020-04-14 13:58:30 +02:00
Mikhail Bogdanov
dec93c8b49 Add ANDROID target 2020-04-14 13:53:22 +02:00
Mikhail Bogdanov
9d68db1668 Switch usages android build tools from 23.0.1 to 28.0.3 2020-04-14 13:53:22 +02:00
Mikhail Bogdanov
b0e72f90f1 Android tests: add reflect flavor 2020-04-14 13:53:22 +02:00
Mikhail Bogdanov
115cf4666e Get rid of CodegenTestCase from CodegenTestsOnAndroidGenerator superclass 2020-04-14 13:53:22 +02:00
Vladimir Dolzhenko
b0483a67c2 Perform tryLock-and-checkCanceled on waiting lock in LockBasedStorageManager
Relates to #KT-38012
2020-04-14 13:11:30 +02:00
Vladimir Dolzhenko
6fae29bcc0 Add more checkCanceled to PsiFacade.findClass
Relates to #KT-38012
2020-04-14 13:11:11 +02:00
Vladimir Ilmov
ed56aa3e0d NPE fix in StackFrameInterceptor 2020-04-14 11:16:58 +02:00
Jinseong Jeon
08b91da6db FIR: fix body generation for data class's copy method 2020-04-14 11:51:30 +03:00
Jinseong Jeon
948f9debdc FIR: refactor member generations for data class 2020-04-14 11:51:30 +03:00
Mark Punzalan
d4cbfcb79e [FIR] Promote numeric types during comparisons
Added support for comparing platform types. Extracted logic to convert
operator expressions to OperatorExpressionGenerator.
2020-04-14 11:51:30 +03:00
Roman Artemev
1d9967013b [JS IR IC] Mute failing test 2020-04-14 11:12:08 +03:00
Roman Artemev
766b8bf74b [KLIB MPP] Mute broken test
- To fix this test `ExpectActualTable` has to be refactored from usage
 of descriptors to IdSignature since Wrapped and Deserialized descriptors
 for the same declaration are not equal to each other.
2020-04-14 11:12:08 +03:00
Roman Artemev
cd931796bc [SERIALIZATION] Fix kotlinx.serialization plugin 2020-04-14 11:12:08 +03:00
Roman Artemev
a9788f9506 [KLIB] Create an abstract class for module deserializer
- Introduce Ir-based Functional interface factory
 - Switch from LazyIr to pure
 - Use kotlin library to access raw bytes
 - Link dirty files against IC cache and dependencies instead of LazyIr
 - Move `DescriptorByIdSignatureFinder` from K/N to common
 - Support inline-bodies only MODE
2020-04-14 11:12:08 +03:00
Roman Artemev
74132fbc03 [KLIB] Fix IO API
- Implement abstract IR raw data readers
 - Add file and memory based specializations of IR data readers
2020-04-14 11:12:07 +03:00
Roman Artemev
5385e0cf1c [IR] Un-private stub generator 2020-04-14 11:12:07 +03:00
Roman Artemev
db565ee238 [IR] Fix equals/hachCode for FileLocalSignature
It actually doesn't require checking container.
2020-04-14 11:12:07 +03:00
nataliya.valtman
ce2ae58ffb use gradle execOperation and set args in file 2020-04-13 23:05:26 +03:00
Igor Yakovlev
cfdcbe5b71 Remove local declarations from Project View model 2020-04-13 21:55:22 +03:00
Igor Yakovlev
0df54946d9 Add Project View and Navigation Bar enhancements
Add local declarations to Project View
Show Kotlin file members in navigation bar (Fixed #KT-36218)
Remove deprecated dependency
2020-04-13 21:55:22 +03:00
Igor Yakovlev
ca10c40e05 Remove anonymous declarations from Structure View 2020-04-13 21:55:22 +03:00
Igor Yakovlev
d4e043c3e8 Fix visibility and expect/actual icons of the PsiElements
Fixed #KT-32886
2020-04-13 21:55:21 +03:00
Igor Yakovlev
185b0be76c Add constructors icon to ProjectView 2020-04-13 21:55:21 +03:00
simon.ogorodnik
276c393141 [FIR] Support captured type parameters in java symbol provider 2020-04-13 20:26:19 +03:00
simon.ogorodnik
af27ca013b [FIR] Fix captured type parameters propagation in deserialization 2020-04-13 20:26:19 +03:00
simon.ogorodnik
356e42196c [FIR2IR] Fix inner class constructor receiver parameter type 2020-04-13 20:26:19 +03:00
simon.ogorodnik
0e21ac8ed2 [FIR] Apply BAD testData changes after type parameters support 2020-04-13 20:26:18 +03:00
simon.ogorodnik
132c8ee210 [FIR] Apply GOOD testData changes after type parameters support 2020-04-13 20:26:18 +03:00
simon.ogorodnik
797b58669b [FIR] Support captured type parameters in lightTree2fir 2020-04-13 20:26:17 +03:00
simon.ogorodnik
9db69c0b08 [FIR2IR] Fix type arguments in generated this receiver 2020-04-13 20:26:17 +03:00
simon.ogorodnik
861cc6ee20 [FIR] Fix default constructors in jvm mapped scope 2020-04-13 20:26:17 +03:00
simon.ogorodnik
21ede8b745 [FIR] Add test for inner class type parameter capturing 2020-04-13 20:26:17 +03:00
simon.ogorodnik
b72d0957e4 [FIR] Support captured type arguments of anonymous objects in resolve 2020-04-13 20:26:17 +03:00
simon.ogorodnik
2b114dd2b4 [FIR] Fix fake overrides callable id 2020-04-13 20:26:17 +03:00
simon.ogorodnik
c2ea0676e4 [FIR] Split functions & constructors processing 2020-04-13 20:26:17 +03:00
simon.ogorodnik
7a1ecabe0a [FIR2IR] Use deepest matching symbol on fake override calls 2020-04-13 20:26:16 +03:00
simon.ogorodnik
d55c6550bb [FIR] Add substitution to classifiers processing 2020-04-13 20:26:16 +03:00
simon.ogorodnik
cd4a7a25c3 [FIR] Match ordering of type arguments with type parameters 2020-04-13 20:26:16 +03:00
simon.ogorodnik
27537f71df [FIR] Use constructed class type parameters refs in java symbol provider 2020-04-13 20:26:16 +03:00
simon.ogorodnik
1d249ad279 [FIR] Use constructed class type parameters refs in deserialization 2020-04-13 20:26:16 +03:00
simon.ogorodnik
ec39cd3d31 [FIR] Use captured, constructed class type parameters in RawFirBuilder 2020-04-13 20:26:16 +03:00
simon.ogorodnik
f174893009 [FIR] Add kotlinx-collections-immutable to raw fir builders 2020-04-13 20:26:15 +03:00
simon.ogorodnik
49d361b6eb [FIR] Improve type-parameter rendering in html dump 2020-04-13 20:26:15 +03:00
simon.ogorodnik
cb00a4c136 [FIR] Update type parameter use-sites to use type parameter refs 2020-04-13 20:26:15 +03:00
simon.ogorodnik
7c56209cef [FIR] Introduce type parameter ref in generated tree 2020-04-13 20:26:15 +03:00
Nikolay Krasko
0f7a9c44b4 Minor: sort excluded files and dirs in conformance test 2020-04-13 19:50:59 +03:00
Nikolay Krasko
dbbb81c78d 201: Minor: remove author to fix conformance test 2020-04-13 19:50:59 +03:00
Igor Chevdar
626c94c54d [IR] Fixed bug with redundant creation of Ref<> in inline lambdas 2020-04-13 21:11:59 +05:00
Anton Yalyshev
c8fe842508 Add FUS collector for Migration tool 2020-04-13 18:21:03 +03:00
Sergey Rostov
fd9bec81cf JPS: provide SourcesPreprocessor extension point 2020-04-13 18:02:08 +03:00
Mikhail Glukhikh
b6cf08d097 [FIR2IR] Extract createIrSyntheticFunction/Parameter from data class gen 2020-04-13 17:30:06 +03:00
Mikhail Glukhikh
4f1caf24a1 [FIR2IR] Minor: eliminate warning about list under the hood 2020-04-13 17:30:05 +03:00
Mikhail Glukhikh
6827280521 [FIR2IR] Reuse declareThisReceiverParameter in DataClassMembersGenerator 2020-04-13 17:30:05 +03:00
Jinseong Jeon
c370b86141 IR: consolidate generation of synthetic members for data class 2020-04-13 17:30:05 +03:00
Mikhail Glukhikh
1500131eb0 [FIR2IR] Re-use applyCallArguments for IrDelegatedConstructorCall 2020-04-13 17:09:05 +03:00
Mikhail Glukhikh
1ba160b3de [FIR] Apply argument mapping to delegated constructor calls 2020-04-13 17:09:04 +03:00
Mikhail Glukhikh
734ddc0369 [FIR] Rename: selectCandidateFrom... -> selectDelegatingConstructorCall 2020-04-13 17:09:04 +03:00
Juan Chen
e954aea4cc [FIR2IR] Support argument reordering of constructor calls 2020-04-13 17:09:04 +03:00
Juan Chen
bae41ddf6d [FIR2IR] Introduce IrBlock for reordering arguments if needed 2020-04-13 17:09:03 +03:00
Ilya Chernikov
acc5633811 [NI] Fix inference of lambda with receiver when wrapped...
in when/if or another lambda.
#KT-37419 fixed
2020-04-13 14:50:49 +02:00
Vladimir Dolzhenko
6494a2d902 Invalidate ResolveElementCache on project roots change
#KT-38206 Fixed
#EA-221073 Fixed
2020-04-13 12:03:17 +00:00
Ilya Chernikov
1672ed687b Add more tests to the maven resolver lib 2020-04-13 13:49:34 +02:00
Ilya Chernikov
5deb759e78 Rewrite new scripting maven resolver directly to eclipse aether 2020-04-13 13:49:34 +02:00
Ilya Chernikov
195a90d333 Cleanup warnings in scripting code 2020-04-13 13:49:34 +02:00
Ilya Chernikov
d863dc04e6 Move compiler scripting tests to scripting plugin, remove unused funs
also remove some tests that are covered in the scripting-compiler
tests now.
Part of the cleanup to rewrite scripting to the new infrastructure.
2020-04-13 13:49:34 +02:00
Ilya Chernikov
cf387ffad1 Remove obsolete source-sections plugin 2020-04-13 13:49:33 +02:00
Ilya Chernikov
f84fd810f0 Simplify and fix classloaders handling on script evaluation
#KT-37558 fixed
2020-04-13 13:49:33 +02:00
Ilya Chernikov
138efda19f Refactor scripting - get rid of unused type parameter in CompiledScript 2020-04-13 13:49:33 +02:00
Ilya Chernikov
c64ba50655 Abstract script compiled module implementation used in saving/caching
removes classloading problem when main-kts is loaded from a CL
without scripting compiler.
Also relax dependencies collection on saving to a jar and hide redundant
logging.
Running main.kts script via a run configuration works now.
#KT-37765 fixed
2020-04-13 13:49:32 +02:00
Ilya Chernikov
278f77713d Fix default base classloader initialization for scripting hosts
also refactor runner functions
#KT-37823 fixed
2020-04-13 13:49:32 +02:00
Ilya Chernikov
15d76ae887 [minor] fix findCompiler logic in runner for debuggung 2020-04-13 13:49:32 +02:00
Ilya Chernikov
6a24268db1 Fix scripting discovery file recognition for directory dependencies 2020-04-13 13:49:32 +02:00
Georgy Bronnikov
9ccda31189 IR: deal with conflicting variances in computeSubstitutedSyntheticAccessor 2020-04-13 14:34:57 +03:00
Georgy Bronnikov
5700da2bae IR: type parameter context for return values in InsertImplicitCasts 2020-04-13 14:34:57 +03:00
Georgy Bronnikov
166b506f63 IR: only require all type parameter references to be local with new inference 2020-04-13 14:34:57 +03:00
Abduqodiri Qurbonzoda
08ff52bee4 Introduce StringBuilder.appendLine in stdlib-common #KT-37839 2020-04-13 14:27:53 +03:00
Roman Golyshev
d7667209b2 KT-37144 Respect quotes in package name during decompilation
- Odd package names (for example `try` in `arrow-core`) were pasted
as-is to the decompiled text
- Because of this, stub checks were failing, forcing completion to start
over and over again, as if something changed in the files
- See EA-5572315 for the error
- ^KT-37144 Fixed
2020-04-13 07:34:28 +00:00
Ilya Gorbunov
ec9c7c98cd Use stubs in reduced js-ir runtime instead of new throwable extensions
To avoid bringing a lot of API required for their full implementation
to reduced runtime.
2020-04-13 09:32:42 +03:00
Ilya Gorbunov
38b1e6beab Make Throwable.printStackTrace() common
#KT-38044
2020-04-13 09:32:42 +03:00
Ilya Gorbunov
408b441a71 Rename extension toStringWithTrace to stackTraceToString
#KT-37603
2020-04-13 09:32:42 +03:00
Ilya Gorbunov
4cc9909a70 Support Firefox stack format
It doesn't include the exception type and message.
2020-04-13 09:32:42 +03:00
Ilya Gorbunov
641f1a55cb Omit common stack frames in JS full stack trace
#KT-37603
2020-04-13 09:32:41 +03:00
Ilya Gorbunov
5fe8071d71 Prevent infinite recursion in case of circular suppressed chains
#KT-37603
2020-04-13 09:32:41 +03:00
Ilya Gorbunov
552bcdb31b Introduce Throwable.toStringWithTrace
#KT-37603
2020-04-13 09:32:41 +03:00
Ilya Gorbunov
7b7263c5bf Implement common Throwable.addSuppressed/suppressed extensions
Instead of `suppressed` Array we provide `suppressedExceptions` List

#KT-23737
2020-04-13 09:32:41 +03:00
Andrey Uskov
e8a54d6c75 Fix import of MPP projects in IDEA 2020.1 2020-04-13 09:19:56 +03:00
Ilya Kirillov
22a6cdcc16 Wizard: fix tests 2020-04-11 13:22:49 +03:00
Ilya Kirillov
679ad4ca67 Wizard: fix small ui problems 2020-04-11 13:22:48 +03:00
Ilya Kirillov
63e7520789 Wizard: place build system type components on multiple row when no space left 2020-04-11 13:22:47 +03:00
Ilya Kirillov
7ad7d28d97 Wizard: fix FUS collector for wizard 2020-04-11 13:22:46 +03:00
Ilya Kirillov
e395844567 Wizard: add logging for hyperlink handler 2020-04-11 13:22:45 +03:00
Ilya Kirillov
be6cd4de4a Wizard: allow creating module without unit test engine & create JPS projects without one by default 2020-04-11 13:22:45 +03:00
Ilya Kirillov
0e199ae94c Enable new experimental project wizard by default 2020-04-11 13:22:44 +03:00
Ilya Kirillov
e5cc244b36 Wizard: make build system type action dumb aware 2020-04-11 13:22:43 +03:00
Ilya Kirillov
e6a3caa267 Wizard: introduce gradle IR builder 2020-04-11 13:22:42 +03:00
Ilya Kirillov
aa3cdc09fc Wizard: update libraries versions
#KT-38124 fixed
2020-04-11 13:22:41 +03:00
Ilya Kirillov
7c011c48dd Wizard: move hardcoded versions to Versions.kt 2020-04-11 13:22:41 +03:00
Ilya Matveev
254a978a06 Gradle, native: Forbid parallel in-process compiler execution
After enabling the in-process compiler execution, we got several
reports related to the race condition that takes place during
system properties configuring (e.g. KT-37442, KT-37444, probably
KT-37362).

The right fix here is to get rid of using system properties at all.
But it requires changes in many places of the K/N compiler and such
a patch is not safe enough to include it into a bug-fix release. So
it's decided to forbid parallel in-process compiler execution in
1.3.71 and 1.4-M2.

Issue #KT-37565 Fixed
Issue #KT-37696 Fixed

Ported from:
1c1b637cc4
2128d3dfe7
2020-04-11 12:40:50 +07:00
Abduqodiri Qurbonzoda
f2c05bf82c IR: Move annotation @JsExport to common source set in stdlib #KT-35966 2020-04-11 04:03:57 +03:00
Abduqodiri Qurbonzoda
4a7b1b210a Add onEachIndexed similar to forEachIndexed #KT-37161 2020-04-11 03:47:47 +03:00
Natalia Selezneva
57d390bab0 Introduce new external listener to avoid failing loading dependencies during new projet creation 2020-04-10 17:50:51 +03:00
Natalia Selezneva
a07f455ae5 Fix unexpected loading for script configurations during branch switch 2020-04-10 16:47:49 +03:00
Vladimir Dolzhenko
936801d744 Fix 191 compilation due to changes in findReferences
Relates to #KT-37801
2020-04-10 14:50:58 +02:00
Dmitriy Dolovov
d7226f4952 KLIB. Promote KLIB ABI version 2020-04-10 19:38:05 +07:00
Dmitriy Dolovov
101442ad14 KLIB: Store native targets in manifest 2020-04-10 19:33:27 +07:00
Dmitriy Dolovov
1b06256650 KLIB: Add 'native_targets' manifest property 2020-04-10 19:33:19 +07:00
Mikhail Glukhikh
e1c78b31a6 [FIR2IR] Convert explicit receiver in advance 2020-04-10 14:49:27 +03:00
Konstantin Tskhovrebov
b815cb7e4a Lift up module platform check and add bunch for 191.
191 bunch uses directly PsiTreeUtil instead kotlin extension
because without it class loader's loads different classes in runtime
and ClassCastException happens.

Fix #KT-38149
2020-04-10 14:47:28 +03:00
Harry
27827cd364 New J2K: Convert Number.[type]Value() to Number.to[type]() (#2908)
New J2K: Convert Number.[type]Value() to Number.to[type]()
2020-04-10 14:25:49 +03:00
Dmitriy Dolovov
cdbc272aca IDE. Drop redundant test in GradleNativeLibrariesInIDENamingTest 2020-04-10 18:14:13 +07:00
Ilya Gorbunov
15319eb88e Implement in-place shuffle for arrays
Minor: reorder shuffle/shuffled extensions more consistently

#KT-25651 Fixed
2020-04-10 11:04:51 +03:00
Ilya Gorbunov
e58f1c8932 Introduce Sequence.shuffled
#KT-37751
2020-04-10 10:59:40 +03:00
Dmitry Petrov
f42d9eefa1 KT-30330 Support KotlinNothingValueException in JVM 2020-04-10 08:47:03 +03:00
Dmitry Petrov
9941c255b9 KT-30330 KotlinNothingValueException 2020-04-10 08:47:02 +03:00
Alexey Tsvetkov
6acf9385bd Add tests for lookup tracker with JS KLIB compiler 2020-04-10 05:35:45 +03:00
Alexey Tsvetkov
1c38466a22 Pass LookupTracker to deserialized scopes in JS KLIB compiler
Before this change, deserialized scopes were not tracking lookups properly,
because lookup tracker was not passed from compiler configuration correctly.
Because of that, lookups from dependencies were not tracked,
so multi-module IC was not working (chages were passed between modules,
but affected source files were not invalidated).
2020-04-10 05:35:45 +03:00
Alexey Tsvetkov
98f561bbed Add separate flag to control JS KLIB IC in Gradle 2020-04-10 05:35:45 +03:00
Ilya Gorbunov
fc9ac67980 Tune parameters of time-sensitive tests
Lessen CPU load on the main thread.
Remove fragile checks.
2020-04-10 01:38:46 +03:00
Ilya Kirillov
b049a55cca Wizard: remove redundant text from removing module dialog 2020-04-10 01:04:18 +03:00
Yaroslav Chernyshev
ebb225fa4e [Gradle, Native] Fix CocoaPods plugin regression related with Xcode build 2020-04-10 00:41:29 +03:00
Vladimir Dolzhenko
b51ae78b84 Do not resolve alias imported references on rename
#KT-38096 Fixed
2020-04-09 20:38:01 +00:00
Ilya Kirillov
ac0d34089a Wizard: add run configuration for Ktor server template 2020-04-09 23:11:40 +03:00
Ilya Kirillov
67f95c21da Wizard: fix missed setting in Ktor template
#KT-38120 fixed
2020-04-09 23:11:40 +03:00
Ilya Kirillov
4cfa2f95a7 Wizard: add m2 Gradle plugin repository for non-stable Kotlin versions
#KT-36136 fixed
2020-04-09 23:11:40 +03:00
Ilya Kirillov
367699a853 Wizard: fix js Gradle dsl
#KT-38121 fixed
2020-04-09 23:11:39 +03:00
Ilya Kirillov
4e91f1c607 Wizard: update Kotlin version for tests to dev one
Needed for support latest syntax of Gradle dsl for js
2020-04-09 23:11:39 +03:00
Ilya Kirillov
9badcae692 Wizard: move some hardcoded versions to constants 2020-04-09 23:11:39 +03:00
Vladimir Dolzhenko
3de9838a7d Specify search scope for nj2k ConvertGettersAndSettersToPropertyProcessing
Relates to #KT-37801
2020-04-09 18:00:04 +02:00
Mikhail Bogdanov
535fcbb534 Switch android test to common Android SDK dependency management
~
2020-04-09 17:04:42 +02:00
Mikhail Bogdanov
acb4d6cf63 Update android-sdk dependency management. Add Emulator 2020-04-09 17:04:41 +02:00
Nikolay Krasko
919a5e7cc7 Update to 201.6668.113 2020-04-09 17:52:48 +03:00
Alexander Udalov
e533545c29 Minor, ignore codegen test for JDK 6 2020-04-09 16:50:13 +02:00
Nicolay Mitropolsky
e815227196 Uast: resolve compiled annotation parameters (KT-34564) 2020-04-09 16:38:12 +03:00
Nicolay Mitropolsky
b1bd962464 Uast: kotlinInternalUastUtils.kt reordering to move internal functions to the top 2020-04-09 16:38:12 +03:00
Nicolay Mitropolsky
f5df64674f Uast: making local lambda resolve and methods multiresolve work via resolveToDeclaration and resolveToPsiMethod
also fixes KT-36275
2020-04-09 16:38:12 +03:00
Nicolay Mitropolsky
89863bd2a3 Uast: unifying resolve to two methods resolveToDeclaration and resolveToPsiMethod 2020-04-09 16:38:12 +03:00
Nicolay Mitropolsky
c3977d7336 Uast: replacing most usages of resolveCallToDeclaration with resolveToPsiMethod 2020-04-09 16:38:11 +03:00
Nicolay Mitropolsky
ab36e20b1b Uast: resolving local calls (KT-36275) 2020-04-09 16:38:11 +03:00
Nicolay Mitropolsky
6803b37d14 Uast: Making AbstractKotlinResolveEverythingTest test also UCallExpression
current test data is just frezing the current state which is probable incorrect
2020-04-09 16:38:11 +03:00
Leonid Startsev
63322b9891 Add explicitApiWarning() method
to enable warning state of explicit api mode in the same
way that strict state. (KT-36019)
2020-04-09 15:33:04 +03:00
Mikhail Glukhikh
c597e3e87f Unmute additional FIR black box tests after rebasing 2020-04-09 15:22:57 +03:00
Mikhail Glukhikh
cd5a4900e6 [FIR] Support dispatch & extension receiver in component calls 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh
a93c7a39e0 [FIR] Provide object [dispatch] && callable reference receivers properly 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh
00fedbf6b3 [FIR2IR] Distinguish 'parent' & 'thisReceiver' for fake overrides 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh
4543367c37 [FIR] Add type parameter mapping for substituted properties 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh
fcdbffde3f [FIR2IR] Support Java synthetic properties 2020-04-09 15:22:56 +03:00
Mikhail Glukhikh
8e3d22a104 [FIR2IR] Enable receiver existence assertion 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh
14731527ed [FIR] Don't store class functions in local scope 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh
19d0d42b9e Mute three failing FIR black box tests 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh
ac7d43f06e [FIR2IR] Don't generate fake overrides with error types 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh
932b03beb2 [FIR2IR] Don't generate fake overrides for another package privates 2020-04-09 15:22:55 +03:00
Mikhail Glukhikh
5c758af0a6 [FIR] Use ScopeSession from resolve transformer in FIR2IR 2020-04-09 15:22:55 +03:00
Ilmir Usmanov
f775ac8825 Move legacy assert tests to launcher
since they are broken on JDK 11: they change Field.modifiers, which is prohibited
since JDK 9, because this private field is not exported.
Thus, we need to split the test into two: one with assertions enabled and the other
one with them disabled. Also, we need to run them in separate processes, for them
not to interfere each other.
 #KT-27176 Fixed
2020-04-09 14:10:31 +02:00
Konstantin Tskhovrebov
7671de1b20 Disable test run line marker for object classes. 2020-04-09 14:44:35 +03:00
Alexander Udalov
7652117e3d Minor, ignore test on adapted function references for Android 2020-04-09 12:50:21 +02:00
Alexander Udalov
683489687e Fix NPE in KCallable.isAccessible for interfaces loaded by boot class loader
Class.getClassLoader returns null for classes loaded by the system class
loader (the one used to start the application). In this case we need to
use ClassLoader.getSystemClassLoader. We already have an extension
`safeClassLoader` specifically for this purpose in reflection.jvm, but
forgot to use it in d59f2bcc80.

 #KT-37707 Fixed
2020-04-09 12:35:28 +02:00
Mikhail Zarechenskiy
a7b959b88b Fix delegated property resolve with intermediate ID provideDelegate
#KT-37406 Fixed
2020-04-09 13:34:29 +03:00
Vladimir Dolzhenko
0262e9de2f Look up modules under modal progress in ChooseModulePanel
Relates to #KT-30541
#KT-38081 Fixed
2020-04-09 10:12:01 +00:00
Dmitry Gridin
91700c9d2c ReplacementPerformer: fix potential PIEAE 2020-04-09 17:04:08 +07:00
Valentin Kipyatkov
76a573921e Fixed Introduce Parameter broken by earlier changes in KotlinParameterInfo 2020-04-09 12:22:22 +03:00
Ilya Kirillov
c9509380c3 Wizard: fix NPE on Mac 2020-04-09 11:27:45 +03:00
Dmitry Gridin
9d8d881bff CallableUsageReplacementStrategy: support KtSuperTypeCallEntry
#KT-37849 Fixed
2020-04-09 15:19:36 +07:00
Dmitry Gridin
aec3c22497 ReplacementPerformer: implement ReplacementPerformer for KtSuperTypeCallEntry
#KT-37849
2020-04-09 15:19:35 +07:00
Ilya Matveev
cf157e3999 [IDE, native] Update mock K/N dist: fully qualified klib names 2020-04-09 13:07:45 +07:00
Ilya Matveev
12e4159525 [IDE, native] Update mock K/N dist: klib componentization
This patch actualizes an internal structure of mock klibs
used in IDE tests for the K/N support.
2020-04-09 13:07:44 +07:00
Ilya Matveev
02c4008690 [Gradle, native] Blacklist java.endorsed.dirs for all tools
System property java.endorsed.dirs is set by IDEA but not supported
since Java 9 preventing starting a JVM. This patch takes this into
account and blacklists this property for all K/N tools including
the commonizer.

See also:
https://youtrack.jetbrains.com/issue/IDEA-193219
https://youtrack.jetbrains.com/issue/KT-25887
2020-04-09 13:07:43 +07:00
Ilya Matveev
ba6ca67e4f [Commonizer] Support short library names 2020-04-09 13:07:43 +07:00
Ilya Matveev
7c0ab5a58e [K/N in IDE] Display short names of platform libs 2020-04-09 13:07:42 +07:00
Ilya Matveev
343e8c6f84 [KLIB] Add short_name to klib manifest
Fixes for KT-36720 and KT-36721 change a scheme that is used to generate
unique names for klibs: now we use "fully qualified" names that
include a group and a name of a library (e.g. org.jetbrains.kotlin.
native.posix).

But in some cases we still need short library names for Kotlin/Native.
For example to display platform libs in the IDE or to export some
symbols of a library to an ObjC framework.

This patch introduces a corresponding property to klib manifest.
2020-04-09 13:07:42 +07:00
Mikhail Bogdanov
6e1af0caee Minor. Update test data 2020-04-09 07:49:30 +02:00
Mikhail Bogdanov
7d54027f41 Minor. Rename new proto property, JvmFlags.getClassFlags method
Compiler requires this new flag to know where actual interface method body is generated to emit proper method calls
2020-04-09 07:37:33 +02:00
Mikhail Bogdanov
0ddef7e4e4 Add new options for '-Xjvm-default' 2020-04-09 07:37:33 +02:00
Mikhail Bogdanov
7876d821a9 Minor. Rename jvm default utility methods 2020-04-09 07:37:33 +02:00
Mikhail Bogdanov
261af10019 JVM.IR. Add assertions for JVM defaults checks 2020-04-09 07:37:33 +02:00
Mikhail Bogdanov
b787c8c011 Support jvm default methods in IR
Fix several bugs around DefaultImpls
2020-04-09 07:37:32 +02:00
Mikhael Bogdanov
e45a892499 Support mixed compilation of new default with non-default or @JvmDefault 2020-04-09 07:37:32 +02:00
Mikhail Bogdanov
a3f930d2e4 Support bridges in interfaces for default methods 2020-04-09 07:37:32 +02:00
Mikhail Bogdanov
93b915c77a Support accessors for private methods for default methods 2020-04-09 07:37:31 +02:00
Mikhail Bogdanov
7bcbae9826 Fix requirements 2020-04-09 07:37:31 +02:00
Mikhail Bogdanov
c11f38688e Deprecate @JvmDefault 2020-04-09 07:37:31 +02:00
Mikhael Bogdanov
ff8eac29a0 New flag in proto 2020-04-09 07:37:31 +02:00
Mikhael Bogdanov
0c0bd67a6b Add new tests 2020-04-09 07:37:30 +02:00
Mikhael Bogdanov
0570c05683 Rename hasJvmDefaultAnnotation method to isCompiledToJvmDefaultIfNoAbstract 2020-04-09 07:37:30 +02:00
Mikhael Bogdanov
bfd709290b Explicitly pass jvmDefaultMode 2020-04-09 07:37:30 +02:00
Dmitriy Dolovov
954ef7d7d6 Minor. Inline function call. Return back comments. 2020-04-09 09:46:51 +07:00
Dmitriy Dolovov
f4767f8d9d Gradle: Fix NPE when Native binary does not have a non-null runTaskName 2020-04-09 09:46:41 +07:00
Dmitriy Dolovov
503c06a965 Turn on Idea tooling debugging on IDE launch 2020-04-09 09:46:32 +07:00
Vladimir Dolzhenko
775d3b6e22 Use scope-aware findReferences in RenameKotlinPsiProcessor
#KT-37801 Fixed
2020-04-08 23:54:03 +02:00
Vladimir Dolzhenko
eb545ad0f2 Preparation for bunching RenameKotlin*Processor.kt
Relates to #KT-37801
2020-04-08 23:53:35 +02:00
Ilya Kirillov
2a21b18c1c Wizard: fix texts 2020-04-08 21:42:09 +03:00
Alexander Udalov
587cce4a23 Avoid asserts in CodegenAnnotatingVisitor.isAdaptedCallableReference
In light classes mode, binding context may not have all the information
and this can fail, as for example was happening in the test
`diagnostics/tests/regressions/ea76264.kt`.
2020-04-08 19:21:30 +02:00
Alexander Udalov
9f758b4f25 Support toString for AdaptedFunctionReference subclasses
Also make it serializable like other lambdas, suspend lambdas and normal
callable references.
2020-04-08 19:16:38 +02:00
Alexander Udalov
fa879e667f Add some tests on adapted references with varargs and reflection
Also rename "varargAndDefaults" test directory to "adaptedReferences"
2020-04-08 19:15:40 +02:00
Alexander Udalov
66995fe1a5 Fix condition in calculation of adapted function reference flags
This only affects flags which are passed to
kotlin.jvm.internal.AdaptedFunctionReference. The only way it could lead
to changes in behavior is if it affected equals/hashCode of adapted
references. But it doesn't seem possible to construct a test where two
_different_ adaptations exist for a function reference to a
vararg-taking function, both of which use some sort of 1.4 function
reference conversion. Hence, no new tests are added.
2020-04-08 19:15:39 +02:00
Alexander Udalov
0681231e99 Introduce AdaptedFunctionReference runtime class
It's used as a superclass for anonymous classes for adapted function
references. Its main feature is that it _doesn't_ inherit from KFunction
(as opposed to FunctionReference), as per the decision to postpone
reflection support for adapted function references in KT-36024.

 #KT-36024 Fixed
2020-04-08 19:15:38 +02:00
Dmitry Petrov
d1c5a42124 KT-36024 Generate adapted callable references as lambdas
Make sure both JVM and JVM_IR use the same information to determine
whether a callable reference requires argument adaptation.
2020-04-08 19:02:33 +02:00
Dmitry Petrov
ddf7f53118 Add more tests on inline class boxing in covariant overrides 2020-04-08 19:56:26 +03:00
Dmitry Petrov
9615b20e5d Box inline class return value in lambdas (including suspend lambdas) 2020-04-08 19:56:26 +03:00
Ilya Kirillov
59b72b3156 Fix 191 compilation of idea-new-project-wizard module 2020-04-08 19:22:35 +03:00
Ilya Goncharov
e2c2453043 [Gradle, JS] Add toStringLoader for imported
#KT-38055 fixed
2020-04-08 18:30:18 +03:00
Ilya Goncharov
f6891853e0 [Gradle, JS] Reorganize css settings with rules
#KT-38055 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
3957758541 [Gradle, JS] Upgrade at least version to 5.3
#KT-32721 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
bc0cfb67f6 [Gradle, JS] Css mode instead of boolean flag
#KT-32721 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
e9bc64e103 [Gradle, JS] Add test on css and migrate one test on groovy dsl
#KT-32721 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
6106a07282 [Gradle, JS] Css settings for karma
#KT-32721 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
d74c52f09a [Gradle, JS] Simplify css settings
#KT-32721 fixed
2020-04-08 18:30:17 +03:00
Ilya Goncharov
9b13c05f67 [Gradle, JS] Add css settings to config
#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
0f63e66b9f [Gradle, JS] Small fixes
#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
207666b99d [Gradle, JS] Add css settings to webpack
#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
74d95736e6 [Gradle, JS] Require source-map-loader with kotlin-source-map-loader
It is WA to download necessary dependencies for source-map-loader

#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
f308bfd75f [Gradle, JS] Use let for config instead of var
#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
f55998a015 [Gradle, JS] Update evaluate reporting
#KT-32721 fixed
2020-04-08 18:30:16 +03:00
Ilya Goncharov
dd320040cd [Gradle, JS] Progress reporter before custom config
#KT-32721 fixed
2020-04-08 18:30:15 +03:00
Ilya Kirillov
445ca97486 Wizard: rename project templates to their corresponding titles 2020-04-08 16:49:32 +03:00
Ilya Kirillov
588034e124 Wizard: add ability to open project wizard via hyperlink 2020-04-08 16:49:31 +03:00
Ilya Kirillov
91af859cb5 Wizard: do now allow project view occupy all space 2020-04-08 16:49:30 +03:00
Ilya Kirillov
80f09d66db Wizard: rework build system component 2020-04-08 16:49:29 +03:00
Ilya Kirillov
c1f40907db Wizard: fix layout & text problems 2020-04-08 16:49:27 +03:00
Ilya Kirillov
c313916044 Wizard: upgrade Gradle version to 6.3
#KT-37932 fixed
2020-04-08 16:49:26 +03:00
Ilya Kirillov
4db1934cfd Wizard: do not allow choosing build system if corresponding IJ plugin is disabled
#KT-38061 fixed
2020-04-08 16:49:25 +03:00
Ilya Kirillov
a6af27d852 Wizard: allow specifying Kotlin target version for JPS build system
#KT-37970 fixed
2020-04-08 16:49:24 +03:00
Ilya Kirillov
82a40e3394 Wizard: fix invalid repository when downloading jars for JPS
#KT-37956 fixed
2020-04-08 16:49:23 +03:00
Ilya Kirillov
5f917827b5 Wizard: update wizard directory & name on project creation
#KT-37974 fixed
2020-04-08 16:49:23 +03:00
Ilya Kirillov
8f8039ab4f Wizard: do not show wizard when creating new module
#KT-37973 fixed
2020-04-08 16:49:22 +03:00
Mikhail Glukhikh
1bab27c4c1 Add immutable collections to compiler dist (required for FIR) 2020-04-08 16:10:34 +03:00
Anton Yalyshev
db4b547c99 Fix spaces in FUS event_id and context, as it cause problems in whitelisting 2020-04-08 15:35:54 +03:00
Sergey Rostov
e82b8a1bdc buildSrc, kotlin-dsl plugin: suppress experimentalWarning
This warning is about https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin.

It appears after we are strating using our bootstrap plugin for buildSrc
 too. It is unlikely that new compiler will broke build scripts
 compilation for our project, so we can suppress it.
2020-04-08 15:15:16 +03:00
Toshiaki Kameyama
06bd620dd6 Replace with: do not remove annotation use-site targets 2020-04-08 19:09:53 +07:00
simon.ogorodnik
f573719cc1 [FIR] Fix missing receiver type if anonymous function without label 2020-04-08 14:56:17 +03:00
simon.ogorodnik
d2fd377605 [FIR] Add rendering of delegating constructor calls to html dump 2020-04-08 14:56:16 +03:00
Irene Dea
419d6d0015 [zipPlugin task] Remove deprecated calls and allow default destination path for empty pluginZipPath argument. (#3254)
Co-authored-by: Alanna Tempest <atem@fb.com>

Co-authored-by: Alanna Tempest <atem@fb.com>
2020-04-08 14:54:08 +03:00
Victor Turansky
5d34b156bf Gradle plugin publish plugin security update (#3246) 2020-04-08 14:52:03 +03:00
Victor Turansky
dbffe6d2be README Actualize IDEA instructions 2020-04-08 14:48:53 +03:00
Anton Bannykh
998218716d IR: make lateinit lowering traverse local classes 2020-04-08 14:44:25 +03:00
Dmitry Gridin
81bd8f8c31 TrailingCommaInspection: cleanup code 2020-04-08 18:39:59 +07:00
Leonid Startsev
60efab24ea Add @SerializableWith on objects too
to be able to retrieve them via getAssociatedObject and serializer<T>()
function. Now object itself is a SerializerFactory.
2020-04-08 14:12:01 +03:00
Leonid Startsev
d4fc6774f3 Support new 'typeParametersSerializers' function
from GeneratedSerializer
2020-04-08 14:12:01 +03:00
Leonid Startsev
ceb3cfbfd5 Remove update* calls 2020-04-08 14:12:01 +03:00
Leonid Startsev
add0b461ee Refactor calls to beginStructure
typeParams argument has been removed
2020-04-08 14:12:00 +03:00
pyos
0037d5a7c8 JVM: erase conditional suspension markers from inline-only functions
Otherwise, the generated bytecode is unnecessarily suboptimal in some
(arguably weird) cases.

In the JVM backend, this was an accidental regression in #3260, as I had
not noticed that effectively inline-only functions were handled by a
separate branch in FunctionCodegen. In JVM_IR, I'm pretty sure the
redundant markers have always been there as `isSuspensionPoint` in
ExpressionCodegen never checked for effectively-inline-only-ness.
2020-04-08 12:31:23 +02:00
Dmitriy Novozhilov
f6d9867fa4 Add benchmark for plusAssign desugaring
#KT-38101
2020-04-08 12:35:54 +03:00
Dmitry Petrov
0c21d63290 Box inline class return value in covariant override of suspend fun 2020-04-08 10:50:58 +03:00
Dmitriy Novozhilov
8a2b39d647 [FIR] Add checking receivers of callable references 2020-04-08 10:38:45 +03:00
Igor Chevdar
b54148a6f1 Added a test on lateinit var inside a local class 2020-04-08 10:33:14 +03:00
Mikhail Bogdanov
1772f20d48 Minor. Add smap test for multifile facade 2020-04-08 07:26:55 +02:00
pyos
9334327bbf JVM_IR: unmute two more tests fixed by #3106 2020-04-08 07:04:16 +02:00
pyos
b3e124ad66 Add a test where classes call inline functions from each other 2020-04-08 07:04:16 +02:00
pyos
9ed73439f8 JVM_IR: delay writes to the source map until generateMethod
`generateMethodNode` should not have any side effects for the output to
be stable under incremental compilation.
2020-04-08 07:04:16 +02:00
pyos
495cefe65d Dump bytecode in a test that shows the effect of recompiling inline funs 2020-04-08 07:04:16 +02:00
pyos
f765963056 Split JVM backend diagnostics test into IR and non-IR versions
The IR backend no longer generates redundant INLINE_CALL_CYCLEs.
2020-04-08 07:04:16 +02:00
pyos
82899e6243 JVM_IR: reuse MethodNodes for inline functions in same module
This fixes the weird cases when a class gets overwritten by an imperfect
copy, reduces the number of classes in the output if an inline function
contains an inline call that causes it to have regenerated anonymous
objects, and makes inlining of same module functions a bit faster in
general. On the other hand, this may increase memory footprint a bit
because classes cannot be flushed to the output jar, as the inliner
would not be able to locate classes for anonymous objects if they have
already been unloaded from memory.
2020-04-08 07:04:16 +02:00
Alexander Gorshenev
97be5617ca Renamed -Xklib-mpp to -Xexpect-actual-linker to reduce user confusion 2020-04-08 05:23:12 +03:00
Mikhail Zarechenskiy
86fd4da567 [UAST] Fix mapping types containing type aliases
#KT-27935 Fixed
2020-04-08 01:25:14 +03:00
Mikhail Zarechenskiy
73e1ddc505 Allow Result as a return type if one enabled inline classes explicitly
#KT-38042 Fixed
2020-04-08 01:25:13 +03:00
Valentin Kipyatkov
1ffdc11d31 Suggest signature refactoring also for members of expect class 2020-04-07 22:17:05 +03:00
Valentin Kipyatkov
a5dc2b5b2a Suggested change signature: do not ask to enter values for optional parameters
#KT-37797 Fixed
2020-04-07 22:17:05 +03:00
Valentin Kipyatkov
f4a245e12a Dropped hack in initialization of KotlinParameterInfo which is not needed anymore 2020-04-07 22:17:05 +03:00
Valentin Kipyatkov
4f19dd5fe1 Code refactoring 2020-04-07 22:17:05 +03:00
Valentin Kipyatkov
e49ca20d17 Code improvements 2020-04-07 22:17:05 +03:00
Valentin Kipyatkov
88cd129549 Fixed other parameter references broken in new parameter values in conventional Change Signature 2020-04-07 22:17:04 +03:00
Valentin Kipyatkov
0adfa0357a Converted all test method bodies into blocks - otherwise IDE is too slow 2020-04-07 22:17:04 +03:00
Valentin Kipyatkov
c76571413b Added test for new parameter value referencing another parameter 2020-04-07 22:17:04 +03:00
Svyatoslav Kuzmich
3ec13d5bd6 [JS IR BE] Support companion objects in external interfaces
These objects are referenced but value is not actually used.
Replace access to these references with null literals.
2020-04-07 21:19:14 +03:00
Svyatoslav Kuzmich
f4b94ccbc8 Update klib metadata version to 1.4.0 2020-04-07 21:19:14 +03:00
Vladimir Dolzhenko
aed4f9909d KotlinCopyPasteReferenceProcessor clean up
Relates to #KT-37971
2020-04-07 19:55:25 +02:00
Vladimir Dolzhenko
7327028052 KotlinCopyPasteReferenceProcessor clean up
Relates to #KT-37971
2020-04-07 19:52:00 +02:00
Kirill Shmakov
5460327c8d Fix tests for KT-38079 2020-04-07 20:49:54 +03:00
Kirill Shmakov
2b8b5af18b Adapt exception line numbering for file link (KT-38079)
#KT-38079 Fixed
2020-04-07 19:48:03 +03:00
Kevin Bierhoff
7448761dfd only stub default constructor when compiling against .java source files 2020-04-07 17:48:39 +02:00
Denis Zharkov
c83860187c FIR: Add abstract equals/hashCode to ConeKotlinType
Otherwise they are incosistent when being added to sets of constraints
during type inference
2020-04-07 17:54:55 +03:00
Denis Zharkov
65e90743df FIR: Fix hanging inference case with intersection types 2020-04-07 17:54:55 +03:00
Denis Zharkov
81d9cf76f2 FIR: Add java.io.Serializable as supertypes to built-in classes 2020-04-07 17:54:55 +03:00
Denis Zharkov
168c7f306f FIR: Fix ambiguity for invoke candidates on qualifier receiver 2020-04-07 17:54:55 +03:00
Denis Zharkov
4cd93a9fec FIR: Add test for discrepancy in call resolution for qualifiers with old FE
^KT-38031 Open
2020-04-07 17:54:55 +03:00
Mads Ager
03fb49bb38 [JVM_IR] Improve debugging behavior of inline functions
Specifically, this commit improves the stepping behavior of the IR
backend around functions with defaults.

  - Improved line numbers in the default handler itself for better
    stepping when inlined.

  - Improved source information on default arguments

  - Improved test coverage of stepping behavior in old and IR backends.

Improves the stepping behaviour around inline methods with default
arguments. In particular, we now accurately step through the
evaluation of default arguments, but do _not_ spuriously show the exit
from the $default handler.
2020-04-07 16:52:45 +02:00
pyos
516692008f JVM: add tests fixed by the last two commits
One was broken on JVM, the other on JVM_IR.
2020-04-07 15:42:41 +02:00
pyos
829343cf6f JVM: surround captured lambdas with conditional suspension markers 2020-04-07 15:42:41 +02:00
pyos
c650c9570f JVM: use conditional suspension point markers 2020-04-07 15:42:41 +02:00
simon.ogorodnik
42a48ef312 [FIR] Improve constraint errors rendering in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik
2c8a9bf437 [FIR] Fix nullability rendering for class like types in html dump 2020-04-07 16:24:59 +03:00
simon.ogorodnik
bd826f38bc [FIR] Fix specificity comparision for unsigned integers 2020-04-07 16:24:58 +03:00
simon.ogorodnik
851e2dbb68 [FIR] Implement equals & hashCode for candidates 2020-04-07 16:24:58 +03:00
simon.ogorodnik
7d3b2558f0 [FIR] Improve rendering for unsigned literals in html dump 2020-04-07 16:24:58 +03:00
Victor Turansky
79bec82430 KT-34770 JS. Configurable properties. Test 2020-04-07 16:15:02 +03:00
Victor Turansky
103fd093e1 KT-34770 JS. Configurable properties. IR 2020-04-07 16:14:21 +03:00
Victor Turansky
5652d2657d KT-34770 JS. Configurable properties. Old backend 2020-04-07 16:14:21 +03:00
Konstantin Tskhovrebov
608a669da1 Fix dependency for idea-fir module. 2020-04-07 16:09:02 +03:00
Konstantin Tskhovrebov
2f6099feb9 Add KotlinNativeRunConfigurationProducer. 2020-04-07 16:09:02 +03:00
Konstantin Tskhovrebov
f451506055 Disable all main run gutters for common module. 2020-04-07 16:09:02 +03:00
Konstantin Tskhovrebov
e1a88de314 Add native run tasks data to KotlinTarget. 2020-04-07 16:09:02 +03:00
Dmitry Petrov
dae8872aba KT-37779 Treat named value arguments in vararg as arguments with '*' 2020-04-07 15:40:43 +03:00
Jinseong Jeon
fa9d79392f [FIR] Handle lateinit local variable properly 2020-04-07 14:06:38 +03:00
Ilya Goncharov
33d4655053 [Gradle, JS] Fix for Gradle 5.4
#KT-38055 fixed
2020-04-07 13:59:37 +03:00
Ilya Goncharov
626e7d14ec [Gradle, JS] Fix once initialization of produceExecutable
#KT-38055 fixed
2020-04-07 13:59:37 +03:00
Ilya Goncharov
c3ee2c81ed Revert "[Gradle, JS] Remove hard test"
This reverts commit 50e6f6e0
2020-04-07 13:59:37 +03:00
Ilya Goncharov
57b99bbc0c [Gradle, JS] Allow to create another binaries.executable
#KT-KT-38055 fixed
2020-04-07 13:59:36 +03:00
Ilya Goncharov
6a02e257a0 [Gradle, JS] Make ir binaries as live data
#KT-38058 fixed
2020-04-07 13:59:36 +03:00
Victor Petukhov
6eb2875690 [FIR-TEST] Actualize test added in 661812b255 2020-04-07 13:51:36 +03:00
Igor Chevdar
ae906c163d [IR] Added possibility to customize inline functions resolver 2020-04-07 13:25:46 +03:00
Dmitry Gridin
b548c5bf93 RemoveRedundantQualifierNameInspection: add regression test
#KT-35898
2020-04-07 15:57:34 +07:00
Victor Petukhov
661812b255 NI: add test for KT-37628 2020-04-07 11:31:29 +03:00
Ilya Gorbunov
d115792d9a Move a couple ad-hoc properties to buildSrc/BuildPropertiesExt 2020-04-07 10:54:34 +03:00
Mikhail Bogdanov
f966ce2431 Minor. Updated used JDKs in test for different JDKs 2020-04-07 09:43:46 +02:00
Victor Turansky
4d219d1eed KT-31126 JS. Fix super constructor call. Test infra comment
Primary ordinary -> secondary external
2020-04-07 09:30:22 +03:00
Victor Turansky
be39151fad KT-31126 JS. Fix super constructor call. Tests
Primary ordinary -> secondary external
2020-04-07 09:30:22 +03:00
Victor Turansky
6859e87be1 KT-31126 JS. Fix super constructor call. Old backend
Primary ordinary -> secondary external
2020-04-07 09:30:22 +03:00
Konstantin Tskhovrebov
2726f7f5ed Fix Klib file check.
#KT-37876
2020-04-07 12:47:54 +07:00
Ilya Matveev
f7f7d237e0 [KLIB] Support unpacked klibs with dots in names in ToolingResolve 2020-04-07 12:47:54 +07:00
Abduqodiri Qurbonzoda
508d0edd6d Add the onEach extension function to the Array #KT-28290 2020-04-07 05:34:20 +03:00
Igor Yakovlev
8531c1e9a5 Fixed WordSelectionTest.testDocComment test data 2020-04-07 02:12:32 +03:00
Vyacheslav Gerasimov
1ab23abe93 Build: Write plugin version the same way CI does 2020-04-06 23:52:01 +03:00
Vladimir Dolzhenko
659378f806 Do not use synchronized for fetchAnalysisResultsForElement
Relates to #KT-37467
2020-04-06 19:25:52 +02:00
Dmitry Gridin
d4491af96f i18n: update bundles
#KT-37483
2020-04-06 23:17:45 +07:00
Dmitry Gridin
0e45c03211 i18n: update bundle for quickfixes
#KT-37483
2020-04-06 23:17:45 +07:00
Ilya Goncharov
b309ff2039 [Gradle, JS] Group sub target tasks with dis classifier group for legacy
#KT-38056 fixed
2020-04-06 18:56:46 +03:00
Ilya Goncharov
53a20017ec [Gradle, JS] Group sub target tasks with dis classifier group
#KT-38056 fixed
2020-04-06 18:55:41 +03:00
Ilya Goncharov
4b903088bf [Gradle, JS] Distribution directory not null
#KT-38051 fixed
2020-04-06 18:40:14 +03:00
Ilya Goncharov
cfa542f50b [Gradle, JS] Add outputs for distribution task
#KT-38051 fixed
2020-04-06 18:39:50 +03:00
Mikhail Glukhikh
565340667c Fix black box test data generation (IGNORE_BACKEND_FIR) 2020-04-06 18:25:04 +03:00
Dmitriy Dolovov
4c6bddf6be KLIB: Fix reading property lists in Properties.propertyList()
1. If property is absent, or contains empty string or a string consisting only of whitespace characters, Properties.propertyList() should always return empty List<String>.
2. If property starts or ends with whitespace characters, Properties.propertyList() should not include empty-string values for whitespace prefix or suffix.
2020-04-06 21:36:26 +07:00
Dmitry Gridin
9b25d1f47a TrailingCommaPostFormatProcessor: should reset user data after invocation
#KT-37870 Fixed
2020-04-06 14:12:46 +00:00
PetelimovaNadezhda
517de44d20 KT-35897: change type for enum constructor for visibility 2020-04-06 16:42:53 +03:00
Mikhail Glukhikh
32748ea741 [FIR] Change char constant rendering to prevent encoding inconsistencies 2020-04-06 16:41:58 +03:00
Mikhail Glukhikh
4cb4aae7ee [FIR2IR] Move backing field creation in Fir2IrDeclarationStorage 2020-04-06 16:41:58 +03:00
Juan Chen
882e6931d6 [FIR] Add backing fields to const properties during Fir2Ir translation 2020-04-06 16:41:57 +03:00
Jinseong Jeon
08ca6f5f99 [FIR2IR] Set @Metadata when declaring IR symbols 2020-04-06 16:41:57 +03:00
Florian Kistner
b7e270f1c1 Add listener for module descriptor invalidation 2020-04-06 14:01:06 +02:00
Vyacheslav Gerasimov
4bd2d08b32 Build: Keep writePluginVersion task until TeamCity usages removed 2020-04-06 14:06:16 +03:00
Vyacheslav Gerasimov
d88134069d Build: Move writing ide plugin version to the idea module 2020-04-06 14:06:16 +03:00
Vyacheslav Gerasimov
f3acb8dde2 Build: Upgrade gradle enterprise plugin to 3.2 2020-04-06 14:06:15 +03:00
Vyacheslav Gerasimov
bea3816292 Add JPS Generate All Tests with correct line separators as file
There is no way to pass \n programmatically with idea ext plugin
2020-04-06 14:06:15 +03:00
Vyacheslav Gerasimov
ca0f59dbc4 Use linux endings in generated tests 2020-04-06 14:06:15 +03:00
Mikhail Glukhikh
59dd57dcf7 Unmute working test from FirReferenceResolve group 2020-04-06 13:41:17 +03:00
Vladimir Dolzhenko
dd0bb9abf1 Do not resolve references pasted into the same origin
#KT-37993 Fixed
2020-04-06 09:53:24 +00:00
Dmitry Gridin
423a9dd70d i18n: make text from intention lazy
#KT-37483
2020-04-06 15:02:40 +07:00
Anton Yalyshev
f451cb93da Fix collectors name to match it to the whitelist 2020-04-05 20:53:21 +03:00
Anton Yalyshev
947e181b90 Remove refactorings logging as now it's done in the platform collector 2020-04-05 20:53:21 +03:00
Victor Turansky
aa12d4cd0c [Gradle, JS] Karma configuration. Remove launcher duplication 2020-04-05 07:56:08 +03:00
Vladimir Dolzhenko
e73a573885 Fetch analysis results if it is available
The general idea is to try to fetch a full analysis if it is existed in PerFileAnalysisCache instead of go to ResolveElementCache and do analysis there. Do not perform analysis if it is not in PerFileAnalysisCache.

#KT-37467 Fixed
2020-04-04 22:36:08 +02:00
Dmitry Gridin
3742fe4871 i18n: fix some tests
#KT-37483
2020-04-04 10:23:24 +07:00
Dmitry Gridin
dc51a268aa ReplaceWithAnnotationAnalyzer: should throw ControlFlowException 2020-04-04 10:08:45 +07:00
Dmitry Petrov
d5ace43614 KT-37986 Force boxing of inline class returned from function reference
KT-37998 Provide KotlinType for safe call
2020-04-04 01:32:45 +03:00
pyos
5ed845d0b4 JVM_IR: reuse same bodies for suspend funs and $$forInline versions 2020-04-03 19:51:45 +02:00
pyos
8945d5a0df JVM_IR: remove $$forInline checks from ExpressionCodegen 2020-04-03 19:51:45 +02:00
Dmitry Gridin
de1fa40c7e CodeInliner: fix KNPE
#KT-22733 Fixed
#KT-36225 Fixed
#EA-206694 Fixed
2020-04-04 00:46:15 +07:00
Ilya Goncharov
12379cb91c [Gradle, JS] Bump NPM versions
#KT-37988 fixed
2020-04-03 20:38:12 +03:00
Ilya Goncharov
187ab5f393 [Gradle, JS] KT-37984 Add additional Chrome and Firefox based browsers
#KT-37984 fixed
2020-04-03 20:37:20 +03:00
Ilya Goncharov
50e6f6e07e [Gradle, JS] Remove hard test 2020-04-03 19:50:13 +03:00
Ilya Gorbunov
8194652793 Allow placing Suppress on a type parameter
#KT-12448
2020-04-03 19:36:37 +03:00
Ilya Gorbunov
fcada0a5e3 Make use of contracts of time measurement functions 2020-04-03 19:36:36 +03:00
Nikolay Krasko
d71410bfb5 Update version of properties-maven-plugin to 1.0.0 2020-04-03 19:31:32 +03:00
Nikolay Krasko
b89a7325b2 Remove https://dl.bintray.com/kotlin/kotlin-eap repository from gradle tests 2020-04-03 19:31:31 +03:00
Nikolay Krasko
01e10324f0 Eliminate 1.3.60-eap-76 usages from tests 2020-04-03 19:31:31 +03:00
Dmitry Petrov
a422a12407 Minor: update testData
In BridgeTest::testFakeOverrideMisleadingImplementation,
order of generated bridges has changed slightly
(but the overall set of generated bridges remains the same).
2020-04-03 18:31:39 +03:00
Dmitry Gridin
7938a992dd i18n: make text from intention lazy
#KT-37483
2020-04-03 22:18:45 +07:00
Dmitry Gridin
25dfc6dd63 i18n: make text from intention lazy
#KT-37483
2020-04-03 22:06:00 +07:00
Roman Golyshev
d8ca21d728 Add KotlinContextFeatureProvider to the plugin.xml for 201 platform
- Without it we do not have `file_type` and `plugin_version` features in
the statistics from EAP builds
- See KT-36313
2020-04-03 17:33:30 +03:00
Mikhail Glukhikh
75283c74ac [FIR] Generate type arguments for variable assignments 2020-04-03 17:21:39 +03:00
Mikhail Glukhikh
d7460d47de [FIR] Generate dispatch & extension receivers for variable assignments 2020-04-03 17:21:21 +03:00
Alexander Udalov
774fc32f3e JVM IR: support optimized callable reference superclasses
See KT-27362.

 #KT-37334 Fixed
2020-04-03 15:37:56 +02:00
Alexander Udalov
bb1a12e28e JVM IR: use correct owner for callable references in optimized multifile classes
The owner should always be the facade class, because the part class is
package-private and will be inaccessible from other package.

Note that in the old backend, function references already do have the
facade as the owner correctly, but property references don't, this is
reported as KT-37972.
2020-04-03 15:37:56 +02:00
Alexander Udalov
78467792d5 JVM IR: rename CallableReferenceLowering -> FunctionReferenceLowering
Property references are handled by PropertyReferenceLowering.
2020-04-03 15:37:56 +02:00
Dmitriy Novozhilov
238488d4fb [FIR] Fix collection subgraphs to drop from delegate calls 2020-04-03 15:22:58 +03:00
Mikhail Glukhikh
b21da3910a [FIR] Set type arguments also in provideDelegate property reference 2020-04-03 13:42:06 +03:00
Mikhail Glukhikh
8bf4ec66a9 [FIR] Fix receiver type order in delegate property reference 2020-04-03 13:34:46 +03:00
Mikhail Glukhikh
f374c36cd2 [FIR2IR] Generate property extension receiver references properly 2020-04-03 13:31:15 +03:00
Mikhail Glukhikh
4234438d8d [FIR] Generate thisRef more correctly for extension property 2020-04-03 13:30:55 +03:00
Mikhail Glukhikh
f3f7bf70f6 [FIR] Set delegate field receiver properly 2020-04-03 13:29:55 +03:00
Mikhail Glukhikh
036b6c63f6 [FIR] During resolve, set correctly property reference type in delegate 2020-04-03 13:18:47 +03:00
Mikhail Glukhikh
58e00400f1 [FIR2IR] Support PROPERTY_REFERENCE_FROM_DELEGATE origin 2020-04-03 13:05:13 +03:00
Mikhail Glukhikh
5f8fadb220 [FIR2IR] Remove GET_PROPERTY origin from delegate field reads 2020-04-03 13:04:56 +03:00
Jinseong Jeon
94749855b9 FIR: fix visibility extension for fake override. 2020-04-03 13:03:50 +03:00
Leonid Startsev
0054c22ef2 Use correct return type for serializers
from runtime library.
If used unsubstituted, they cause
e: java.lang.IllegalArgumentException: Unbound type parameters are forbidden
because type parameter T from e.g. PolymorphicSerializer<T> leaked outside.
2020-04-03 12:46:44 +03:00
Igor Yakovlev
75c4607e57 Rename of KotlinQuickDocumentationProvider to KotlinDocumentationProvider 2020-04-03 12:39:03 +03:00
Igor Yakovlev
a71fd0e6d9 Support for showing rendered doc comments in editor
Fixed #KT-37361
2020-04-03 12:38:51 +03:00
Dmitriy Novozhilov
d620802a18 [FIR] Add equals and hashCode to ConeCapturedType 2020-04-03 10:09:13 +03:00
Dmitriy Novozhilov
7dd91df10b [FIR] Don't analyze with DFA already analyzed classes 2020-04-03 10:08:26 +03:00
Dmitriy Novozhilov
0b2536199b [FIR] Don't analyze delegated constructor calls twice 2020-04-03 10:08:25 +03:00
Dmitriy Novozhilov
20d0e8647d [FIR] Pass data flow to init blocks of local classes 2020-04-03 10:08:25 +03:00
Dmitriy Novozhilov
16b5b2dcef [FIR] Add symbol to FirAnonymousInitializer 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov
bcd2e5ed2c [FIR] Add control flow graph to inplace lambdas 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov
1d39270b3e [FIR] Don't pass data flow to property accessors of non local classes 2020-04-03 10:08:24 +03:00
Dmitriy Novozhilov
bb8d743741 [FIR-TEST] Throw RuntimeException instead of AssertionError in FirResolveBench
This is needed for better usability of testing of changes which
  brake testdata and introduce new exceptions from compiler at same time
2020-04-03 10:08:23 +03:00
Dmitriy Novozhilov
1d1b8d3290 [FIR-TEST] Update cfg dumps according to previous commits 2020-04-03 10:08:23 +03:00
Dmitriy Novozhilov
6faf364a46 [FIR] Update cfg renderer
Now it renderers all subgraphs for each graph
2020-04-03 10:08:23 +03:00
Dmitriy Novozhilov
d1422dbf9f [FIR] Don't pass analyzed lambda to data flow analyzer 2020-04-03 10:08:22 +03:00
Dmitriy Novozhilov
68b5e4d13f [FIR] Choose right cfg owner for postponed lambdas 2020-04-03 10:08:22 +03:00
Dmitriy Novozhilov
9fa0a2cc77 [FIR] Drop subgraphs of lambda arguments of delegate calls 2020-04-03 10:08:21 +03:00
Dmitriy Novozhilov
14db88cccb [FIR] Fix double resolution of default property accessors 2020-04-03 10:08:21 +03:00
Dmitriy Novozhilov
9bdd5e47ac [FIR] Fix equality for cfg nodes 2020-04-03 10:08:21 +03:00
Dmitriy Novozhilov
b90c8eb8ed [FIR] Analyze annotations of local class before class itself 2020-04-03 10:08:20 +03:00
Dmitriy Novozhilov
1177a56815 [FIR] Don't resolve annotations twice 2020-04-03 10:08:20 +03:00
Dmitriy Novozhilov
28738971bc [FIR] Add transformAnnotations for fir nodes 2020-04-03 10:08:19 +03:00
Dmitriy Novozhilov
3190793b62 [FIR] Add incoming edges to local class's property initializers 2020-04-03 10:08:19 +03:00
Dmitriy Novozhilov
c223ae03ba [FIR] Don't analyze local classes twice 2020-04-03 10:08:19 +03:00
Dmitriy Novozhilov
119d5b3740 [FIR] Add incoming edge for all members of local class, not only implicit ones 2020-04-03 10:08:18 +03:00
Dmitriy Novozhilov
43e9cbbbf5 [FIR] Add parent graph to CFG 2020-04-03 10:08:18 +03:00
Dmitriy Novozhilov
6be554e765 [FIR] Rename ControlFlowGraph.owner to declaration 2020-04-03 10:08:17 +03:00
Dmitriy Novozhilov
8cb6e8f8af [FIR] Add control flow graph for class initialization 2020-04-03 10:08:17 +03:00
Dmitriy Novozhilov
ad9e6517c7 [FIR] Add cfg nodes for classes 2020-04-03 10:08:17 +03:00
Dmitriy Novozhilov
74d86d82c6 [FIR] Add control flow graph to FirAnonymousInitializer 2020-04-03 10:08:16 +03:00
Dmitriy Novozhilov
8d3ee4f304 [FIR] Add cfg reference to classes 2020-04-03 10:08:16 +03:00
Ilya Goncharov
c1c0df962f [Gradle, JS] Add browser to test js composite build
#KT-37954 fixed
2020-04-03 09:47:15 +03:00
Ilya Goncharov
a5026d60db [Gradle, JS] Configure test executable only once
#KT-37954 fixed
2020-04-03 09:46:15 +03:00
Ilya Goncharov
c26c8fdb89 [Gradle, JS] Added binaries names to store
#KT-37954 fixed
2020-04-03 09:46:01 +03:00
Ilya Goncharov
6b32548491 [Gradle, JS] JvmOverloads for Groovy DSL
#KT-37936 fixed
2020-04-03 09:45:49 +03:00
Ilya Goncharov
d4ece2b23b [Gradle, JS] Fix ktor version in web mpp wizard
#KT-37980 fixed
2020-04-03 09:45:26 +03:00
Ilya Goncharov
1b294ce5a5 [Gradle, JS] Fix DSL for project wizards
#KT-37936 fixed
#KT-37937 fixed
2020-04-03 09:45:08 +03:00
Ilya Goncharov
b3e6738243 [Gradle, JS] Fix binaries.executable for Groovy dsl
#KT-37936 fixed
2020-04-03 09:44:19 +03:00
Toshiaki Kameyama
1f6b7dd88d "Redundant suspend modifier": fix false negative with only recursive call
#KT-35829 Fixed
2020-04-03 01:17:15 +03:00
Ilya Kirillov
e3871a9961 Wizard: fix project editor width on the second step
#KT-37821 fixed
2020-04-03 01:09:41 +03:00
Ilya Kirillov
126cd38360 Fix testdata of RemoveSingleLambdaParameter quickfix 2020-04-02 22:25:20 +03:00
Toshiaki Kameyama
cc0cb30b53 "Remove single lambda parameter declaration": do not suggest when lambda is directly under 'if/when'
#KT-35995 Fixed
2020-04-02 22:10:57 +03:00
Pierre-Luc Carmel Biron
352a860e46 Add system classloader as a parent of ReplClassLoader. 2020-04-02 19:22:39 +02:00
Victor Petukhov
cec747349e Fix PSI tests for correct parsing them by the ANTLR grammar 2020-04-02 19:02:31 +03:00
Matthew Gharrity
5786578f38 Fix NPE in ProjectRootsUtilKt.isKotlinBinary
Fixes KT-37933
2020-04-02 17:48:25 +03:00
Mikhail Glukhikh
e676967056 Unmute two FIR black box test (related to JDK version) 2020-04-02 17:41:50 +03:00
pyos
a75408b1ed JVM_IR: use non-nullable types as SAM super types
The wrappers for conversions to nullable and non-nullable SAM types are
the same, so differentiating those has no effect other than class name
collisions.
2020-04-02 15:40:17 +02:00
Victor Petukhov
164f25937f NI: take into account an extension function annotation during CST calculation 2020-04-02 15:28:35 +03:00
Victor Petukhov
f8d72f5dd9 NI: improve lambdas completion – look at all postponed arguments during resolution lambdas by additional conditions
^KT-36819 Fixed
^KT-36069 Fixed
2020-04-02 15:28:11 +03:00
Ilya Matveev
3baeb63455 Update K/N: 1.4-M2-dev-15123 2020-04-02 19:22:32 +07:00
Toshiaki Kameyama
a96b359a09 "Remove braces from 'if' statement": do not suggest when lambda is directly under 'if'
#KT-35994 Fixed
2020-04-02 12:52:11 +03:00
Toshiaki Kameyama
30366148bf Convert to block body: adjust line indent
#KT-22368 Fixed
2020-04-02 12:48:05 +03:00
Toshiaki Kameyama
1bc72f0b32 "Surround with lambda" quickfix: suggest for suspend function
#KT-34371 Fixed
2020-04-02 12:45:47 +03:00
Jinseong Jeon
44c34ab8c3 [FIR2IR] Don't create fake overrides for private property accessors 2020-04-02 12:43:06 +03:00
Jinseong Jeon
3e6b38a921 [FIR] Fix type reference for 1st arg of GetClassCall 2020-04-02 12:42:50 +03:00
Denis Zharkov
4a5643856e FIR: Extract fir.resolve.calls.tower package 2020-04-02 12:10:50 +03:00
Denis Zharkov
177abe9f87 FIR: Add fixes after review 2020-04-02 12:10:50 +03:00
Denis Zharkov
426609a133 FIR: Fix resolution for HideMembers level 2020-04-02 12:10:50 +03:00
Denis Zharkov
6cc6b9efcb FIR: Fix overload resolution for some invoke cases
Namely, it's about the cases when there are multiple variable candidates
with the same priority and all of them should be collected and compared
2020-04-02 12:10:50 +03:00
Denis Zharkov
bcd79c1e2e FIR: Drop unused TowerGroup.Weakened 2020-04-02 12:10:50 +03:00
Denis Zharkov
328740f8e1 FIR: Minor. Use copy in CallInfo 2020-04-02 12:10:50 +03:00
Denis Zharkov
7fc0655849 FIR: Refactor CandidateCollector 2020-04-02 12:10:50 +03:00
Denis Zharkov
b52dd8e680 FIR: Extract processLevelForRegularInvoke 2020-04-02 12:10:50 +03:00
Denis Zharkov
19e0cf570c FIR: Cleanup MemberScopeTowerLevel 2020-04-02 12:10:50 +03:00
Denis Zharkov
9abe669443 FIR: Fix resolution for invokes on class qualifiers 2020-04-02 12:10:50 +03:00
Denis Zharkov
10531d2874 FIR: Refactor createExplicitReceiverForInvoke 2020-04-02 12:10:50 +03:00
Denis Zharkov
b83ffe83fa FIR: Minor. Add comments 2020-04-02 12:10:50 +03:00
Denis Zharkov
90d82e201e FIR: Get rid of lateinit property in CandidateFactoriesAndCollectors 2020-04-02 12:10:50 +03:00
Denis Zharkov
80c64207f7 FIR: Rename CallResolutionContext -> CandidateFactoriesAndCollectors 2020-04-02 12:10:50 +03:00
Denis Zharkov
4053978609 FIR: Refactor FirTowerResolverSession and LevelHandler
- Move enqueuing invoke lookups to FirTowerResolverSession
- Simplify state for LevelHandler (it almost could be a plain function)
2020-04-02 12:10:50 +03:00
Denis Zharkov
31c6cf3106 FIR: Clean up code in LevelHandler 2020-04-02 12:10:50 +03:00
Denis Zharkov
063795f280 FIR: Minor. Move createExplicitReceiverForInvoke out of the class 2020-04-02 12:10:50 +03:00
Denis Zharkov
3e32f21e7e FIR: Replace extension receiver with explicit parameter
It will help to make code more explicit in the following commits
2020-04-02 12:10:50 +03:00
Denis Zharkov
b97ce3d6ef FIR: Extract function in TowerLevelHandler 2020-04-02 12:10:50 +03:00
Denis Zharkov
36d3abad51 FIR: Get rid of relation from LevelHandler to FirTowerResolver 2020-04-02 12:10:50 +03:00
Denis Zharkov
123bcdb0ad FIR: Move some responsibilities of TowerResolveManager to FirTowerResolverSession 2020-04-02 12:10:50 +03:00
Denis Zharkov
a39dbe8eec FIR: Declare manager as a property inside FirTowerResolverSession 2020-04-02 12:10:50 +03:00
Denis Zharkov
f8227e4cb9 FIR: Extract FirTowerResolverSession
The idea of that class is separating lots of data from a component
to a short-living instance
2020-04-02 12:10:50 +03:00
Denis Zharkov
60cbc5fa39 FIR: Extract LevelHandler and CallResolutionContext from TowerManager 2020-04-02 12:10:50 +03:00
Denis Zharkov
08ee76b103 FIR: Introduce FirTowerResolver.implicitReceiversUsableAsValues 2020-04-02 12:10:50 +03:00
Denis Zharkov
e936c03839 FIR: Extract processScopeForExplicitReceiver 2020-04-02 12:10:50 +03:00
Denis Zharkov
9cd8432c92 FIR: Minor. Formatting 2020-04-02 12:10:50 +03:00
Denis Zharkov
2e631052f6 FIR: Drop redundant main function 2020-04-02 12:10:50 +03:00
Denis Zharkov
5c61211e65 FIR: Extract LevelHandler.processInvokeReceiversCandidates 2020-04-02 12:10:50 +03:00
Denis Zharkov
a5c3e4bfd4 FIR: Extract some parts from FirTowerResolver and cleanup 2020-04-02 12:10:50 +03:00
Denis Zharkov
7843f7d3f0 FIR: Minor. Reuse processExtensionsThatHideMembers 2020-04-02 12:10:50 +03:00
Denis Zharkov
aeb3354a5b FIR: Extract ReceiverValue.toMemberScopeTowerLevel 2020-04-02 12:10:50 +03:00
Denis Zharkov
e2ca1f2af4 FIR: Extract FirScope.toScopeTowerLevel 2020-04-02 12:10:50 +03:00
Denis Zharkov
bea9d20557 FIR: Split FirTowerResolver.runResolverForNoReceiver 2020-04-02 12:10:50 +03:00
Ilya Goncharov
07d80aa11c [Gradle, JS] KT-36784 Enable composite builds only for IR compiler
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:57 +03:00
Ilya Goncharov
43efac69a9 [Gradle, JS] KT-36784 Move test only to IR
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:57 +03:00
Ilya Goncharov
c11c3dffe7 [Gradle, JS] KT-36784 Provide args for kotlinNpmInstall
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:56 +03:00
Ilya Goncharov
fe40056abe [Gradle, JS] KT-36784 Remove hasNodeModulesDependentTasks
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:56 +03:00
Ilya Goncharov
9806ac992e [Gradle, JS] KT-36784 Fix tests on composite
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:56 +03:00
Ilya Goncharov
a27ae5dd7b [Gradle, JS] KT-36784 Fix absolute paths on relative in package.json
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-04-02 11:08:56 +03:00
Mikhail Glukhikh
ffc22f4190 [FIR] Unmute two passing black box tests 2020-04-02 10:28:07 +03:00
Ilya Gorbunov
055a1921cc Update kotlin-build-gradle-plugin to 0.0.17 2020-04-02 05:21:10 +03:00
Ilya Gorbunov
8bc8a8cf79 Publish kotlin-build-gradle-plugin sources
#KT-37775 Fixed
2020-04-02 05:21:10 +03:00
Ilya Gorbunov
fde33252cf Present boolean property without value is considered true
For example, -Pbootstrap.local or -Pkotlin.build.proguard
2020-04-02 05:21:10 +03:00
Ilya Gorbunov
1727fcf1a8 Make some build properties extensions in buildSrc
They are used only in main build's .gradle.kts files, so it is more
flexible to define them as extensions - no need to republish
kotlin-build-gradle-plugin when another such property is to be added.
2020-04-02 05:21:10 +03:00
Ilya Gorbunov
c046f431d9 Rename KotlinBuildProperties.get private function to getOrNull
Before that Groovy tried to find 'get' when dispatching property access,
succeeded in that, and thus any mistyped missing property
would have resulted in null value instead of exception.
2020-04-02 05:21:10 +03:00
Ilya Gorbunov
2e20fab05f Add bootstrap.teamcity.url parameter to specify bootstrap teamcity server 2020-04-02 05:21:10 +03:00
Ilya Gorbunov
453e91daf2 Advance bootstrap to 1.4.0-dev-5258 2020-04-02 04:43:13 +03:00
Ilya Gorbunov
01b463993b Use SinceKotlin in primitive companion objects for documentation purpose
Also suppress "div by zero" warnings in JS primitive companions.
2020-04-02 04:43:00 +03:00
Ilya Gorbunov
a225842f9b Test that known Floats can fit in FloatArray without over/underflow
But some precision loss can still happen in JS.

Relates to KT-24975
2020-04-02 04:04:04 +03:00
Ilya Gorbunov
d88d2cb058 Test new Double/Float constants
Split test expectations based on actual support of enforced Float range

KT-29182, KT-13887
2020-04-02 04:04:04 +03:00
Ilya Kirillov
3e6ab65ccc Wizard: place kotlin.code.style to gradle.properties file instead of local.properties
#KT-37923 fixed
2020-04-02 01:25:38 +03:00
Ilya Kirillov
db2c2cc8d9 Wizard: fix generated project path & name
#KT-37927 fixed
2020-04-02 01:25:38 +03:00
Ilya Kirillov
00e5e96fe3 Wizard: fix write action scope in IdeaJpsWizardService
#KT-37925 fixed
2020-04-02 01:25:37 +03:00
Dmitry Petrov
24b8495e00 KT-30419 Box inline classes in return types of covariant overrides
Use boxed version of an inline class in return type position for
covariant and generic-specialized overrides.

Also fixes KT-35234 and KT-31585.
2020-04-01 22:59:14 +03:00
Alexander Udalov
e44f12d7b0 Minor, unmute passing FIR black box tests 2020-04-01 19:33:45 +02:00
Vladimir Dolzhenko
10df7ee31a Get rid of getInstanceIfNotDisposed
Relates to #EA-216005
2020-04-01 17:17:26 +00:00
Ilya Gorbunov
55a98fc5df Include kotlin-test-annotations-common into core libs list
Otherwise it doesn't get published when executing
coreLibsInstall/coreLibsPublish tasks.
2020-04-01 19:28:27 +03:00
Dmitriy Dolovov
5e1e9876fd IDE: Don't use direct refs on IdePlatformKindResolution EP instances 2020-04-01 23:10:55 +07:00
Dmitriy Dolovov
a2e2213d31 Keep KonanTarget.predefinedTargets as Map<String, KonanTarget> 2020-04-01 23:10:47 +07:00
Dmitriy Dolovov
132464fa4f Minor. Rename KotlinLibrary.readSafe() -> KotlinLibrary.safeRead() 2020-04-01 23:10:37 +07:00
Nikolay Krasko
b199403c57 201: Revert adding RUN_SLOW_ASSERTIONS enabling in KtUsefulTestCase 2020-04-01 18:03:41 +03:00
Mathias Quintero
34a64d9171 Making var arg kParameters default to empty array no argument given
fixes KT-29969
2020-04-01 16:00:16 +02:00
anastasiia.spaseeva
b1dbacf45f [Spec tests] Fix test-info parser for relevant places 2020-04-01 16:30:24 +03:00
anastasiia.spaseeva
9f684bfd65 [Spec tests] Add tests for call-with-specified-type-parameters 2020-04-01 16:30:23 +03:00
Alexander Udalov
3269a7e693 Change behavior of equals/hashCode on adapted function references
Function references are now equal if they refer to the same function,
and if the parameter/return type adaptation, which happens when a
reference is used where some function type is expected, is exactly the
same. This includes the number of expected positional parameters (which
can be affected by defaults/varargs), whether the coercion of vararg
parameter to Array type happened, and whether the coercion of return
type to Unit happened.

 #KT-37543 Fixed
2020-04-01 14:18:49 +02:00
Toshiaki Kameyama
c344b85d4e Convert parameter <-> receiver intention: do not add label to 'this' if not needed
#KT-17615 Fixed
#KT-30028 Fixed
#KT-32809 Fixed
#KT-28085 Fixed
#KT-37508 Fixed

Convert receiver to parameter:

#KT-37508 Fixed
2020-04-01 13:26:55 +03:00
Alexander Udalov
34e9e899f8 FIR: move FirModifierList to module 'fir:checkers'
To remove dependency of a large module 'fir:tree' on 'psi', allowing
them to compile in parallel.
2020-04-01 12:09:41 +02:00
Toshiaki Kameyama
3263e85bee Introduce "Remove fun modifier" quick fix for FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS error
#KT-37539 Fixed
2020-04-01 12:55:22 +03:00
Dmitriy Dolovov
bfd6eeda60 Fix compilation with JPS 2020-04-01 16:42:04 +07:00
Toshiaki Kameyama
e455e926aa Implement members: fix it works correctly if primary constructor has implemented member
#KT-37312 Fixed
2020-04-01 12:24:27 +03:00
Ilya Gorbunov
5eabc1117f Generate constant expression initializers for special fp values in kapt
Update new constant values propagated in kapt class-to-stub test
2020-04-01 08:06:57 +03:00
Ilya Gorbunov
427750ba03 Update builtins test data 2020-04-01 08:06:57 +03:00
Ilya Gorbunov
f3fc1197ae Add SIZE_BITS and SIZE_BYTES constants to Double and Float
#KT-29182
2020-04-01 08:06:57 +03:00
Ilya Gorbunov
1c93911279 Make Double and Float known values constant
#KT-13887
2020-04-01 08:06:57 +03:00
Dmitry Gridin
435a7e7e26 i18n: fix name for LiftReturnOutFix
#KT-37483
#KT-37893 Fixed
2020-04-01 11:55:22 +07:00
Dmitriy Dolovov
5411b85cb9 Minor. Rename isKonanStdlib() into isNativeStdlib() 2020-04-01 11:47:10 +07:00
Dmitriy Dolovov
e69b2ed47d Drop redundant dependencies on :native:kotlin-native-utils 2020-04-01 11:47:01 +07:00
Dmitriy Dolovov
31a1f8ff4b Include :native:kotlin-native-utils into kotlin-compiler.jar 2020-04-01 11:46:55 +07:00
Dmitriy Dolovov
28cb9d4e13 Gradle: Remove redundant dependency on 'kotlin-native-utils' artifact 2020-04-01 11:46:49 +07:00
Dmitriy Dolovov
5f5f219367 Keep KonanPlatformKt.isNative for backward compatibility 2020-04-01 11:46:43 +07:00
Ilya Gorbunov
10d5726a02 Update test data that depends on stdlib method docs 2020-04-01 02:55:30 +03:00
Toshiaki Kameyama
6eebe21897 Remove redundant backticks: fix false positive for multiple underscores
#KT-37496 Fixed
2020-04-01 00:46:22 +03:00
Toshiaki Kameyama
34cfe7dfdb "Add missing component" intention: fix it works correctly if entries is empty
#KT-36094 Fixed
2020-04-01 00:42:43 +03:00
Victor Turansky
0a215cafa7 README Update 'Gradle properties' link 2020-04-01 00:35:17 +03:00
Victor Turansky
136a64a0b7 README Kotlin DSL script for composite build 2020-04-01 00:31:07 +03:00
Toshiaki Kameyama
e5b4b03314 RedundantLambdaArrowInspection: fix false positive when receiver is qualified expression
#KT-37502 Fixed
2020-03-31 20:36:24 +03:00
Ilya Kirillov
487e1ddddc Wizard: do not update path & artifactId value for invalid project name 2020-03-31 20:32:37 +03:00
Ilya Kirillov
fef3ea573b Wizard: allow "-" char in artifactId/groupId & fix their error messages
#KT-37820 fixed
2020-03-31 20:32:37 +03:00
Mikhail Glukhikh
630adb34db [FIR] Don't provide receiver as value in delegated constructor call 2020-03-31 20:28:24 +03:00
Mikhail Glukhikh
a377a6fccb [FIR2IR] Handle references to constructors separately 2020-03-31 20:27:40 +03:00
Mikhail Glukhikh
282509b0da [FIR2IR] Provide object receivers for callable references 2020-03-31 20:27:24 +03:00
Ilya Kirillov
51de319cc4 New J2K: fix IOOB exception on inference 2020-03-31 19:35:56 +03:00
Ilya Kirillov
98f2604df0 New J2K: introduce type alias symbol 2020-03-31 19:35:55 +03:00
Ilya Kirillov
bc52281208 New J2K: convert Java method reference to Kotlin one on copy-pasting Java code
#KT-34965 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov
d6d843aaed New J2K: fix assignment target in ConvertGettersAndSettersToPropertyProcessing
#KT-36190 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov
b3e728f4fb New J2K: don't allow open modifier on top-level/private declarations 2020-03-31 19:35:55 +03:00
Ilya Kirillov
4d4aa88534 New J2K: handle spaces in array dimensions declaration
#KT-36891 fixed
2020-03-31 19:35:55 +03:00
Ilya Kirillov
353e884c8f New J2K: do not merge methods if there are vararg parameters present 2020-03-31 19:35:55 +03:00
Ilya Kirillov
4a450ab624 New J2K: do not use unicode symbol in bundle 2020-03-31 19:35:54 +03:00
Ilya Kirillov
78d2aaa021 New J2K: handle null Java type 2020-03-31 19:35:54 +03:00
Vladimir Dolzhenko
113561f5f5 Execute reloadDefinitionsBy on a pooled thread 2020-03-31 17:00:19 +02:00
Vladimir Dolzhenko
9f09e50a28 ApplicationUtils syntax improvements 2020-03-31 17:00:19 +02:00
pyos
23ea2446e0 IDEA: add a couple "navigate to inline function call site" tests 2020-03-31 16:06:57 +02:00
pyos
9d7db101e6 JVM: refactor SMAP stuff some more
Just trying to keep the entropy down.
2020-03-31 16:06:57 +02:00
pyos
e98bdc6f8e JVM: preserve call site markers when inlining lambdas
and default functions into their own stubs.

Fixes #KT-35006
2020-03-31 16:06:57 +02:00
pyos
9d21800d8f JVM: fix SMAP range extension logic
If `mapLineNumber` was called in non-monotonic order, e.g. N then N+2
then N+1, the first two calls created a range that spans [N; N+2] but
the third call did not reuse it.
2020-03-31 16:06:57 +02:00
Ilya Gorbunov
b4d7dfd02c Advance minimal Gradle version for .gradle.kts tests to 5.0
Kotlin compiler 1.2 bundled in Gradle 4.10 and lower cannot read
binaries produced by 1.4 compiler and thus cannot compile .gradle.kts
scripts that depend on  1.4 Kotlin gradle plugin artifacts.
2020-03-31 16:02:36 +03:00
Ilya Gorbunov
bc5605dcdc Mute stepping test, KT-37879 2020-03-31 16:02:34 +03:00
Ilya Gorbunov
4a8dbcccee Advance bootstrap to 1.4.0-dev-5087
Temporary fix kotlin gradle plugin version in buildsrc at 1.4.0-dev-1818, otherwise it causes problems in main buildscripts, when compiled with -dev-5087 (KT-37235).
2020-03-31 16:02:32 +03:00
Ilya Gorbunov
6b11decf52 Enable option -Xno-optimized-callable-references in the whole project
A workaround to reduce dependency on the new stdlib version
of compiler parts used by gradle plugin.

#KT-37435
2020-03-31 16:02:29 +03:00
Mikhail Zarechenskiy
38a719cb22 [NI] Fix trace manipulations for builder inference and ::-expressions
For a class literal Type::class we are resolving Type as a constructor,
 getting all diagnostics (about missing arguments, for example) and then
 just not committing this trace with errors

 #KT-37626 Fixed
2020-03-31 15:50:58 +03:00
Natalia Selezneva
6213680604 Mute GradleKtsImportTest.testError for AS
^KT-37864
2020-03-31 15:38:16 +03:00
Ilya Goncharov
ccf5a2b4ad [Gradle, JS] KT-36784 Add additional args for npm install
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:54 +03:00
Ilya Goncharov
14f0091c84 [Gradle, JS] KT-36784 Add tests on local npm dependencies in composite
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:54 +03:00
Ilya Goncharov
149d7fb33a [Gradle, JS] KT-36784 Fix requireing of node modules
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
f30875f79b [Gradle, JS] KT-36784 Move fromSrcPackageJson
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
253b8587e4 [Gradle, JS] KT-36784 Composite build test
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
568ef5dc5f [Gradle, JS] KT-36784 Fix depends on for package json umbrella
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
e27c334d4a [Gradle, JS] Fix package.json file
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
fa632a2aea [Gradle, JS] KT-36784 Input as composite package.json
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
e85501337e [Gradle, JS] Imported dependencies as file dependencies, not workspaces
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
98f012b1c8 [Gradle, JS] KT-36784 Dependencies for workspaces
But it should be done as a file dependencies

This reverts commit c5f2ff30

#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
2cee63f753 [Gradle, JS] KT-36784 Remove inter workspace dependencies
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
d0f4cdef68 [Gradle, JS] KT-36784 Fix relative folder
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:53 +03:00
Ilya Goncharov
1ef37b6203 [Gradle, JS] KT-36784 Add composite dependencies to hook
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
d3cb31c584 [Gradle, JS] KT-36784 Add internalCompositeDependencies as inputs
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
1c04ac71e9 [Gradle, JS] Formatting dependency resolution for npm
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
ba6cadfc38 [Gradle, JS] Use name of included build by root project
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
c5c3f52b81 [Gradle, JS] Umbrella package json task
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
63487c3836 [Gradle, JS] Scan all packages in included build
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
7ad489883d [Gradle, JS] Hardcode with composite build
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
ae021e21db [Gradle, JS] GradleNodeModuleBuilder use files instead of artifacts
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
be4c301808 [Gradle, JS] Abstractize GradleNodeModulesCache.kt
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Goncharov
77139a3a10 [Gradle, JS] Add internal composite dependencies
#KT-32466 fixed
#KT-36784 fixed
#KT-36864 fixed
2020-03-31 14:56:52 +03:00
Ilya Gorbunov
cdc53f5fec Minor kotlin-test doc fixes
- fix JUnit5Contributor docs reference
- fix typo
2020-03-31 13:37:35 +03:00
Ilya Gorbunov
96ed87d81b assertFailsWith: set unexpected exception as a cause of assertion error
#KT-23514
2020-03-31 13:37:03 +03:00
Ilya Gorbunov
2bb36899da Introduce 'fail' method to throw AssertionError with cause
#KT-37804
2020-03-31 13:37:03 +03:00
Ilya Gorbunov
d2ff98fcb1 Pack kotlin-test common tests into stdlib tests zip for native 2020-03-31 13:35:27 +03:00
Jinseong Jeon
ff104f4037 [FIR2IR] Set proper visibility of backing fields 2020-03-31 13:12:36 +03:00
Toshiaki Kameyama
6a1923a477 "Convert to anonymous object" intention: suggest for kotlin fun interface
#KT-37749 Fixed
2020-03-31 12:17:16 +03:00
Pavel Kirpichenkov
0abe3a6c39 [NI] Report not-a-class LHS error for callable reference arguments
^KT-37531 Fixed
2020-03-31 12:04:01 +03:00
Pavel Kirpichenkov
b7ea590e23 [IDEA] Add HTML render for ambiguous callable references diagnostic
^KT-36125 Fixed
2020-03-31 12:04:01 +03:00
Pavel Kirpichenkov
a416fde814 [NI] Move abstract class instantiation check to call checkers
This way the check works for callable reference arguments.
Also candidate applicability during resolution does not change compared to the old inference.
^KT-37530 Fixed
2020-03-31 12:04:01 +03:00
Nicolay Mitropolsky
3f00de5d7b Uast: fallback to call braces in getting the anchor for call-expressions in complex cases (KT-36273) 2020-03-31 11:56:31 +03:00
Nicolay Mitropolsky
f98a1de7c3 Uast: making convertDeclaration always convert the originalElement (KT-35848) 2020-03-31 11:56:31 +03:00
Miguel Serra
61ad32f012 Samples of Map functions "contains" and "isNotEmpty"
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2020-03-31 04:54:51 +03:00
Ilya Gorbunov
606b4db48a Improve samples for partition: add destructuring 2020-03-31 02:04:56 +03:00
n-p-s
7bb7c86fa9 Add samples for partition 2020-03-31 02:04:55 +03:00
Ilya Gorbunov
dd2aa3de28 Add sample for filterNot and improve sample for filter 2020-03-31 02:04:55 +03:00
Brian Plummer
f887a29279 Add sample for filter 2020-03-31 02:04:55 +03:00
adammc331
840f222867 Add sample for filterNotNull 2020-03-31 02:04:55 +03:00
Scott Weber
e8ee405cdb Add sample for text version of chunked 2020-03-31 02:04:55 +03:00
Vladimir Dolzhenko
3f9892a49d Revert "Avoid run DefinitionsCollectorBackgroundTask on AWT in tests"
This reverts commit 52cc7aa1
2020-03-30 21:17:04 +02:00
Dmitry Petrov
4ade669b9b Minor: unmute 2 tests fixed in FIR 2020-03-30 21:10:59 +03:00
anastasiia.spaseeva
0397470b85 [Spec tests] Update tests with spec version 0.1-313 2020-03-30 19:12:55 +03:00
Vladimir Dolzhenko
52cc7aa117 Avoid run DefinitionsCollectorBackgroundTask on AWT in tests 2020-03-30 17:38:58 +02:00
Vladimir Dolzhenko
5f66458cb5 Fix flaky ConfigureKotlinTest 2020-03-30 17:38:56 +02:00
Pavel Punegov
d0e28d7c8d Ignore Java-sepcific test in Native 2020-03-30 18:31:50 +03:00
Nikolay Krasko
02b651ef28 201: Update to 201.6668.13 2020-03-30 18:09:30 +03:00
Nikolay Krasko
1c3c1546b5 Fix JSR223 dependency on daemon in tests 2020-03-30 18:09:30 +03:00
Nikolay Krasko
46174a8c32 201: Apply workaround for IDEA execution in daemon main 2020-03-30 18:09:29 +03:00
Nikolay Krasko
148cbe87f4 201: Use idea.plugins.compatible.build to avoid problems with build number 2020-03-30 18:09:29 +03:00
Nikolay Krasko
a8c3e4aa6f 201: Add additional registry key 2020-03-30 18:09:29 +03:00
Nikolay Krasko
e618c211b4 Run test with full path to maven (KT-37654)
Prepare to mvn update on build server to fix sporadic
failures on Windows
2020-03-30 18:09:29 +03:00
Georgy Bronnikov
5fe28b3179 IR: explicitly pass isFakeOverride to buildFun and friends 2020-03-30 17:32:02 +03:00
Georgy Bronnikov
fb6956f842 IR common: use .isFakeOverride instead of checking origin 2020-03-30 17:32:02 +03:00
Georgy Bronnikov
2784e30fd4 JVM_IR: use .isFakeOverride instead of testing origin 2020-03-30 17:32:02 +03:00
Roman Artemev
0480f2d170 [JS IR] Fix usages of 'IrDeclarationOrigin.FAKE_OVERRIDE' 2020-03-30 17:32:02 +03:00
Roman Artemev
e4ad6698fb [IR] Fix fake override checkers 2020-03-30 17:32:02 +03:00
Dmitry Petrov
cec64a2ec7 KT-37861 'this' is uninitialized in constructor default parameters 2020-03-30 17:23:15 +03:00
Jinseong Jeon
078cf02c8a FIR: Provide dispatch receiver for 'field' according to property type 2020-03-30 16:57:53 +03:00
Mikhail Glukhikh
a0978a50e8 [FIR2IR] Correct 'this' conversion when it points to non-closest class 2020-03-30 16:57:52 +03:00
Jinseong Jeon
4388b30f87 [FIR] Fix anonymous object handling as 'this' receiver 2020-03-30 16:57:52 +03:00
Victor Petukhov
c8206c4666 [Spec tests] Fix mistakes during parsing compiler tests to extract spec links 2020-03-30 16:40:57 +03:00
Mikhail Glukhikh
d1fc6ff6ee [FIR2IR] Don't provide backing field symbols for non-Java property refs 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh
d4ae992417 [FIR] Apply type arguments for callable references 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh
8fbc6e37e5 [FIR2IR] Rename: CallGenerator -> CallAndReferenceGenerator 2020-03-30 16:23:11 +03:00
Mikhail Glukhikh
810b607a65 [FIR2IR] Provide receivers also for property callable references 2020-03-30 16:23:10 +03:00
Mikhail Glukhikh
697006d782 [FIR2IR] Re-use receiver application logic in callable ref conversion 2020-03-30 16:23:10 +03:00
Mikhail Glukhikh
1b1902f6ee [FIR2IR] Move callable reference conversion to CallGenerator 2020-03-30 16:23:10 +03:00
Juan Chen
d8539fdde9 [FIR2IR] Add dispatch & extension receivers to callable references 2020-03-30 16:23:10 +03:00
Igor Yakovlev
5414b9dfb3 Refactor Move refactoring 2020-03-30 15:49:31 +03:00
Igor Yakovlev
a9de0a219b Refactor of Move refactoring
1) Expect/actual move checkbox is visible when expect/actual listed in selection list only
2) Fixed invalid temprary renaming (when source file name exists in target directory)
3) Fixed invalid file delition when "delete all files" checkbox is unchecked (KT-36072)
4) Removed UpdatePackageDirective checkbox (now it always updated instead of unpredicted behavior)
5) Removed SpecifyFileNameInPackage checkbox (in case of it redundancy)
6) Wrap resolve operations into the process
7) Minor refactorings
8) Fixed MPP declaration move top level declarations
2020-03-30 13:51:28 +03:00
Anton Yalyshev
8877559c02 Add FUS support to move refactoring 2020-03-30 13:51:28 +03:00
Igor Yakovlev
f489eda0e7 Remove TextOccurrencesUtil.findNonCodeUsages reprecated usages for 201 platform 2020-03-30 13:51:27 +03:00
Igor Yakovlev
b205b017fe Fixed references move refactoring for NonCode usages
We need to try correctly refactor NonCode usages of Java-like facade FQ names
i.e. if we have file A.kt with method foo we need to check AKt.foo and foo entries for non-code text search

Fixed #KT-36382
2020-03-30 13:51:27 +03:00
Igor Yakovlev
aef8028a9c Fix changing kotlin class usages in java while move refactoring
Fixed #KT-36114
2020-03-30 13:51:25 +03:00
Igor Yakovlev
ff831aded4 Move refactoring on kts fixes
Set file target filenames to kts if moved declarations are from kts
Fixed exceptions throwing on script declaration move that could lead to not valid file state (Fixed #KT-36129)
2020-03-30 13:51:25 +03:00
Igor Yakovlev
e05df9d838 Add expect/actual move refactoring support
Fixed #KT-27389
2020-03-30 13:51:24 +03:00
Igor Yakovlev
bd851bf2fb Unmute enum tests for IDEA 201 2020-03-30 13:46:08 +03:00
Igor Yakovlev
43468c6d55 Filter enum synthetic methods for stub based classes
Fixed #KT-36095
2020-03-30 13:46:08 +03:00
Ilya Matveev
172a45a637 Gradle, native: Fix building platform libraries for MIPS
The sysroot for linux_mips doesn't contain one of platform
libs available for Linux (zlib). So we need to put def-files
to the K/N distribution on a per-target basis instead of putting
a single set of def-files for all targets of the same OS.

Corresponding change in the K/N repository:
https://github.com/JetBrains/kotlin-native/pull/4023

This patch take this change into account at the Gradle plugin side.
2020-03-30 17:31:12 +07:00
Nicolay Mitropolsky
872b140500 Uast: support for annotated expressions (KT-35801) 2020-03-30 11:58:51 +03:00
Nicolay Mitropolsky
c4bd1ce73c Uast: considering top reified functions as static (KT-37613) 2020-03-30 11:58:51 +03:00
Nicolay Mitropolsky
0ca67c1bac Uast: handling reified methods receivers (KT-37613) 2020-03-30 11:58:51 +03:00
Victor Petukhov
d6d19b563d [Spec tests] Exclude spec consistency test from common test task 2020-03-30 11:15:55 +03:00
Victor Petukhov
218c13efc5 [FIR] Remove links to spec sentences during comparison fir and old front-end test data 2020-03-30 11:15:55 +03:00
Victor Petukhov
a29385e758 [Spec tests] Small clean-up CheckerTestUtil and around it 2020-03-30 11:15:55 +03:00
anastasiia.spaseeva
90d1cdf2e1 [Spec tests] Add tests for section call-with-trailing-lambda-expressions 2020-03-30 11:15:55 +03:00
anastasiia.spaseeva
4736b3b348 [Spec tests] Add tests for call-with-named-parameters 2020-03-30 11:15:55 +03:00
anastasiia.spaseeva
bb1ee952ba [Spec tests] Add tests for call-without-an-explicit-receiver, receivers 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
35de6a3f6e [Spec tests] Add tests for overload-resolution, building-the-overload-candidate-set-ocs, operator-call:
-properties available through the invoke convention are non-eligible for operator calls
  -smart casts and overload-resolution
  -candidate sets
2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
4301744d2d [Spec tests] Add test for infix fun + KT-36786 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
c9bb994fb5 [Spec tests] Add tests to check overload resolution for implicitly imported infix functions 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
9711fda353 [Spec tests] Add tests for property-like callables prioritization 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
157e33d08b [Spec tests] Add tests for receivers prioritization 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
3b35374186 [Spec tests] Add diagnostics tests for building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
81b6e5a373 [Spec tests] Add box tests for callables-and-invoke-convention to check priority 2020-03-30 11:15:54 +03:00
anastasiia.spaseeva
f7ff60cb77 [Spec tests] Add DEBUG_INFO_AS_CALL diagnostic tag for callable references 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
008a0df28f [Spec tests] DEBUG_INFO_LEAKING_THIS diagnostics type is changed from error to  info 2020-03-30 11:15:53 +03:00
Victor Petukhov
f76faaf1b0 [Spec tests] Unify platform dependent part of fixed exception 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
5986ffae1e [Spec tests] Add tests for expressions and statements 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
5f4a94a1b3 [Spec tests] Enable running spec tests at all for remote run 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
509036b08b [Spec tests] Update spec tests metadata 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
8b307c0a2a [Spec tests] KT-35494 test update 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva
1caafdc9d4 [Spec tests] Updating tests for kotlin 1.4.0 2020-03-30 11:15:53 +03:00
Victor Petukhov
ab3b63c92a [Spec tests] Apply changes in parse trees due to trailing comma introducing 2020-03-30 11:15:52 +03:00
victor.petukhov
f62901d7d9 [Spec tests] Actualize spec tests 2020-03-30 11:15:52 +03:00
victor.petukhov
2dbce2cc41 [Spec tests] Link diagnostic tests for when expression with Kotlin specification 2020-03-30 11:15:52 +03:00
Dmitry Gridin
c338fdd677 i18n: cleanup ChangeVisibilityModifierIntention
#KT-37483
2020-03-30 14:58:37 +07:00
Dmitry Gridin
81d35e1e61 i18n: add dynamic text getters for SelfTargetingIntention
#KT-37483
2020-03-30 14:58:36 +07:00
Dmitry Gridin
d9c356b041 i18n: add displayedName to ModuleTestSourceInfo
#KT-37483
2020-03-30 14:58:36 +07:00
Dmitry Gridin
a19d42b81b i18n: update bundle for inspections
#KT-37483
2020-03-30 14:58:35 +07:00
Dmitry Gridin
ebc255c74d i18n: update bundle in plugin-common.xml
#KT-37483
2020-03-30 14:58:34 +07:00
Dmitry Gridin
ee2d9d19c1 i18n: update bundle in `idea-debugger
#KT-37483
2020-03-30 14:58:34 +07:00
Dmitry Gridin
318ca1c5e8 i18n: update bundle in `idea-repl
#KT-37483
2020-03-30 14:58:33 +07:00
Dmitry Gridin
c642ca45de i18n: update bundle in `idea-maven
#KT-37483
2020-03-30 14:58:32 +07:00
Dmitry Gridin
ab07fa5f6c i18n: fix IdeaModuleInfos
#KT-37483
2020-03-30 14:58:32 +07:00
Dmitry Gridin
a5cc11317e i18n: fix KotlinSuppressableWarningProblemGroup
#KT-37483
2020-03-30 14:58:31 +07:00
Dmitry Gridin
77a043fe1a i18n: update bundle in `idea-jvm
#KT-37483
2020-03-30 14:58:31 +07:00
Dmitry Gridin
0e82c66dac i18n: update bundle in idea-gradle-native
#KT-37483
2020-03-30 14:58:30 +07:00
Dmitry Gridin
39f7855202 i18n: update bundle in idea-gradle
#KT-37483
2020-03-30 14:58:29 +07:00
Dmitry Gridin
62760bdac3 i18n: update bundle in idea-gradle
#KT-37483
2020-03-30 14:58:29 +07:00
Dmitry Gridin
025d8a80e3 i18n: update bundle in idea-core
#KT-37483
2020-03-30 14:58:28 +07:00
Dmitry Gridin
c70809553f i18n, KotlinSurrounderUtils: convert field to function
#KT-37483
2020-03-30 14:58:27 +07:00
Dmitry Gridin
986bc3fb8f i18n: update bundle in idea-analysis
#KT-37483
2020-03-30 14:58:27 +07:00
Dmitry Gridin
871a6caddb i18n: remove duplication in IdeErrorMessages
#KT-37483
2020-03-30 14:58:26 +07:00
Dmitry Gridin
54a3d8e3ad i18n: update bundle for KotlinSuppressableWarningProblemGroup
#KT-37483
2020-03-30 14:58:25 +07:00
Dmitry Gridin
297a443fe4 i18n: fix name/displayedName for ModuleInfo
#KT-37483
2020-03-30 14:58:25 +07:00
Ilya Goncharov
84f9dcd48a [Gradle, JS] KT-37207 Add test case with non module directory dependency 2020-03-30 10:46:34 +03:00
Ilya Goncharov
f1133defa3 [Gradle, JS] KT-37207 Possibility to add dependency on not module dir 2020-03-30 10:46:34 +03:00
Ilya Goncharov
f0c900c027 [Gradle, JS] KT-37207 Add test on file-only dependency 2020-03-30 10:46:34 +03:00
Ilya Goncharov
c72e4a0091 [Gradle, JS] KT-37207 Support file-only npm dependency in extension 2020-03-30 10:46:34 +03:00
Ilya Goncharov
f6ef96a34c [Gradle, JS] KT-37207 Leave constructor NpmDependency once 2020-03-30 10:46:34 +03:00
Ilya Goncharov
459577e646 [Gradle, JS] KT-37207 Add constructor fot NpmDependency with only file 2020-03-30 10:46:34 +03:00
Ilya Goncharov
7fc74ff7bd [Gradle, JS] KT-37207 Correct path to dependency directory 2020-03-30 10:46:34 +03:00
Ilya Goncharov
6b035bcdc2 [Gradle, JS] KT-37207 Move File prefix to NpmDependency.kt 2020-03-30 10:46:34 +03:00
Ilya Goncharov
4d107751d7 [Gradle, JS] KT-37207 Fix of test 2020-03-30 10:46:34 +03:00
Ilya Goncharov
8cefa09528 [Gradle, JS] KT-37207 Add possibility to add npm dependency to directory 2020-03-30 10:46:33 +03:00
Ilya Goncharov
ee941a3e77 [Gradle, JS] KT-37207 Add test 2020-03-30 10:46:33 +03:00
Ilya Goncharov
ab56ec7481 [Gradle, JS] Use standard instance filtering 2020-03-30 10:35:15 +03:00
Ilya Goncharov
bc22489aab [Gradle, JS] Fix link task options for IR tooling 2020-03-30 10:35:15 +03:00
Vladimir Dolzhenko
f011d2794a Fix freeze on configure kotlin for the project
#KT-30541 Fixed
#KT-36289 Fixed
2020-03-30 07:17:52 +00:00
Ilya Gorbunov
2c69d82916 Update directory-maven-plugin to the latest version: 0.3.1
This fixes problem with incorrect highest-basedir detection.
2020-03-30 07:44:06 +03:00
Dmitriy Dolovov
9bbfe9c1ac Rename: KonanPlatform, KonanPlatforms -> NativePlatform, NativePlatforms 2020-03-29 23:20:52 +07:00
Dmitriy Dolovov
dfbbae3991 IDE, Common: Don't create KLIB metadata factories for each new KLIB 2020-03-29 23:20:46 +07:00
Dmitriy Dolovov
5b9770a4dd IDE, JS: Don't create KLIB metadata factories for each new KLIB library 2020-03-29 23:20:41 +07:00
Dmitriy Dolovov
cc6e4e5cfb IDE, Native: Don't produce CompositePackageFragmentProvider when unnecessary 2020-03-29 23:20:35 +07:00
Alexander Udalov
87da4be9bb Move parametersMap.kt to 'cli-common'
Also reformat and slightly refactor it. This allows to get rid of
dependency of 'util' on 'kotlin-reflect-api'.
2020-03-28 21:30:08 +01:00
Alexander Udalov
92534eadaa Remove dependency of 'resolution' on 'deserialization'
Replace it with a dependency on 'descriptors'.

Move the existing marker interface ContractProvider to 'descriptors',
and create a new marker interface DeserializedDescriptor.
2020-03-28 21:30:07 +01:00
Alexander Udalov
b6fdc96994 Reverse dependency 'psi' <-> 'frontend.common'
Move ParseUtils to 'psi', and ImportPath to 'frontend.common'.

Now 'psi' depends on 'frontend.common', and that allows to remove
dependency of 'fir:tree:tree-generator' on 'psi', allowing the former to
compile in parallel with the old frontend code.
2020-03-28 21:30:07 +01:00
Alexander Udalov
d70271b6aa Move RequireKotlinNames to 'descriptors'
Also move version string regex there and rename the class to
RequireKotlinConstants. This allows to get rid of dependency of
'serialization' on 'frontend'.
2020-03-28 21:30:07 +01:00
Alexander Udalov
844b0078ba Minor, remove unneeded dependency of 'js.parser' on 'util' 2020-03-28 21:30:06 +01:00
Alexander Udalov
9dd8b1821a Move CoroutineLanguageVersionSettingsUtil to 'config'
This allows to get rid of dependency of 'util' on 'descriptors'.
2020-03-28 21:30:06 +01:00
Alexander Udalov
db9347cb56 Move JVM-specific analysis flags to 'config.jvm' 2020-03-28 21:30:06 +01:00
Alexander Udalov
7bb77e5672 Move JS binary version utilities to 'js.config'
This allows to replace dependency of 'util' on 'deserialization' with
dependency on 'descriptors'.
2020-03-28 21:30:06 +01:00
Alexander Udalov
fe5104b865 Move package org.jetbrains.kotlin.incremental.js to 'js.config'
This allows to replace dependency on 'js.frontend' with 'js.config', in
'kotlin-build-common' and 'daemon-common'. Also simplify some other
dependencies.
2020-03-28 21:30:05 +01:00
Alexander Udalov
4dcd0d1cb6 Extract module 'config' out of 'frontend'
Also move deprecated TargetPlatform there. This allows to get rid of the
dependency cli.common -> frontend, and even on frontend.common.
2020-03-28 21:30:05 +01:00
Alexander Udalov
143aef938b Extract module 'js.config' out of 'js.frontend'
This allows to get rid of dependency cli.common -> js.frontend.
2020-03-28 21:30:05 +01:00
Alexander Udalov
15d2a06132 Extract module 'config.jvm' out of 'frontend.java'
This allows to get rid of dependency cli.common -> frontend.java.
2020-03-28 21:30:04 +01:00
Alexander Udalov
90ae416b72 Minor, move KotlinTypeRefinerImpl out of 'config' package 2020-03-28 21:30:04 +01:00
Alexander Udalov
4aa47be202 Move CommonResolverForModuleFactory to 'frontend'
This will allow to get rid of dependency of 'cli-common' on 'frontend'.
2020-03-28 21:30:04 +01:00
Alexander Udalov
9e014e462b Do not use CommonPlatforms directly in CommonResolverForModuleFactory
This allows to get rid of dependency of this code on CommonPlatforms,
which depends on all platforms (JVM, JS, Native), and eventually move it
to 'frontend'.
2020-03-28 21:30:03 +01:00
Alexander Udalov
8dd04789ad Remove obsolete InlineStrategy
Replace corresponding metadata property in js.ast with Boolean. This
allows to get rid of dependency of 'js.ast' on 'frontend'.
2020-03-28 21:30:03 +01:00
Alexander Udalov
4156a9c80b Extract javac-wrapper into a separate module
It was actually a separate module before the grand build refactoring in
61dfb75e0e.
2020-03-28 21:30:03 +01:00
Alexander Udalov
aad7354a3b Minor, remove obsolete jvmTarget modifications in compiler modules
Default JVM target (as well as JDK home) is set to 1.8 for all Gradle
projects in build.gradle.kts:352.
2020-03-28 21:30:03 +01:00
Victor Turansky
f403a0da82 README Update IDEA plugin dist path 2020-03-28 18:52:41 +03:00
Igor Chevdar
d808ef10b2 Added some tests on local classes in inline bodies 2020-03-28 15:26:19 +03:00
Igor Chevdar
e2a378bed7 [JS_IR] More subtle local classes copying in inliner 2020-03-28 15:26:19 +03:00
Igor Chevdar
90abf1fda0 [JS_IR] Don't capture the bound receiver of a CR 2020-03-28 15:26:19 +03:00
Igor Chevdar
643e581448 [IR] Supported extraction of local classes from inline bodies
The mental model for inline functions/lambdas is as following:
inline functions have the `inline` keyword before them so it makes sense
for their bodies to be copied at call sites although the compiler might optimize
that if there is no usage of reified type parameters or crossinline value parameters.
But since there is no `inline` keyword around an inline lambda, then
it is logical to think that there will be no copy of it and that it will be just embedded
at the corresponding call site as is.
2020-03-28 15:26:19 +03:00
Igor Chevdar
7a48c3a945 [IR] Made currentDeclarationParent nullable 2020-03-28 15:26:19 +03:00
Toshiaki Kameyama
09304bbd54 ConvertToAnonymousObjectFix: do not suggest when there is no lambda
#KT-31912 Fixed
2020-03-28 14:13:19 +03:00
Ilya Kirillov
d3c54f664b Wizard: fix 191 tests 2020-03-28 01:14:58 +03:00
Ilya Gorbunov
8447701d74 Use stable order and constant timestamps in merged sources jar
To avoid up-to-date fights between several kotlin working copies.
2020-03-27 19:45:11 +03:00
Dmitry Petrov
042424d599 KT-27524 Don't box (some) inline classes in suspend fun return
If an inline class is mapped to a reference type (or an array), it's Ok
to treat JVM view on a suspend function as returning a value of
corresponding inline class (although in reality it returns 'Any?'
because of COROUTINE_SUSPENDED).
2020-03-27 18:29:36 +03:00
Mikhail Glukhikh
d8bc29e6c6 [FIR] Eliminate obsolete NO_SUPERTYPE diagnostic from builder 2020-03-27 18:24:50 +03:00
Nick
b38d30bab0 [FIR] Support several super-related diagnostics 2020-03-27 18:24:50 +03:00
Mads Ager
5570a5fe74 [JVM_IR] Use iinc for incrementing Int variables.
Fix line number generation for assignments where the right-hand
side of the assignment is not on the same line.

Fix line number generation for intrinsics functions where the
function is not on the same line as the last argument.

Be careful to not break stepping behavior with the iinc
optimizations.
2020-03-27 18:17:53 +03:00
Steven Schäfer
58685be4e2 IR: Don't use IrStringConcatenation for ordinary toString calls
We can only use IrStrinConcatentation to represent calls to Any?.toString
and toString calls on primitive types. Otherwise, x.toString() and "$x"
are observably different when x is a non-null type with null value
(e.g., an @NotNull value coming from Java).
2020-03-27 17:31:48 +03:00
Mikhail Glukhikh
c1b9fdd2f3 Fix diagnostic test data to be consistent with FIR test data 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
c518868c03 Disable UnusedMainParameterInspection by default 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
7bfd354a77 Don't report UNUSED_PARAMETER in main from object #KT-37718 Fixed 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
cec0f58544 [FIR] Introduce & use toFirLightSourceElement 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
6a5acc024a [FIR] Rename PSI version of toFirSourceElement 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
b27152f903 Replace some FIR syntax errors with more proper diagnostics 2020-03-27 16:46:59 +03:00
Mikhail Glukhikh
2f63c8a46a [FIR] Enhance diagnostic DSL to be able to use concrete factories
Before this commit, things like DiagnosticFactory0<KtDeclaration>
were effectively unusable.
2020-03-27 16:46:58 +03:00
Dmitriy Novozhilov
a1d81aa15f [FIR-TEST] Fix diff between FIR and old FE testdata 2020-03-27 16:39:02 +03:00
Georgy Bronnikov
b0d96eb140 Revert "Workaround for KT-37302"
This reverts commit ae208f58a4.
Issue fixed, workaround no longer needed.
2020-03-27 14:19:45 +03:00
Dmitry Savvinov
cd440841a5 Fix regex in KotlinPluginCompatibilityVerifier to support release and milestones 2020-03-27 13:30:36 +03:00
Dmitry Savvinov
dfaebf3cdb Minor: make KotlinPluginVersion public 2020-03-27 13:30:36 +03:00
FenstonSingel
b7d8e879a6 [FIR] Support 4 diagnostics for pairs of modifiers
In particular, this commit includes:
* Attempt to abstract access to FirSourceElement via FirModifier
* Add more visit functions to DeclarationCheckersDiagnosticComponent
* Add messages+factories for 4 modifier-related errors and warnings
* Introduce FirModifierChecker
2020-03-27 12:34:29 +03:00
Yaroslav Chernyshev
311a91af79 Fix: forgot to write services for 191 2020-03-27 11:54:10 +03:00
Vladimir Dolzhenko
674f1d129f Clean up of plugin-common.xml and convert components to services 2020-03-27 07:54:14 +00:00
Roman Artemev
87006036be [IR] Forbid unbound type parameters 2020-03-27 10:52:33 +03:00
Roman Artemev
6e01ec8dd3 [IR] Fix translation of synthetic generic java properties
- Compute substituted accessor descriptor to avoid unbound type parameters
2020-03-27 10:52:33 +03:00
Roman Artemev
4bebfd33b9 [IR] Fix unbound type parameter symbol for jvm corner cases 2020-03-27 10:52:33 +03:00
Dmitriy Novozhilov
48fb279721 [FIR] Add constraint to flexible type for declared argument for java parameter 2020-03-27 10:17:12 +03:00
Dmitriy Novozhilov
3acb64c536 [FIR] Add flexible default upper bound for java type parameters 2020-03-27 10:17:12 +03:00
Dmitriy Dolovov
c23a11a6fc Refactoring: Clean-up usage of KlibMetadataFactories 2020-03-27 13:12:01 +07:00
Dmitriy Dolovov
36988cf15c Refactoring: Keep predefined K/N targets inside of KonanTarget.Companion 2020-03-27 13:11:46 +07:00
Dmitriy Dolovov
7a19558d54 Refactoring: Put KonanTarget & related classes into separate .kt files 2020-03-27 13:11:35 +07:00
Dmitriy Dolovov
2aa8601f93 Minor. Comments added 2020-03-27 13:11:24 +07:00
Dmitriy Dolovov
bd9fdb18da Minor. Remove unused code 2020-03-27 13:11:12 +07:00
Anton Yalyshev
035755826a Update version of New project Wizards FUS reporter 2020-03-26 23:50:39 +03:00
Anton Yalyshev
23eb612954 Fix: forgot to call FUS logger in this collector 2020-03-26 23:50:01 +03:00
Anton Yalyshev
e863d81f30 Improve wizards names composition for FUS reporter 2020-03-26 23:50:01 +03:00
Anton Yalyshev
47bb73d90b Change FUS data format for New Project Wizards collector 2020-03-26 23:50:01 +03:00
Ilya Gorbunov
e8dff3609b Add @ExperimentalUnsignedTypes to unsigned array snapshot extensions 2020-03-26 23:30:19 +03:00
Roman Golyshev
f656cd2889 KT-37781 Add FUN_KEYWORD to MODIFIERS_ORDER
- This way it is inserted before visibility modifiers
- ^KT-37781 Fixed
2020-03-26 19:37:10 +03:00
Pavel Kirpichenkov
e39b69839b [NI] Make constraint check for type variables with complex dependency
Additional check for trivial constraints is needed to make lambda
analysis before outer variable fixation to Nothing(?)

^KT-37627 Fixed
2020-03-26 17:06:37 +03:00
Pavel Kirpichenkov
568b21e31c minor: refactor cast into context operation 2020-03-26 17:06:37 +03:00
Ilya Goncharov
5657afc35b [Gradle, JS] Add tolerance for NodeJsExec inputFileProperty
- no error if it is not present
2020-03-26 16:45:54 +03:00
Ilya Goncharov
a83f2faf9f [Gradle, JS] Contains to in
#KT-37207 fixed
2020-03-26 16:44:44 +03:00
Ilya Goncharov
201d140912 [Gradle, JS] Use when instead of pipeline of changes
#KT-37207 fixed
2020-03-26 16:44:34 +03:00
Ilya Goncharov
14af869a87 [Gradle, JS] Extract YarnEntryRegistry to upper level
- Remove copypaste with version prefixes

#KT-37207 fixed
2020-03-26 16:44:14 +03:00
Ilya Goncharov
e8df15ac27 [Gradle, JS] Support file npm dependencies
#KT-37207 fixed
2020-03-26 16:43:55 +03:00
Pavel Punegov
ad20deb0b3 Ignore Java-sepcific test in Native 2020-03-26 13:26:17 +03:00
Nicolay Mitropolsky
2eb6f1988d Uast: process catch parameters and finally blocks (KT-35804) 2020-03-26 12:55:45 +03:00
Nicolay Mitropolsky
f1d5570ca1 Uast: include parameters of reified methods to uast tree (KT-37613) 2020-03-26 12:55:44 +03:00
Mark Punzalan
4234fa79c0 [JVM IR] Use append(Char) for 1-length string literals in string
templates and plus concatenations.

This is slightly more efficient and mirrors the behavior of the non-IR
backend for templates (but not for plus concatenations).

#KT-36638 Fixed
2020-03-26 12:39:39 +03:00
Igor Yakovlev
bd9877cc62 Rename testdata from DestructuringDeclarations to DestructionDeclarations 2020-03-26 12:35:49 +03:00
Igor Yakovlev
3bf1fe7a9d Reword Destructuring declarations to Destruction declarations in UI
Fixed #KT-37487
2020-03-26 12:35:48 +03:00
Dmitry Petrov
9a95941ef3 JVM_IR: Rewrite '?.' and '?:' chains
This shortens code and avoids unnecessary boxing in some cases.
2020-03-26 12:19:25 +03:00
Vladimir Ilmov
1d305d56b9 (CoroutineDebugger) DebuggerListener service added to 192/as36 2020-03-26 09:53:16 +01:00
Ilya Kirillov
f9377196f8 Wizard: fix 191 test compilation 2020-03-26 11:47:45 +03:00
Mikhail Glukhikh
547bb64b18 Fix BB test auto-generation (ignore backend FIR) 2020-03-26 10:31:14 +03:00
Juan Chen
aba7706dec [FIR] fix test module set up (this fixes 193 BB tests)
Added creation and initialization of the test module and its dependencies.
When looking at the emptyProgression test,
I found that getProgressionLastElement was not found,
which should be resolved from the dependencies.
2020-03-26 10:30:47 +03:00
Ilya Kirillov
eb958100ac Wizard: do not show validation error on parent module 2020-03-26 10:08:55 +03:00
Ilya Kirillov
393af3669f Wizard: do not suggest NativeConsoleApplicationTemplate to non-desktop targets 2020-03-26 09:53:32 +03:00
Ilya Kirillov
d58d3d06f5 Wizard: add better exception message when template not found 2020-03-26 09:39:20 +03:00
Ilya Kirillov
9fc1220b99 Wizard: move core module UI texts to bundles 2020-03-26 09:39:19 +03:00
Ilya Kirillov
80bae578bf Wizard: move UI texts to bundles 2020-03-26 09:39:17 +03:00
Ilya Kirillov
927ccf2ab1 Wizard: fix 192 tests 2020-03-26 09:39:17 +03:00
Ilya Kirillov
f767fd50e8 Wizard: add scroll bar to the project templates list 2020-03-26 09:39:16 +03:00
Ilya Kirillov
1504e607f9 Wizard: remove unneeded project templates & rearrange others 2020-03-26 09:39:15 +03:00
Ilya Kirillov
670a98c8bf Wizard: fix UI layout 2020-03-26 09:39:14 +03:00
Ilya Kirillov
2d9dc2994b Wizard: fix skip last step hack on mac 2020-03-26 09:39:13 +03:00
Ilya Kirillov
ab59657e61 Wizard: Fix MPP mobile application template 2020-03-26 09:39:12 +03:00
Ilya Kirillov
e98b0782c1 Wizard: add packForXCodeTaskGeneration 2020-03-26 09:39:10 +03:00
Ilya Kirillov
0ab91821c8 Wizard: use IJ wrappers for Velocity 2020-03-26 09:39:09 +03:00
Ilya Kirillov
3cd55b7827 Wizard: do not specify Kotlin version only for Android modules 2020-03-26 09:39:08 +03:00
Ilya Kirillov
fd6f7f9a7c Wizard: minor, remove unused code 2020-03-26 09:39:08 +03:00
Ilya Kirillov
941cb6247e Wizard: fix module dependencies button tooltip 2020-03-26 09:39:07 +03:00
Ilya Kirillov
b2423c1096 Wizard: render module kind in module dependencies chooser 2020-03-26 09:39:06 +03:00
Ilya Kirillov
545abcc667 Wizard: do not allow to modify common project name 2020-03-26 09:39:05 +03:00
Ilya Kirillov
b169d260d3 Wizard: add MPP mobile application project skeleton 2020-03-26 09:39:04 +03:00
Ilya Kirillov
732154cef5 Wizard: add mpp mobile library template 2020-03-26 09:39:03 +03:00
Ilya Kirillov
d9a88b4156 Wizard: add description for templates in ui 2020-03-26 09:39:02 +03:00
Ilya Kirillov
2696ee75a0 Wizard: update project & module templates texts 2020-03-26 09:39:01 +03:00
Ilya Kirillov
7cc18ee4f5 Wizard: update project template texts 2020-03-26 09:39:00 +03:00
Ilya Kirillov
24d53d5d08 Wizard: remove unused project tags 2020-03-26 09:38:59 +03:00
Ilya Kirillov
d2c8ca9230 Wizard: do not allow to edit module name when it is an only root module 2020-03-26 09:38:58 +03:00
Ilya Kirillov
67034546ae Wizard: do not show drop down component if it has <= 1 possible values 2020-03-26 09:38:57 +03:00
Ilya Kirillov
1cc86b9c89 Wizard: rework build system type component so it fits when UI design 2020-03-26 09:38:56 +03:00
Ilya Kirillov
e2241aef88 Wizard: fix layout 2020-03-26 09:38:55 +03:00
Ilya Kirillov
9435b386ce Wizard: add module dependencies to UI 2020-03-26 09:38:54 +03:00
Ilya Kirillov
cca4384371 Wizard: add JPS project settings on the first step 2020-03-26 09:38:54 +03:00
Ilya Kirillov
0dc0c41842 Wizard: move pom settings to the first phase 2020-03-26 09:38:53 +03:00
Ilya Kirillov
c71972afc9 Wizard: don't show error dialog on validation, instead navigate to the error 2020-03-26 09:38:52 +03:00
Ilya Kirillov
f640477464 Wizard: fix layout 2020-03-26 09:38:51 +03:00
Ilya Kirillov
baba12a671 Wizard: fix preview tree size 2020-03-26 09:38:50 +03:00
Ilya Kirillov
d7674350e8 Wizard: remove unneeded validation-related code 2020-03-26 09:38:49 +03:00
Ilya Kirillov
4bfea41239 Wizard: fix layout on second step 2020-03-26 09:38:48 +03:00
Ilya Kirillov
f3ca37fbac Wizard: flatten second UI step to fit new UI 2020-03-26 09:38:47 +03:00
Ilya Kirillov
586917ef3d Wizard: add project preview 2020-03-26 09:38:46 +03:00
Ilya Kirillov
5e2c762501 Wizard: use built-in browse folder button for path component 2020-03-26 09:38:45 +03:00
Ilya Kirillov
cbfe05efc8 Wizard: place all settings of first step into one setting list 2020-03-26 09:38:44 +03:00
Ilya Kirillov
586b044235 Wizard: add project name and path to the first step 2020-03-26 09:38:43 +03:00
Ilya Kirillov
cf7bbdde10 Wizard: do not pass writer to ModulesToIRsConverterData 2020-03-26 09:38:42 +03:00
Ilya Kirillov
45b01f7fc4 Wizard: add module dependencies to modules from jvm -> jvm dependencies 2020-03-26 09:38:41 +03:00
Ilya Kirillov
356dc2ad42 Wizard: do not show double label on checkbox setting 2020-03-26 09:38:40 +03:00
Ilya Kirillov
db6dfbbb9f Wizard: rename ReadingContext -> Reader, WritingContext -> Writer 2020-03-26 09:38:39 +03:00
Ilya Kirillov
f1741a4d1b Wizard: do not require to default settings to be present in yaml 2020-03-26 09:38:38 +03:00
Ilya Kirillov
a16cb7b74d Wizard: add option to enable Java support for JVM targets
#KT-36179 fixed
2020-03-26 09:38:37 +03:00
Ilya Kirillov
691ee7412a Wizard: all context operations to read/write operations 2020-03-26 09:38:36 +03:00
Ilya Kirillov
81c7cb20f3 Wizard: minor, move out module validators from Module class 2020-03-26 09:38:35 +03:00
Ilya Kirillov
a88a19a1b9 Wizard: migrate tests to Kotlin 1.3.70 2020-03-26 09:38:34 +03:00
Ilya Kirillov
693e12d826 Wizard: minor, remove unused functions 2020-03-26 09:38:33 +03:00
Ilya Kirillov
2460f6cfe6 Wizard: remove unused error types 2020-03-26 09:38:32 +03:00
Ilya Kirillov
98faaf9eba Wizard: make YamlParsingError to be exception error 2020-03-26 09:38:31 +03:00
Ilya Kirillov
00d8045adc Wizard: correctly check for Kotlin compiler version is snapshot 2020-03-26 09:38:30 +03:00
Ilya Kirillov
51f71a4e33 Wizard: do not use apache maven Version classes 2020-03-26 09:38:29 +03:00
Ilya Kirillov
377cdfdb2d Wizard: exclude new wizard from AS build 2020-03-26 09:38:28 +03:00
Ilya Kirillov
38ff41a524 Wizard: move settings to separate package 2020-03-26 09:38:21 +03:00
Ilya Kirillov
2fa0e7490f Wizard: minor, remove unused functions 2020-03-26 09:38:20 +03:00
Ilya Kirillov
4ef01aea3f Wizard: minor, commonize settings initialization with default values 2020-03-26 09:38:19 +03:00
Ilya Kirillov
42529ec525 Wizard: add test infrastructure, project importing tests & project templates tests 2020-03-26 09:38:17 +03:00
Ilya Kirillov
2f30195a6d Wizard: add some basic IOs module configurator 2020-03-26 09:38:16 +03:00
Ilya Kirillov
275212b6a9 Wizard: introduce Android module type 2020-03-26 09:38:15 +03:00
Nikolay Krasko
034af78b0f Fix mass build-failure because of bad dependencies in :compiler:visualizer module
Rename raw-fir:common to raw-fir:common -> raw-fir:fir-common.

If there's dependency both on :compiler:visualizer:common and
:compiler:fir:raw-fir:common, only one of artifact is left in classpath
2020-03-26 01:21:37 +03:00
Vladimir Dolzhenko
01c36d19bb Fix StartupActivities those do not require dumb awareness
Relates to #KT-35918
2020-03-25 22:50:57 +01:00
Philippe Ombredanne
3abf9b4c0f Remove Apache notice added to LGPL license text
Somehow an Apache-2.0 license notice with a JetBrains copyright that had
been pasted in the middle of the LGPL license text.
This removes this notice and restores the pristine, unmodified license
text.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
2020-03-26 00:31:35 +03:00
Toshiaki Kameyama
a96cafe066 Extract property: do not suggest duplicate property name
#KT-36504 Fixed
2020-03-25 22:19:26 +01:00
Vladimir Dolzhenko
dc949658d6 Lookup super methods under progress in find usages
Do not try to lookup super methods if named declaration does not have `override` keyword

#KT-18472 Fixed
2020-03-25 17:26:12 +00:00
Vladimir Dolzhenko
95c438fa21 Fix KotlinConfigurationCheckerService alias for 192
Relates to #KT-36471
2020-03-25 18:23:51 +01:00
Ilya Goncharov
b04844d583 [Gradle, JS] Actualize Node and Yarn versions
#KT-37762 fixed
2020-03-25 19:50:44 +03:00
Dmitry Gridin
3a5deaac09 i18n, konan: fix bundles
#KT-37483
2020-03-25 23:43:34 +07:00
Mikhail Glukhikh
afa7899799 Regenerate compiler tests 2020-03-25 19:17:51 +03:00
Dmitriy Novozhilov
f18cef0a12 [FIR] Update ignore rules of generated backed tests for primitive 2020-03-25 18:07:28 +03:00
Dmitriy Novozhilov
75e2596b34 [FIR] Update imports in generated tree 2020-03-25 18:07:27 +03:00
Dmitriy Novozhilov
6c9dd8bb22 [FIR] Reorganize modules of raw fir builders 2020-03-25 18:07:27 +03:00
Dmitriy Novozhilov
0d6bb33f49 Update version of kotlinx-collections-immutable in dependencies 2020-03-25 18:07:27 +03:00
Roman Golyshev
b0bd39e715 KT-36068 Remove redundant commitAllDocuments calls
- Those calls seem to be redundant since the platform already
commits all documents before invoking any intention
- Also those calls are getting in the way of `Preview Intention` action
by requiring write action, which is not granted by the platform at
the moment
2020-03-25 17:52:29 +03:00
Kirill Shmakov
576948eded Share test debugging between IDEA and AS 2020-03-25 17:46:40 +03:00
Leonid Startsev
2bda31ac38 Exclude annotation properties in 'explicit visibility' api mode check
#KT-37432 fixed
2020-03-25 19:41:52 +05:00
Vladimir Dolzhenko
3c7085d0b7 Run KotlinConfigurationCheckerService.performProjectPostOpenActions under nonBlocking read
#KT-36471 Fixed
2020-03-25 15:37:36 +01:00
Vladimir Dolzhenko
fd0c4ac993 Enable run inspection pass after completion of general highlight pass for kotlin-specific project only
Relates to #KT-37553
2020-03-25 15:37:35 +01:00
Vladimir Dolzhenko
a6450dd67e Convert KotlinConfigurationCheckerComponent to service
Relates to #KT-36471
2020-03-25 15:37:33 +01:00
Dmitry Savvinov
abd20e3a90 Cache Library -> LibraryInfo mapping
With Klibs, creation of LibraryInfo isn't that cheap now -- it usually
involves inspecting files in roots, reading manifest and such (see for
example NativePlatformKindResolution.createLibraryInfo)
2020-03-25 17:23:36 +03:00
Dmitry Savvinov
7d5396ac95 Introduce ModuleInfo -> SdkInfo cache
This fixes KT-35050 properly by caching this mapping and preventing
inspecting dependencies multiple times.
2020-03-25 17:23:36 +03:00
pyos
be37e7135a Add a test for SMAPs with interleaved files 2020-03-25 14:03:32 +01:00
pyos
a3fe9034e2 JVM: refactor some SMAP-related classes
In particular, remove redundant copying from SMAPAndMethodNode (which
also fails for empty methods).
2020-03-25 14:03:32 +01:00
Denis Zharkov
e73b01f20c Regenerate tests 2020-03-25 15:36:21 +03:00
Denis Zharkov
5539ad8ce8 FIR: Fix data-flow for jumps between members of local classes
First of all, note that currently ControlFlowGraphBuilder instance is fully mutable
and shared between all local classes and top-level classes in the same thread

Before this change, previous node for member of local class
was defined as lastNode

And in the case of implicit types, lastNode might be in a middle of another
local class member that is being resolved right now.

See the test:
- "a.length" expression in `bar` should be resolved because smart cast happens
before the class declaration
- "b.length" expression in `bar` should be unresolved because smart cast happens
in a different function

The latter case has been working incorrectly, the call was errorenously
resolved because "lastNode" were pointed just before "bar()" call in "foo"
2020-03-25 15:36:19 +03:00
Denis Zharkov
5584b206c0 FIR: Store local class into scope before analyzing it 2020-03-25 15:36:18 +03:00
Denis Zharkov
d869ae7826 FIR: Make resolution logic for local classes the same as for top-level
Run different phases through common transformers sequentially
It should make code more reusable and may help with avoid common bugs
2020-03-25 15:36:17 +03:00
Denis Zharkov
8ea888a111 FIR: Fix getNestedClassifierScope for local classes 2020-03-25 14:54:45 +03:00
Denis Zharkov
7f1049736d FIR: Get rid of FirStatusResolveTransformer.Companion 2020-03-25 14:54:45 +03:00
Denis Zharkov
ce939903bb FIR: Prepare status resolution to local/anonymous classes 2020-03-25 14:54:45 +03:00
Denis Zharkov
6894962e3a FIR: Prepare type resolution phase for running on local classes 2020-03-25 14:54:45 +03:00
Denis Zharkov
b8fb83e34c FIR: Prepare supertypes computation to anonymous objects 2020-03-25 14:54:45 +03:00
Denis Zharkov
30c8a529a2 FIR: Create FirClass.runAllPhasesForLocalClass extension 2020-03-25 14:54:45 +03:00
Denis Zharkov
41f4c1a003 FIR: Extract LocalClassesNavigationInfo computation 2020-03-25 14:53:34 +03:00
Denis Zharkov
0ca45deeef FIR: Fork flow for anonymous initializer 2020-03-25 14:53:34 +03:00
Denis Zharkov
f119839891 FIR: Introduce DataFlowAnalyzerContext 2020-03-25 14:53:34 +03:00
Denis Zharkov
dd628bc64a FIR: Make val private in VariableStorage and optimize imports 2020-03-25 14:53:34 +03:00
Denis Zharkov
cdd7e41891 FIR: Support proper implicit return type computation for local classes 2020-03-25 14:53:34 +03:00
Denis Zharkov
94193c91a0 FIR: Refactor designated body transformers
The idea is making their mechanics more transparent and clear
Namely, we should move to the next level of designation only for declaration's content

Otherwise there might be some wrong steps when somebody just randomly
calls "transformElement" on the parent declaration.
For example, it happens for local classes when we resolve their supertypes, etc.
2020-03-25 14:49:28 +03:00
Denis Zharkov
1b974f9d65 FIR: Reformat FirDeclarationsResolveTransformer 2020-03-25 14:49:28 +03:00
Denis Zharkov
5c943fe581 FIR: Minor. Reformat file 2020-03-25 14:49:28 +03:00
Denis Zharkov
d21437e29d FIR: Prepare body transformers for local classes resolution
- Add outerBodyResolveContext
- Rename FirImplicitBodyResolveTransformer and generalize because it will be used for full body
resolution on local classes
2020-03-25 14:48:53 +03:00
Denis Zharkov
7927ef9f66 FIR: Extract BodyResolveContext from BodyResolveTransformerComponents
Its content is assumed to be changing and might be injected into
body resolver
2020-03-25 14:48:53 +03:00
Denis Zharkov
28f33822ab FIR: Drop unused FirApplyInferredDeclarationTypesTransformer 2020-03-25 14:48:53 +03:00
Denis Zharkov
eb154dce1e FIR: Refactor scopes structure in body resolution
- Split top-level scopes into file imports and type parameters
- Make type parameters to be a persistent list
2020-03-25 14:46:05 +03:00
Ilya Matveev
38b1a3d9f1 Update K/N: 1.4-M2-dev-15039 2020-03-25 18:22:06 +07:00
Mikhail Bogdanov
e975eedbfb Fix project leak through child test case disposable 2020-03-25 11:41:48 +01:00
Jinseong Jeon
cdf5a2a5a1 FIR: set dispatch receiver parameter for inner class's constructor. 2020-03-25 12:40:09 +03:00
pyos
4558d48481 JVM: add a language feature to omit *E between SMAP strata
Fixes #KT-37704
2020-03-25 10:33:59 +01:00
Natalia Selezneva
923a71f676 MainKtsScript: use absolute paths in definition classpath 2020-03-25 12:11:09 +03:00
Natalia Selezneva
87cd6160a9 build.gradle.kts: save gradle project roots per project
Otherwise they can be overwritten if multiple projects are open
Also do not overwrite them in KotlinDslScrtiptModelProcessor because it can be called multiple times during import
2020-03-25 12:11:09 +03:00
Natalia Selezneva
47d97902c1 KotlinDslScriptsModel: import models in case when script contains errors
^KT-37237 Fixed
2020-03-25 12:11:09 +03:00
Natalia Selezneva
73ca9d1b54 build.gradle.kts: report error to build tool window
Move errors found in KotlinDslScriptModels from Messages Toolwindow to Build Toolwindow
2020-03-25 12:11:08 +03:00
Natalia Selezneva
643e31b2e7 KotlinDslScriptsModel: parse location for exception
This is needed for navigation from build log
2020-03-25 12:11:08 +03:00
Natalia Selezneva
29de7535a6 KotlinDslScriptsModel: save script models right after getting model
Remove redundant DataService
2020-03-25 12:11:08 +03:00
Dmitriy Novozhilov
ae522a0375 [FIR] Use source elements instead of psi in ConversionUtils.kt 2020-03-25 11:35:44 +03:00
Dmitriy Novozhilov
318d029fb2 [FIR] Add light source elements to delegated constructor calls 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
badd156def [FIR] Fix some source elements in light tree fir builder 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
84ed3f5cf2 [FIR-TEST] Add validation of diagnostics for light tree tests 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
86e7faf639 [FIR] Add start offset and end offset to FirSourceElement 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
2c37627b15 [FIR] Add unified diagnostics for psi and light tree 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
1a3fef5fa1 [FIR] Switch names of FirDiagnostic and ConeDiagnostic 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
e6102599ce [FIR] Rename DefaultErrorMessagesFir 2020-03-25 11:35:43 +03:00
Dmitriy Novozhilov
caafe84611 [FIR-TEST] Get rid of FirDiagnosticsTestLightTreeHelper 2020-03-25 11:35:42 +03:00
Yaroslav Chernyshev
b13b6d86c7 [Gradle, Native] Advanced CocoaPods integration. 2020-03-25 11:20:01 +03:00
Jinseong Jeon
acbe3126b1 FIR: consider all functions in scope when computing dispatch receiver parameter. 2020-03-25 09:20:07 +03:00
Jinseong Jeon
de0c9a5c73 FIR: use dispatch receiver of the enclosing function if any. 2020-03-25 08:27:21 +03:00
Dmitriy Dolovov
a363a5be58 Gradle. Make nativeExtensions in KotlinCompilation optional 2020-03-25 09:29:27 +07:00
Dmitriy Dolovov
c2fa0b2017 Minor. Comments added 2020-03-25 09:29:16 +07:00
Dmitry Petrov
d3be0462b6 Fix callable reference to inline class constructor generation 2020-03-24 22:25:59 +03:00
Vladimir Dolzhenko
dfd42dae1f Revert back fetchAnalysisResultsForElement
Relates to #KT-37467
2020-03-24 18:58:38 +01:00
Ilya Goncharov
c527f8e117 [Gradle, JS] Do not check exit code
Because mocha don't make difference between infrastructure and runtime problems and failing tests
This reverts commit e6d39ce7
https://github.com/mochajs/mocha/issues/4216
2020-03-24 19:22:24 +03:00
Ilya Goncharov
930b69bef5 [Gradle, JS] Add checks on module name set before browser and nodejs
- Add outputModuleName for compilations

KT-32017
2020-03-24 19:05:45 +03:00
simon.ogorodnik
59393e06f0 [FIR-test] Mute tests with bad test-data 2020-03-24 18:58:19 +03:00
simon.ogorodnik
f83c20065d [FIR-test] Unmute passing tests, mostly fir2ir 2020-03-24 18:58:19 +03:00
simon.ogorodnik
27136ef8be [FIR] Support unsigned integer literals 2020-03-24 18:58:18 +03:00
simon.ogorodnik
0afbf25943 [FIR2IR] Implement JvmBackendClassResolver for boxing optimizer 2020-03-24 18:58:18 +03:00
simon.ogorodnik
d71939728a [FIR] Fix container source for class members 2020-03-24 18:58:18 +03:00
simon.ogorodnik
0acca52001 [FIR-Test] Unmute blackbox test 2020-03-24 18:58:18 +03:00
simon.ogorodnik
29dc45fb66 [FIR] Enable property delegate rendering in html dump 2020-03-24 18:58:17 +03:00
simon.ogorodnik
762861a2e9 [FIR] Adjust abbreviated type rendering in Html dump 2020-03-24 18:58:17 +03:00
simon.ogorodnik
5a3eefcba1 [FIR] Fix suspend functional type deserialization 2020-03-24 18:58:17 +03:00
simon.ogorodnik
4fac6d8fb5 [FIR] Fix abbreviated type deserialization 2020-03-24 18:58:17 +03:00
simon.ogorodnik
2ce697b0b2 [FIR] Resolve type parameter bounds in local class members 2020-03-24 18:58:17 +03:00
simon.ogorodnik
ae54815132 [FIR] Fix varargs of unsigned numbers 2020-03-24 18:58:17 +03:00
simon.ogorodnik
de4666cf0e [FIR] Fix loading 'is instance' contracts 2020-03-24 18:58:17 +03:00
Ilya Goncharov
4da31f1948 [Gradle, JS] Fix cast
#KT-32017 fixed
2020-03-24 17:43:37 +03:00
Ilya Goncharov
5492a93229 [Gradle, JS] Module name for js
#KT-32017 fixed
2020-03-24 17:43:37 +03:00
Ilya Goncharov
19afcd7b6b [Gradle, JS] Introduce semver satisfying for comparison with wildcard 2020-03-24 17:38:17 +03:00
Vladimir Dolzhenko
5441685cb4 Provide idea.platform.prefix in run configurations for 201+ 2020-03-24 14:26:35 +00:00
Ilya Goncharov
eabd8cfb5f [Gradle, JS] KT-37587 Dynamic resolve of karma.config.d 2020-03-24 17:05:16 +03:00
Pavel Kirpichenkov
adf3351a8b [NI] Don't skip constraints with projections during variable fixation
Those constraints are only restored for variable fixation stage because of the
influence on pefrormance.

^KT-37650 Fixed
^KT-37380 Fixed
2020-03-24 16:13:49 +03:00
Victor Turansky
1f6834538b KT-37587 Karma. Revert input check for 'webpack.config.d' directory 2020-03-24 15:52:52 +03:00
Victor Turansky
4cd4dfee25 KT-37587 Karma. Support dynamically created webpack configs 2020-03-24 15:52:52 +03:00
Ilya Goncharov
7736e5f4a7 [Gradle, JS] Run tasks for legacy target 2020-03-24 15:42:07 +03:00
Roman Golyshev
85bfbaa8a8 Check if returned typeParameters are null
- See EA-141456, EA-212070
2020-03-24 15:23:34 +03:00
Ilya Matveev
4171dd511f Gradle, native: Fix generating platform libs for Windows 2020-03-24 18:54:12 +07:00
Ilya Matveev
6c146f6448 Update K/N version: 1.4-M2-dev-14898 2020-03-24 18:54:12 +07:00
Ilya Matveev
38b5414f30 Gradle, native: Actualize stacktrace format in tests 2020-03-24 18:54:12 +07:00
Ilya Matveev
a51230d307 Gradle, native: Support reinstalling K/N compiler
Sometimes a user may need to invalidate all precompiled
caches and regenerate all platform libraries. For example
this may be necessary after updating Xcode since platform
libraries are generated on basis of Xcode frameworks.

This patch provides a simple setting allowing a user
to manually reinstall a K/N compiler.
2020-03-24 18:54:11 +07:00
Ilya Matveev
27f5c577c9 Gradle, native: Generate platform libraries at the user side
Since 1.4, a regular K/N distribution will not contain prebuilt
platform libraries, so the libraries must be generated at the
user side.

This patch adds support for such generation to the MPP Gradle
plugin. The generation itself is performed by separate utility
provided by the K/N compiler distribution. The plugin checks
existence of platform libraries for required targets and starts
this utility if some some of these libraries are missing. Building
caches for platform libraries is also performed at this step.

The patch also adds some project properties allowing a user to
workaround potential problems. User will be able to:
  - Use a special distribution with prebuilt platform libraries.
  - Force building platform libraries in the good old sourcecode mode
    in case of some issues with the new metadata mode.

Kotlin/Native counterpart: https://github.com/JetBrains/kotlin-native/pull/3829.

Issue #KT-32931 Fixed
2020-03-24 18:54:11 +07:00
Mikhail Bogdanov
64a4d09bb3 Add basic synchronization workaround for scratch 2020-03-24 10:58:58 +01:00
Pavel Kirpichenkov
dc18c62dbc [NI] Filter out type variable from its dependencies
Don't take into account complex variable dependency on itself when determining fixation status.
^KT-37621 Fixed
2020-03-24 12:49:18 +03:00
Dmitry Gridin
7f6124254f Remove redundant plugin-common.xml.191 2020-03-24 09:35:12 +00:00
Dmitry Gridin
32dba0afa2 Move implementation of runForWholeFile field to xml 2020-03-24 09:35:11 +00:00
Dmitry Gridin
f92936ae12 AbstractKotlinInspection: fix suppressor
#KT-37576 Fixed
2020-03-24 09:35:10 +00:00
Dmitry Gridin
eaa21f86c4 QuickFixTest: all inspections should be initialized from EP 2020-03-24 09:35:10 +00:00
Dmitry Gridin
84c9929935 i18n: NativeDefinitions: remove redundant bundle
#KT-37483
2020-03-24 16:18:05 +07:00
Mikhail Glukhikh
03143bc788 [FIR2IR] Implement mapping of FIR & IR built-in class members 2020-03-24 12:15:18 +03:00
Dmitry Petrov
afacb4b4b2 KT-37604 Use proper type when generating constructor call 2020-03-24 11:31:47 +03:00
Victor Turansky
95857c5af4 KT-34468 Yarn. Add entry registry 2020-03-24 11:28:02 +03:00
Victor Turansky
35e3691d6c KT-34468 Yarn. Lock file check at the beginning 2020-03-24 11:28:02 +03:00
Victor Turansky
8cd23dfc9a KT-34468 Yarn. Remove redundant collection creation 2020-03-24 11:28:02 +03:00
Victor Turansky
21cd5086ed KT-34468 Yarn. Named parameters for NpmDependency 2020-03-24 11:28:02 +03:00
Victor Turansky
6931b37a79 KT-34468 Yarn. Dependency search key calculated once 2020-03-24 11:28:02 +03:00
Victor Turansky
0d1bf66c2a KT-34468 Yarn. Star version support fix 2020-03-24 11:28:02 +03:00
Victor Turansky
d494881cb9 KT-34468 Yarn. Dependency check at the beginning 2020-03-24 11:28:02 +03:00
Victor Turansky
c2b3dd8b33 KT-34468 Yarn. Support dependency GitHub version 2020-03-24 11:28:02 +03:00
Dmitry Gridin
afb8ff1dd5 i18n: NativeDefinitions: add getter to property
#KT-37483
2020-03-24 15:25:53 +07:00
Mikhail Zarechenskiy
ec4d9d2f1f [NI] Prefer between two complex variables one with proper lower bounds
This reverts commit d4d35bb766.
2020-03-24 11:13:55 +03:00
Mikhail Glukhikh
a4c7619c89 [FIR2IR] Introduce & use FirBuiltInsPackageFragment
Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
2020-03-24 10:37:53 +03:00
Dmitriy Dolovov
01558f48ae KLIB: Clean-up AbstractKlibLibraryInfo API 2020-03-24 13:37:51 +07:00
Dmitriy Dolovov
c9245ef497 IDE: Port JS to use the same KLIB utilities as Native & Common 2020-03-24 13:37:38 +07:00
Dmitriy Dolovov
e81479e30b KLIB: Avoid check for KLIBs w/o components for other platforms than Native 2020-03-24 13:37:26 +07:00
Sergey Igushkin
ad1a1ac49a Fix failures when a common source set compiled to nothing (KT-36674)
This could happen:
* when a common source set had no sources
* when the compile task of a common source set was disabled

In those cases, there were two subsequent failures:
* the metadata JAR could not interpret the missing klib file as ZIP
* the consumer could not read the empty klib in its dependencies

Issue #KT-36674 Fixed
2020-03-24 01:48:34 +03:00
Sergey Igushkin
066d413fb8 Add a test for host-specific metadata publishing and consumption 2020-03-24 01:48:34 +03:00
Sergey Igushkin
2478a57646 Rework source sets metadata consumption
* Add `ResolvedMppVariantsProvider` that provides variant names,
  platform artifacts, and metadata artifacts for MPP dependencies

* Rework SourceSetVisibilityProvider.kt so that it uses the
  `ResolvedMppVariantsProvider` to determine which source sets should be
  read from which metadata artifacts

* Rework `GranularMetadataTransformation` and its consumers so that:

  * it uses the
    visibility result and extracts the source set metadata from the
    host-specific artifacts whenever `SourceSetsVisibilityProvider`
    yields host-specific artifacts in the visibility results

  * it uses the new Gradle API for resolutionResults / artifactView

* Rework module IDs in the code base, unify the logic of their
  construction, also fix possible false-positive visibility in
  `applyToConfiguration` that used a module ID that mismatched the
  published module ID.
2020-03-24 01:48:33 +03:00
Sergey Igushkin
33ef4452b7 Always create shared-Native metadata compilations
Create the compilations even when all of the targets that the
shared-Native source set is compiled for are disabled on the current
host. In that case, disable the compilation task

Also clear the inputs of the disabled tasks so that when Gradle builds
the task graph it doesn't resolve the dependencies.

Otherwise, a Gradle build that includes the compile tasks of the
disabled targets in the task graph would fail as follows, e.g. on a
macOS host with a project containing a mingw target):

```
Could not determine the dependencies of task ':compileKotlinMingwX86'
...
Could not resolve all task dependencies for configuration
':mingwX86CompileKlibraries'
...
Could not find com.example:my-dependency-mingwx86:1.0
...
2020-03-24 01:48:33 +03:00
Sergey Igushkin
593869aa37 Fix incorrect unchecked cast in kotlin.metadata()
It was broken once the metadata target got K/N compilations along with
K2Metadata compilations.
2020-03-24 01:48:33 +03:00
Sergey Igushkin
94e3fa2132 (minor) Extract constants for XML nodes in project structure metadata 2020-03-24 01:48:33 +03:00
Sergey Igushkin
f30aada84a If a source set is host-specific, publish it within the Native modules
Consider host-specific all source sets that participate in a compilation
of a target that cannot be built on some of the hosts.

Exclude those source sets from the `-metadata` artifact since the
`metadata` target must publish in the same way from any host.

Instead, add a metadata variant to those targets which use such a source
set and pack the source set's klib into a similar metadata JAR as the
artifact of those metadata variants.
2020-03-24 01:48:32 +03:00
Ilya Gorbunov
d7007044c2 Add a note about the Random(...) generators being not thread-safe 2020-03-24 01:37:03 +03:00
Ilya Chernikov
44ffed9590 Approximate only types substituted with captured types
properly fixes #KT-37389
#KT-37389 fixed
#KT-37644 fixed
2020-03-23 22:58:45 +01:00
Martynas Sateika
49ae3c3db0 Supply missing 'project' argument to ReplaceWith replacement 2020-03-23 21:46:50 +03:00
Vladimir Dolzhenko
a832c12550 Fetch analysis results if it is available
Relates to #KT-37467 and #KT-37515
2020-03-23 14:49:47 +00:00
Vladimir Dolzhenko
0073d260f8 Fix incremental analysis for whitespaces
incremental analysis could ignore whitespace iff old item was whitespace

#KT-37629 Fixed
2020-03-23 14:46:55 +00:00
Vladimir Dolzhenko
8935c600c1 Add checkCanceled on find usages execution path
#KT-36138 Fixed
2020-03-23 14:46:13 +00:00
Mads Ager
baf1f56859 [JVM_IR] Rebase test of string concatenation codegen.
The JVM IR backend code seems saner to me. The string concatenation
lowering for JVM IR calls the stringPlus intrinsic if there are
only two arguments. That leads to a lot less code:

```
load string
load argument
box argument
call Intrinsics.stringPlus
```

instead of

```
allocate StringBuilder
call StringBuilder.<init>
load string
call StringBuilder.append
load argument
call StringBuilder.append
call StringBuilder.toString
```

This will lead to more boxing, but a lot smaller code. We still
use StringBuilders in JVM IR if there are more than two strings
being concatenated.
2020-03-23 16:42:53 +03:00
Mikhail Zarechenskiy
1cf970b110 Revert "Minor. Specify type arguments explicitly"
This reverts commit 2e9075115b.
2020-03-23 16:39:22 +03:00
Mikhail Zarechenskiy
191fb02bf6 [NI] Consider intersection type with number type as Nothing
Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*>

 #KT-37302 Fixed
2020-03-23 16:39:21 +03:00
Mikhail Zarechenskiy
b23aff4d0d [NI] Type-check lambda arguments against approximated type
It's required as we analyze lambda with the approximated type too
2020-03-23 16:39:20 +03:00
Mikhail Zarechenskiy
72ce4eb5ee Minor, replace fields with getters to avoid leaking "this" inspection 2020-03-23 16:39:19 +03:00
Ilya Goncharov
e6d39ce785 [Gradle, JS] True on check exit code in mocha
#KT-37668 fixed
2020-03-23 15:36:52 +03:00
Nick
abcd6bd528 [FIR] Support diagnostic SUPER_IS_NOT_AN_EXPRESSION 2020-03-23 15:14:06 +03:00
Mikhail Glukhikh
ca22e05acd [FIR2IR] Support safe calls 2020-03-23 15:13:50 +03:00
Mikhail Glukhikh
2e8b22e4be [FIR2IR] Use wrapped property accessor descriptors for accessors 2020-03-23 15:13:33 +03:00
Mikhail Glukhikh
92ac1d3f3d FIR: use FirDefaultPropertyAccessor if no body also in lightTree builder 2020-03-23 15:13:17 +03:00
Jinseong Jeon
e46a4246d2 FIR: regard property accessor without body as FirDefaultPropertyAccessor 2020-03-23 15:12:54 +03:00
Roman Elizarov
e26a3ad033 Speed up stdlib readLine function (#3185)
There are several performance optimizations:

* ByteBuffer/CharBuffer/StringBuilder objects pre-allocated and are
  reused on each call to readLine.
* The state for readLine is lazily allocated via JVM classloading
  (using a singleton object).
* There is an auto-detection heuristic for "directEOL" encodings which
  represent LF ('\n') directly as the corresponding byte
  (UTF-8 and many single-byte encodings are like that).
  When "directEOL" encoding is used, then bytes are batched into
  ByteBuffer for a single call to CharsetDecoder.decode which
  results in higher throughput. Otherwise (UTF-16, etc), slower
  byte-by-byte approach is used.
* Bytes and chars are directly moved in/out of byte/char arrays and
  ByteBuffer/CharBuffer wrappers are used only to interface with
  JVM CharsetDecoder class (which is the slowest piece).
* StringBuilder is not used at all for short lines (<=32 chars).

There are also some function improvements to readLine functionality:

* Restriction on "max chars per byte" is lifted, so readLine works with
  all encodings that JVM supports.
* It support on-the-fly changes to system default charset, because
  it rechecks current charset on each call and updates it decoder
  when needed.

All the other features of readLine function are retained:

* It does not read more bytes from System.in than needed, so it
  is compatible with other ways to read System.in. On-the-fly
  changes to System.in are supported.
* It is thread-safe. Its internal mutable state is protected by
  synchronization.
* There is an internal method for tests that supports explicit
  charset specification, but the name of this method has changed.

There are additional tests:

* Check all supported encodings on JVM to make sure that readLine
  works correctly with them all.
* Check unicode code points of different bits length with all standard
  unicode encodings (UTF-8, UTF-16, and UTF-32 in LE/HE byte orders).

Benchmarks that compare different implementations of readLine,
including this one (readLine6NoLV in the set) can be found here:
https://github.com/elizarov/ReadLineBenchmark

Taking BufferedReader as 100% baseline we see that:

* Current readLine is 7.5 times slower than BufferedReader baseline.
* New implementation in this commit is 2.5 timer slower than baseline.
  It is ~3 times faster than existing implementation of readLine.

Altogether these optimizations are enough to enable reading of
~500K lines in sports programming setting under 2s time-limit with
plenty of headroom in time. Example that is using this version of
readLine can be found here:
https://codeforces.com/contest/1322/submission/73005366

#KT-37416 Fixed
2020-03-23 14:36:55 +03:00
Mikhail Bogdanov
aae6319c39 Minor. Specify test runner to support parallel test execution 2020-03-23 12:27:52 +01:00
Vladimir Ilmov
cd12226f20 (CoroutineDebugger) Alternative CoroutineInfoProvider added
Added way to retrieve coroutine information without an agent
in target JVM. 'kotlin.debugger.coroutines.switch' provides
two possibilities to test coroutines.
Agent way gets activated once kotlinx.coroutines.debug.DebugProbes
started with javaagent.
Library-less ways use DispatchedContinuation or ChildContinuationImpl
classes to retrieve coroutine information and stack traces.
2020-03-23 12:27:07 +01:00
pyos
ac6036f366 JVM_IR: move state machine generation to ClassCodegen 2020-03-23 12:23:17 +01:00
pyos
bc37a87974 JVM_IR: produce better debug messages on inlining failures
That's the only thing `compilationContextDescriptor` is used for; it
clearly shouldn't point to the callee, but to the caller.
2020-03-23 12:23:17 +01:00
pyos
b317187f20 JVM_IR: buffer method bytecode in FunctionCodegen 2020-03-23 12:23:17 +01:00
pyos
f6e7d7f7f1 JVM_IR: refactor FunctionCodegen a bit 2020-03-23 12:23:17 +01:00
pyos
df5c5b163e JVM_IR: refactor ClassCodegen a bit 2020-03-23 12:23:17 +01:00
Andrey Uskov
79ec081bbf Add changelog for 1.4-M1 2020-03-23 13:50:16 +03:00
Dmitriy Dolovov
03cd229784 IDE perf tests for K/N: Drop redundant check for CommonLibraryKind 2020-03-23 16:49:58 +07:00
Dmitry Petrov
b0e916769d Add test for KT-37570 2020-03-23 12:27:58 +03:00
Dmitriy Dolovov
f46fc7d848 IDE: Fix i18n for KlibMetaFileType 2020-03-23 15:39:33 +07:00
Dmitriy Dolovov
f4aa0fad44 IDE: Unify creation of KLIB package fragment providers (common, native) 2020-03-23 15:39:27 +07:00
Dmitriy Dolovov
bf4a153c0c IDE: Use CachingIdeKlibMetadataLoader in Native & Common KLIB analysis 2020-03-23 15:39:21 +07:00
Dmitriy Dolovov
c8a9b88504 IDE: Refactor NativePlatformKindResolution & NativeResolverForModuleFactory 2020-03-23 15:39:05 +07:00
Dmitriy Dolovov
98877eb87e IDE: Rename NativeLibraryInfo to NativeKlibLibraryInfo 2020-03-23 15:38:59 +07:00
Dmitriy Dolovov
816db96113 IDE: Drop NativeLibraryInfo.NATIVE_LIBRARY_CAPABILITY 2020-03-23 15:38:53 +07:00
Dmitriy Dolovov
5f7a6d55a8 KLIB: Fix compilation 2020-03-23 15:38:46 +07:00
Dmitry Savvinov
26ab9b4fc9 Move Klib-related logic from idea-native module 2020-03-23 15:38:40 +07:00
Dmitry Savvinov
417554dca0 Move .klib files from KotlinNativeFileTypeFactory to Kotlin-wide one 2020-03-23 15:38:32 +07:00
Dmitry Savvinov
987e1019a8 Rename everything non-Native specific to Klib 2020-03-23 15:38:26 +07:00
Dmitry Savvinov
b6d811c69c Extract common logic of detecting klibs and creating LibraryInfo by klib 2020-03-23 15:38:19 +07:00
Dmitry Savvinov
6ccb8cd0a3 Properly check platform of klib by reading manifest 2020-03-23 15:38:11 +07:00
Georgy Bronnikov
4742057b51 IR: generate lambdas in place in Psi2Ir
even when arguments are to be rearranged.
Lambdas have no side effects, and storing them in temporary variables
prevents processing in the backend
(such as inserting continuation parameter in AddContinuationLowering).
2020-03-23 11:09:30 +03:00
nataliya.valtman
915e6107d1 make Bootstrap option available in buildSrc 2020-03-23 08:43:06 +03:00
Vladimir Dolzhenko
344dbeffe8 Fix IntentionTestGenerated$IntroduceImportAlias.testConflictPackage
Fix test data as find usages can handle import aliases

Relates to #KT-18619
2020-03-22 15:30:49 +01:00
Mikhail Zarechenskiy
d4d35bb766 Revert "[NI] Prefer between two complex variables one with proper lower bounds"
This reverts commit ced8a92629.
2020-03-22 17:16:22 +03:00
Vladimir Dolzhenko
f82e2db65d Fix effective search scope for find references
Relates to #KT-18619
2020-03-22 10:19:33 +01:00
Dmitriy Novozhilov
6ce8d661ad [FIR] Add nullability to ILT. #KT-37639 Fixed 2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
006e1f6528 [FIR-TEST] Add test for KT-37638 2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
5f9f01fe4e [FIR] Implement new completion mode calculator
Note that `testDelegates` now fails due to KT-37638 and
    `testSimpleIn` fails due to problems with type parameters
    of inner classes
2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
ea02855ba6 [FIR] Fix type arguments and substitution for flexible types 2020-03-20 23:11:28 +03:00
Dmitriy Novozhilov
7bfe7061e7 [FIR] Add proper nullability for java enums 2020-03-20 23:11:28 +03:00
Nikolay Krasko
7764492761 Resolve failure with surefire on Windows agents in kotlin-java-example (KT-37654)
Remove version specification like it's done in other modules.
2020-03-20 21:14:23 +03:00
Leonid Startsev
f0dc809255 Add explicit api mode flag to top-level kotlin {} DSL block in Gradle
for both MPP and single-target projects.

For now, it is only applied to source sets that are connected to 'main'
compilation. It seems fine for all projects except android ones.
There's a way to determine android variant for source set,
but importing android projects seems to be made via other code path.

 #KT-36019 Fixed
 #KT-37652 Open
2020-03-20 19:41:06 +03:00
Ilya Goncharov
59148cdce4 [Gradle, JS] Fix extracting package json from klib
#KT-37636 fixed
2020-03-20 19:18:02 +03:00
max-kammerer
a3125849a0 Merge pull request #3204 from pyos/ir/fix-lambda-inner-classes
JVM_IR: restore InnerClasses for objects in lambdas
2020-03-20 17:15:41 +01:00
Ilya Goncharov
40a0e31be4 [Gradle, JS] Add other devtools
#KT-37635 fixed
2020-03-20 19:13:24 +03:00
Ilya Goncharov
5058c396c1 [Gradle, JS] Webpack devtool as a String
#KT-37635 fixed
2020-03-20 19:13:00 +03:00
Vladimir Dolzhenko
e951f1a43a Find Usages and Go to declaration of element used via import alias
#KT-18619 Fixed
2020-03-20 14:59:24 +00:00
Mikhail Zarechenskiy
ced8a92629 [NI] Prefer between two complex variables one with proper lower bounds
#KT-37554 Fixed
2020-03-20 15:44:53 +03:00
Dmitriy Dolovov
b0254a27aa Fix. Provide the proper K/N dependencies in leaf HMPP source sets
Issue #MMPP-213
2020-03-20 19:43:18 +07:00
Dmitriy Dolovov
7f2839ee10 Fix. Don't inherit K/N dependencies in common source sets
Issue #MMPP-213
2020-03-20 19:43:08 +07:00
Dmitriy Dolovov
2d8bec19c0 Minor. Simplify generation of substituted dependencies 2020-03-20 19:42:56 +07:00
Dmitry Gridin
d84f528a47 KotlinSdkType: fix i18n for 192
#KT-37632 Fixed
#KT-37483
2020-03-20 17:38:22 +07:00
Natalia Selezneva
39d019ec9d Tests: switch ScriptChangeNotifier off in tests 2020-03-20 13:14:48 +03:00
Ilya Goncharov
dd7f10e76e [Gradle, JS] Fix after rebase 2020-03-20 12:55:50 +03:00
Ilya Goncharov
a07425e7b0 [Gradle, JS] Fix test 2020-03-20 12:45:29 +03:00
Ilya Goncharov
f7a9afbf96 [Gradle, JS] Remove produceExecutable from tests 2020-03-20 12:45:29 +03:00
Ilya Goncharov
3a262c6eb8 [Gradle, JS] Fix build for legacy browser with binaries 2020-03-20 12:45:29 +03:00
Ilya Goncharov
b25418df69 [Gradle, JS] Correct renaming 2020-03-20 12:45:29 +03:00
Ilya Goncharov
33992bdc86 [Gradle, JS] Extract common interface for JsBinary 2020-03-20 12:45:29 +03:00
Ilya Goncharov
3c83a3bd34 [Gradle, JS] Error if used binaries.executable in both compiler type 2020-03-20 12:45:28 +03:00
Ilya Goncharov
cf6b76fdee [Gradle, JS] Rename BuildVariantKind on KotlinJsBinaryType 2020-03-20 12:45:28 +03:00
Ilya Goncharov
260015fe0b [Gradle, JS] Migrate from build variants on binaries 2020-03-20 12:45:27 +03:00
Ilya Goncharov
e1920110a2 [Gradle, JS] Remove produceExecutable 2020-03-20 12:45:25 +03:00
Ilya Goncharov
01b44802c8 [Gradle, JS] Fix compilation after rebase 2020-03-20 12:45:24 +03:00
Ilya Goncharov
158ad630d9 [Gradle, JS] Fix tests 2020-03-20 12:45:24 +03:00
Ilya Goncharov
2b4f9302dc [Gradle, JS] Fix naming for webpack tasks
- while webpack is actual only for executable it is not necessary to add executable part
2020-03-20 12:45:24 +03:00
Ilya Goncharov
5828f8cbf2 [Gradle, JS] Rename KotlinBinaryContainer on KotlinTargetWithBinaries 2020-03-20 12:45:24 +03:00
Ilya Goncharov
19d09fc420 [Gradle, JS] Remove redundant build variants for IR 2020-03-20 12:45:24 +03:00
Ilya Goncharov
703ceff9a3 [Gradle, JS] Return binaries from ir target if it exists 2020-03-20 12:45:24 +03:00
Ilya Goncharov
2d900e2234 [Gradle, JS] Legacy tooling work with binaries and throw error on it 2020-03-20 12:45:24 +03:00
Ilya Goncharov
1bb6429c5c [Gradle, JS] Link tasks depends on compile tasks 2020-03-20 12:45:24 +03:00
Ilya Goncharov
0a19998ae2 [Gradle, JS] Binaries dsl 2020-03-20 12:45:23 +03:00
Ilya Goncharov
0c34acd09a [Gradle, JS] Produce executable for ir compilation 2020-03-20 12:45:23 +03:00
Ilya Goncharov
666b9b3545 [Gradle, JS] Move binaries on compilation level 2020-03-20 12:45:23 +03:00
Ilya Goncharov
efb3f16ee4 [Gradle, JS] Browser with binaries 2020-03-20 12:45:22 +03:00
Ilya Goncharov
2fed8aa7b8 [Gradle, JS] NodeJs on binaries 2020-03-20 12:45:09 +03:00
Ilya Goncharov
9bff6a709f [Gradle, JS] Add testExecutable for subtargets 2020-03-20 12:45:09 +03:00
Ilya Goncharov
625e94822f [Gradle, JS] Remove redundant baseName 2020-03-20 12:45:09 +03:00
Ilya Goncharov
d00c53fd38 [Gradle, JS] Fix strict type check 2020-03-20 12:45:09 +03:00
Ilya Goncharov
e3b5a754cd [Gradle, JS] Register executable tasks for binaries 2020-03-20 12:45:09 +03:00
Ilya Goncharov
9fe0604f00 Revert "[Gradle, JS] binaries API instead of produce*"
This reverts commit 055e98e9
2020-03-20 12:45:09 +03:00
Ilya Goncharov
eab6a7d038 [Gradle, JS] Register link tasks for binaries, not for compilations 2020-03-20 12:45:08 +03:00
Ilya Goncharov
ab218317de [Gradle, JS] Fix name for binary 2020-03-20 12:45:08 +03:00
Ilya Goncharov
e518998da3 [Gradle, JS] Remove KotlinJsIrType on BuildVariantKind 2020-03-20 12:45:08 +03:00
Ilya Goncharov
1de720cdd0 [Gradle, JS] Add link tasks to binaries, add test executable binary type 2020-03-20 12:45:08 +03:00
Ilya Goncharov
99d73d4c79 [Gradle, JS] binaries API instead of produce* 2020-03-20 12:45:08 +03:00
Ilya Goncharov
e2918bf6c8 [Gradle, JS] binaries.executable works for JS IR 2020-03-20 12:45:08 +03:00
Ilya Goncharov
3974300f22 [Gradle, JS] Simplify JsBinary 2020-03-20 12:45:08 +03:00
Ilya Goncharov
9d3234495e [Gradle, JS] Add binaries for javascript 2020-03-20 12:45:08 +03:00
Ilya Goncharov
c46fa83924 [Gradle, JS] Extract Binary Container from Native 2020-03-20 12:45:08 +03:00
Mikhail Glukhikh
9836520287 [FIR2IR] Generate synthetic bodies for Enum.values() and valueOf() 2020-03-20 11:55:34 +03:00
Mikhail Glukhikh
94fe79578e [FIR2IR] Generate unconditional branch in exhaustive whens 2020-03-20 11:55:34 +03:00
Ilya Goncharov
41f5a56cb3 [Gradle, JS] Fix delegates
#KT-37582 fixed
2020-03-20 10:32:44 +03:00
Ilya Goncharov
6605199ead [Gradle, JS] Back field to delegate
#KT-37582 fixed
2020-03-20 10:32:44 +03:00
Ilya Goncharov
a533fe26d7 [Gradle, JS] Non-nullable properties in KotlinWebpack with delegate
#KT-37582 fixed
2020-03-20 10:32:44 +03:00
Ilya Chernikov
831806fe2f Revert "Optimize MutableDiagnosticsWithSuppression"
Fixes flaky tests on windows:
QuickFixTestGenerated$Suppress$AnnotationPosition
  .testTopLevelFunctionSuppressOnFile
  .testTopLevelFunctionSuppressOnFileWithSuppress
2020-03-20 08:02:25 +01:00
Zalim Bashorov
4f042cbea5 [IDE KJS] Recognize and load correctly Kotlin/JS klibs in IDE
#KT-36276 Fixed
2020-03-20 01:28:48 +03:00
Zalim Bashorov
d07436c831 [IDE KJS] Move JsResolverForModuleFactory to proper place 2020-03-20 01:27:41 +03:00
Zalim Bashorov
eaac5bdac4 [IDE KN] Treat klib as Kotlin/Native library iff manifest contains builtins_platform==NATIVE 2020-03-20 01:27:41 +03:00
Vladimir Dolzhenko
d247dd21de Added missed :compiler:fir:checkers dependency for kotlin-plugin 2020-03-19 22:26:17 +01:00
Dmitriy Novozhilov
c4b8e94061 [FIR] Add utils for traversing control flow graph 2020-03-19 23:11:18 +03:00
Dmitriy Novozhilov
b88cb3f849 [FIR] Add visitors for control flow graph 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov
e4588c3dec [FIR] Add diagnostic component for control flow analysis 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov
9535df5e2e [FIR] Add owner to ControlFlowGraph 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov
496489cdf4 [FIR] Introduce CheckerContext for call and declaration checkers 2020-03-19 23:11:17 +03:00
Dmitriy Novozhilov
1c87601486 [FIR] Split ImplicitReceiverStack to mutable and immutable parts 2020-03-19 23:11:17 +03:00
Victor Petukhov
3b892fe31e NI: exclude reporting of an unsafe call diagnostic for implicit invoke after safe call in cases when invoke has type parameters (make NI and OI consistent)
^KT-37579 Fixed
2020-03-19 19:27:25 +03:00
Mikhail Bogdanov
8b330193ac Minor. Throw proper exception in test framework on directive processing 2020-03-19 16:45:11 +01:00
Mikhail Bogdanov
3f87899014 Switch converter test to new directive scheme 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov
d793fea8d2 Use multimap for directives 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov
420dd0d440 Extract directive map to separate class 2020-03-19 16:45:10 +01:00
Mikhail Bogdanov
bc214868ef Minor. Clean tests 2020-03-19 16:45:10 +01:00
Mikhael Bogdanov
ab7e71fd68 Support per files test directives 2020-03-19 16:45:10 +01:00
Mikhael Bogdanov
34547b4e27 Minor. Remove redundant getters 2020-03-19 16:45:10 +01:00
Vyacheslav Gerasimov
507b00ee77 201: Fix kotlin-compiler proguard 2020-03-19 18:13:51 +03:00
pyos
186302d84e JVM_IR: restore InnerClasses for objects in lambdas 2020-03-19 15:23:44 +01:00
Ilmir Usmanov
be87d5fab5 JVM_IR: Serialization: do not mess with return types of call expressions
If return type of IrConstructor is different from containing class, we will
generate call to wrong <init> method, leading to VerifyError.
If we do not specify the type of irNull, it, by default, will be Nothing?,
when really we need Any?. This leads to CCE: cannot cast to Void at runtime.
2020-03-19 15:18:32 +01:00
pyos
d06c87207c Dump class structure in a test that has an object in a lambda 2020-03-19 15:11:20 +01:00
pyos
e0a5ab7146 Do not regenerate objects if all captured lambdas are noinline 2020-03-19 15:11:20 +01:00
pyos
54e725668f Ignore reified type parameters when regenerating objects from lambdas
All reified type parameters referenced by objects in non-default lambdas
are from outside the inline call, thus they cannot be substituted yet.
This means if the only reason for object regeneration is reification,
then regeneration isn't actually necessary.

E.g. in this code:

    inline fun <reified T> f(x: () -> Unit) = x()
    inline fun <reified V> g() = f<V> { { println(V::class.simpleName) }() }

we first inline the lambda into f(), then inline f()-with-lambda into g().
Because the object inside the lambda captures nothing from outside g(),
the original class can be used both times.

This brings the JVM_IR backend into complete compliance with KT-28064.
2020-03-19 15:11:20 +01:00
Mikhail Glukhikh
1fd3ac046a [FIR] Throw exception if PSI type in ConeDiagnostic helper is improper 2020-03-19 16:57:52 +03:00
Mikhail Glukhikh
50a9313a5e [FIR] Support some approximation of effective visibility 2020-03-19 16:56:47 +03:00
Dmitry Gridin
cb3a31af6e UAST: implement KotlinUastCodeGenerationPlugin for 201
#KT-37569 Fixed
2020-03-19 16:58:58 +07:00
Victor Petukhov
81385b73b7 NI: limit cache size for approximated types during incorporation 2020-03-19 12:47:48 +03:00
Victor Petukhov
ea59ea8aa2 NI: avoid creating useless captured types during incorporation
^KT-37546 Fixed
2020-03-19 12:47:03 +03:00
Victor Turansky
e34dd27a34 KT-37240 Use extension "extension" 2020-03-19 11:55:24 +03:00
Victor Turansky
90c993334f KT-37240 Deterministic order for webpack config patches
Additional fix - only files with `js` extension processed (directories excluded)

`listFiles()` already contains 'is directory' check. Duplicated check removed
2020-03-19 11:55:24 +03:00
Pavel Punegov
8ffb63ca6b Ignore test that relies on hashCode implementation 2020-03-19 11:14:58 +03:00
Jinseong Jeon
2352b1fec5 JVM_IR: use fresh source map when generating lambda body for inline. 2020-03-19 08:28:38 +01:00
pyos
72b80ef158 Detect inline cycles faster
E.g. in the following code

    fun x() {}
    inline fun f() { x(); g() }
    inline fun g() { x(); f() }

the old implementation of inline cycle detection bailed out after
generating 3 calls of x() in each function, while the new one stops
after 2. In other words, code generation for a single function is no
longer reentered.
2020-03-19 08:13:19 +01:00
Dmitriy Novozhilov
39372c06cf [FIR] Move all checkers and theirs infrastructure to separate module 2020-03-19 09:51:01 +03:00
Dmitriy Novozhilov
cc07ae96b3 [FIR-TEST] Move analysis tests to separate module 2020-03-19 09:51:01 +03:00
Dmitriy Novozhilov
3a479d5d16 [FIR-TEST] Move FIR ide tests to separate module 2020-03-19 09:51:00 +03:00
Vyacheslav Gerasimov
bcefa68df0 Always checkout/checkin text files with lf endings
Different line endings on linux/windows prevents gradle from reusing
build cache since endings make task inputs completely different between
systems
2020-03-18 22:33:15 +03:00
Vyacheslav Gerasimov
7dc24a13e4 Build: Make ProGuard task cacheable
Exclude jdk files form libraries input. Instead add jdk major version
to inputs. JavaCompile task acts same to ignore fluctuations in JDK
implementations since api should remain same
2020-03-18 22:32:07 +03:00
Jiaxiang Chen
03613d4708 JVM_IR: preserve old backend's logic for special mutable collection class stub methods 2020-03-18 19:28:04 +01:00
Ilya Chernikov
da1009eb2c Avoid type approximation on generating equality constraints
#KT-37389 fixed
2020-03-18 18:34:09 +01:00
Ilya Chernikov
950ab01596 Avoid substitution and type approximation for simple calls
#KT-37392 fixed
2020-03-18 18:34:09 +01:00
Vladimir Dolzhenko
e1ae81e0a1 Run inspections after completion of general highlight pass in 201
#KT-37553 Fixed
2020-03-18 18:08:54 +01:00
Vladimir Dolzhenko
3cdcdbf6a8 Register Kotlin specific highlight passes via highlightingPassFactory in 193+ 2020-03-18 18:08:54 +01:00
Vladimir Dolzhenko
2e20cdf2e6 Update to 201.6487-EAP-CANDIDATE-SNAPSHOT 2020-03-18 18:08:54 +01:00
Mikhail Glukhikh
d0319d6b31 [FIR2IR] Use FirSourceElement.elementType instead of PSI 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
26a63a45ee Introduce FirSourceElement.elementType 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
25ab863af7 Add FlyweightCapableTreeStructure to FirLightSourceElement & use it 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
59fb96503c Introduce FirModifierList 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
6739135d17 [FIR2IR] Add pre-caching of built-in classes to avoid their duplications 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
0bf4cac601 [FIR2IR] Unmute additional black box test after rebase 2020-03-18 17:09:37 +03:00
Mikhail Glukhikh
95108a1bce [FIR2IR] Enable type parameter index >= 0 requirement 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
0f0e5e603d [FIR2IR] Use IR built-in types, their symbols & constructors directly 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
90f6af24f4 [FIR2IR] Remove unnecessary isBound checks in call generator 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
1036d8a35a [FIR] Provide dispatch receiver for 'field' synthetic variable 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
049bc6a431 [FIR2IR] Minor: extract variable 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
51c83e5f62 [FIR2IR] Move delegating constructor call to body start 2020-03-18 17:09:36 +03:00
Mikhail Glukhikh
10c2aa1657 [FIR2IR] Set origin properly for set field / variable 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
c0f8be5d4e [FIR2IR] Generate setter call for assignments, if any 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
53cb9035b6 [FIR2IR] Use backing field to read property if no getter 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
b6fdd6197a [FIR2IR] Extract CallGenerator from the main visitor 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
5357e7b3ab [FIR2IR] Extract ClassMemberGenerator from the main visitor 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
63aa5191da Move Fir2IrFakeOverrideGenerator to 'backend.generators' package 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
8f27129c36 [FIR2IR] Introduce & use components storage 2020-03-18 17:09:35 +03:00
Mikhail Glukhikh
175145ce4e [FIR2IR] Extract separate classifier storage from declaration storage 2020-03-18 17:09:34 +03:00
Dmitry Gridin
95b77f6386 AddJvmOverloadsIntention: disable for annotation classes
#KT-36482 Fixed
2020-03-18 13:51:56 +00:00
Valentin Kipyatkov
084276ef1f Suppress suggested refactoring for unused private and local declarations 2020-03-18 15:16:04 +02:00
Valentin Kipyatkov
e95d1c1224 Do not suggest to update usages on renaming duplicated method or property 2020-03-18 15:16:04 +02:00
Valentin Kipyatkov
395ba7d008 Using new API 2020-03-18 15:16:04 +02:00
Dmitry Gridin
7a3f6f5312 Formatter: fix continuation indent in call chain
#KT-37545 Fixed
2020-03-18 12:37:28 +00:00
pyos
2c06503311 JVM_IR: partially fix inline methods using captured crossinline lambdas
The fields containing crossinline lambdas should be package-private to
avoid generating synthetic accessors, which break object regeneration.

Note that the inline methods cannot actually be called, as call sites
will attempt to read the captured lambda from a field through a *copy*
of the local containing the object, so these reads will not be inlined,
causing an exception at runtime:

    inline fun f(crossinline g: () -> Unit) = object : I {
        inline fun h() = g()
        // effectively `val tmp = this; return tmp.$g()`:
        override fun run() = h()
    }

    f {}.run() // NoSuchFieldError: $g

This particular example can be fixed by reusing locals for receiver
parameters in IrInlineCodegen, but explicitly assigning `this` to
another variable and calling an inline method on it will break it again.
(This is only applicable to the JVM_IR backend, as the non-IR one fails
to generate `f` at all for some other reason.)
2020-03-18 13:13:54 +01:00
Dmitry Petrov
dd27b3d4f1 KT-36973 Keep private default interface members private 2020-03-18 14:18:47 +03:00
Dmitry Petrov
1c24a97b9e KT-36972 Don't create proxies for companion @JvmStatic $default in host
When creating proxy functions in a host class for @JvmStatic members of
companion object, skip functions for default parameters handling.
2020-03-18 13:33:56 +03:00
Yan Zhulanow
897c48f97e Add more robust check for plugin application order (KT-37245)
Cause build to fail if the 'kotlin-kapt' plugin is applied before the
  main Kotlin plugin ('kotlin' or 'kotlin-android').
  The 'logger.error()' prints an error message, however the build
  continues.
2020-03-18 18:26:17 +09:00
Alexander Podkhalyuzin
0247a300d1 Experimental features EP + completion.stats optional dependency
Fixed tests for Spring
2020-03-18 12:21:11 +03:00
Dmitriy Novozhilov
f85022532d [FIR] Rename FirArraySetCall to FirAugmentedArraySetCall 2020-03-18 11:31:54 +03:00
Dmitriy Novozhilov
2b986194fb [FIR] Add desugaring of array assignments and resolve of it
#KT-37516 Fixed
2020-03-18 11:31:53 +03:00
Mikhail Glukhikh
26f919df03 Fix some nullable usages of not-null type parameters (KT-36770) 2020-03-18 10:24:26 +03:00
Denis Zharkov
a2e7b6d20e FIR: Do not add "field" to accessor of a property with receiver 2020-03-18 10:22:10 +03:00
Dmitry Petrov
ade18d144a KT-36810 Implement javaPrimitiveType intrinsic in JVM_IR 2020-03-17 22:56:45 +03:00
Dmitry Petrov
2851fab281 KT-36809 Implement javaObjectType intrinsic in JVM_IR 2020-03-17 22:56:45 +03:00
Mikhail Bogdanov
aecd12fa12 Minor. Regenerate tests 2020-03-17 19:05:12 +01:00
pyos
2e542da91d JVM_IR: fix accesses from crossinline lambdas in other packages again 2020-03-17 16:38:32 +01:00
Denis Zharkov
7a1eb9214d FIR: Fix resolution for lambda returning resolved qualifier 2020-03-17 16:33:48 +03:00
Denis Zharkov
e1312a752a FIR: Allow a field override another field with the same name 2020-03-17 16:33:48 +03:00
Denis Zharkov
7203499b7a FIR: Fix visibility check for protected within a companion 2020-03-17 16:33:48 +03:00
Denis Zharkov
170978a4f1 FIR: Move fixed tests from problems directory to common 2020-03-17 16:33:48 +03:00
Denis Zharkov
a1b0b15521 FIR: Add test for KT-37478
^KT-37478 Fixed
2020-03-17 16:33:48 +03:00
Jinseong Jeon
b71b0fa32c Update stepping tests to inspect source name, instead of method info. 2020-03-17 13:39:35 +01:00
Jinseong Jeon
5dc1651a44 JVM: missed line number for return expression. 2020-03-17 13:39:35 +01:00
Vladimir Dolzhenko
c29f76580c Don't show modal progress dialog on calculate method parameter hint info
#KT-37537 Fixed
Relates to #EA-216268
2020-03-17 11:06:36 +01:00
Dmitry Petrov
6809f4439c Fix range-based 'for' loop with 'continue' in range bounds
1. Search for increment function in range element type, not in inferred
induction variable type
(which can be inappropriate, e.g., 'Nothing' in case of 'continue').

2. Handle nested loops with shared exit labels
(generated by JVM_IR for KT-37370 case).

KT-37370 KT-37373
2020-03-17 12:18:48 +03:00
Dmitry Petrov
d5b65abc5d KT-37505 Add box test 2020-03-17 12:18:48 +03:00
Igor Yakovlev
3dc898b8ca Fix for change signature refactoring type resolve
Fixed #KT-37451
2020-03-17 12:06:59 +03:00
Igor Yakovlev
64bcc6d54f KotlinChangeSignature refactoring remove deprecated usage + refactoring 2020-03-17 12:06:59 +03:00
Dmitry Gridin
309ceef49a i18n: remove template name from bundle
#KT-37483
2020-03-17 15:26:35 +07:00
Vyacheslav Karpukhin
eb68a0de47 Android import: simplify the check for android plugin version 2020-03-16 23:46:38 +01:00
Nikolay Krasko
45cba7b408 Update to 201.6251.22-EAP-SNAPSHOT 2020-03-16 23:46:06 +03:00
simon.ogorodnik
f226d855e1 Fix NI flag in modularized test for old frontend 2020-03-16 21:42:05 +03:00
simon.ogorodnik
4844a90788 [FIR] KT-37453: Type argument mapping
#KT-37453 Fixed
2020-03-16 21:41:59 +03:00
Steven Schäfer
6a1e35389c JVM IR: Mangle interface implementation methods in inline classes 2020-03-16 18:48:16 +01:00
Vladimir Dolzhenko
d21be3b665 Revert back fetchAnalysisResultsForElement
Relates to #KT-37467
#KT-37515 Fixed
2020-03-16 17:19:01 +01:00
Igor Yakovlev
af1e3fb10d UL properties supports JvmSynthetic annotation for get: and set: modifiers
(+small refactoring)
Fixed #KT-34973
2020-03-16 18:42:17 +03:00
anastasiia.spaseeva
0e26194a27 [FIR] Test for KT-37431 2020-03-16 17:24:01 +03:00
Dmitriy Novozhilov
1b479c49a8 [FIR] Fix exhaustiveness checking for conditions with equals to object
#KT-37488 Fixed
2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
3765a1efaf [FIR] Add values and valueOf to deserialized enums 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
caec5fe352 [FIR-TEST] Add test for KT-37478 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
37aa234bb7 [FIR] Fix transform of subject of when expressions with subject variable 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
820da6edaa [FIR] Don't set up expected type for function body 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
813003e12e [FIR] Approximate statements with ILT without expected type 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
698f78570d [FIR] Add ability to pass data=null to transformInplace with data producer 2020-03-16 17:04:28 +03:00
Dmitriy Novozhilov
fe95e37c88 [FIR] Add equality to Unit constraint for lambda without return expressions 2020-03-16 17:04:27 +03:00
Dmitriy Novozhilov
fc2e7da2a9 [FIR] Don't pass flow from inplace lambdas while resolve delegates
#KT-36248
2020-03-16 17:04:27 +03:00
Dmitriy Novozhilov
e90d86e1b4 [FIR] Add cfg for delegating constructor calls 2020-03-16 17:04:27 +03:00
Dmitriy Novozhilov
83257d00b9 [FIR] Pass flow from postponed lambdas to closest completed call
#KT-36248
2020-03-16 17:04:27 +03:00
Dmitriy Novozhilov
3a5c30a581 [FIR] Remove ortho splines mode from CFG dump 2020-03-16 17:04:27 +03:00
Dmitriy Novozhilov
f83cedd244 [FIR] Don't render call arguments in cfg dump 2020-03-16 17:04:27 +03:00
Roman Artemev
8e295de593 [KLIB] Make sure float/double bits have fixed representation for NaN.
- Store float and double constants as fixed32/64 proto value
 and encode/decode them in our side.
2020-03-16 16:49:39 +03:00
Dmitriy Dolovov
5fb46e05da K/N in IDE: Remove empty argument in run task in the default K/N template in IDEA
Issue #KT-37452
2020-03-16 19:52:35 +07:00
Dmitriy Dolovov
94df78aea0 K/N in IDE: Drop support of "konan.native" package 2020-03-16 19:52:28 +07:00
Dmitriy Dolovov
f3f971005d [Commonizer] GC obsolete & unused commonized libraries to free disk space 2020-03-16 19:52:21 +07:00
Dmitry Gridin
75f1fb0237 EqualsOrHashCodeInspection: update bundle for 201
#KT-37483
2020-03-16 18:40:52 +07:00
Dmitry Gridin
d30844310a i18n: remove html wrap from .properties
#KT-37483
2020-03-16 18:40:52 +07:00
Dmitry Gridin
f12ed33a70 AbstractKotlinBundle: introduce withHtml
#KT-37483
2020-03-16 18:40:52 +07:00
Dmitry Gridin
c7a21a094f i18n: fix findUsages for 201
#KT-37483
2020-03-16 18:40:52 +07:00
Dmitry Gridin
49cdea7fdb i18n: fix findUsages dialogs
#KT-37483
2020-03-16 18:40:52 +07:00
Dmitry Gridin
3c8ea8c08d i18n: fix compilation for 191 2020-03-16 18:40:52 +07:00
Dmitry Gridin
3c812c1ad1 i18n: update bundle for IdeErrorMessages 2020-03-16 18:40:52 +07:00
Dmitry Gridin
01f98979b7 i18n: update bundle for *.form 2020-03-16 18:40:52 +07:00
Dmitry Gridin
7886cb4c44 i18n: fix tests 2020-03-16 18:40:51 +07:00
Dmitry Gridin
036bc3b940 i18n: update bundle for idea 2020-03-16 18:40:51 +07:00
Dmitry Gridin
1b9bb77b2f i18n: fix tests 2020-03-16 18:40:51 +07:00
Dmitry Gridin
f66e985821 i18n: update bundle for jvm-debugger 2020-03-16 18:40:51 +07:00
Dmitry Gridin
d348d4418e i18n: add bundle for idea-repl 2020-03-16 18:40:51 +07:00
Dmitry Gridin
99a7764b04 i18n: add bundle for idea-live-templates 2020-03-16 18:40:51 +07:00
Dmitry Gridin
3e76678726 i18n: update bundle for idea-jvm 2020-03-16 18:40:51 +07:00
Dmitry Gridin
d099723ea5 i18n: update bundle for idea-gradle 2020-03-16 18:40:51 +07:00
Dmitry Gridin
22c94026c6 i18n: add bundle for idea-completion 2020-03-16 18:40:50 +07:00
Dmitry Gridin
4a7160b51a i18n: update bundle for idea-analysis 2020-03-16 18:40:50 +07:00
Dmitry Gridin
5bd44b73b2 i18n: fix bundle location 2020-03-16 18:40:50 +07:00
Dmitry Gridin
2518b8053b i18n: add @NonNls to NodeIndentStrategy 2020-03-16 18:40:50 +07:00
Dmitry Gridin
c1dc72e677 i18n: add bundle for idea/intentions 2020-03-16 18:40:50 +07:00
Dmitry Gridin
a3defb300a i18n: fix tests 2020-03-16 18:40:50 +07:00
Dmitry Gridin
f1cdf147d5 i18n: fix compilation 2020-03-16 18:40:50 +07:00
Dmitry Gridin
e42bec8ea2 i18n: fix text 2020-03-16 18:40:49 +07:00
Dmitry Gridin
7507d62ec3 i18n: replace KotlinBundleBase with AbstractKotlinBundle 2020-03-16 18:40:49 +07:00
Dmitry Gridin
0a3e577b6c i18n: add bundle for idea/inspections 2020-03-16 18:40:49 +07:00
Dmitry Gridin
76ac4ffb96 i18n: add bundle for idea/inspections/* 2020-03-16 18:40:49 +07:00
Dmitry Gridin
3035477e0c i18n: add bundle for idea/codeInsight 2020-03-16 18:40:49 +07:00
Dmitry Gridin
4eb50ed17c i18n: add bundle for idea/actions 2020-03-16 18:40:49 +07:00
Dmitry Gridin
1af8553360 i18n: add bundle for idea/quickfix 2020-03-16 18:40:48 +07:00
Dmitry Gridin
ae96a68bd1 i18n: createByPattern: add @NonNls to parameters 2020-03-16 18:40:48 +07:00
Dmitry Gridin
2b8373447a i18n: KtPsiFactory: add @NonNls to parameters 2020-03-16 18:40:48 +07:00
Dmitry Gridin
07861fdc6f i18n: add bundle for idea/quickfix/* 2020-03-16 18:40:48 +07:00
Dmitry Gridin
a6269004c5 i18n: add bundle for idea/refactoring/ui 2020-03-16 18:40:48 +07:00
Dmitry Gridin
a589d8869b i18n: add bundle for idea/refactoring/safeDelete 2020-03-16 18:40:48 +07:00
Dmitry Gridin
afeff3a6c8 i18n: fix tests 2020-03-16 18:40:48 +07:00
Roman Golyshev
c3cbcc0842 i18n: move all kotlin bundles to resources/messages directories 2020-03-16 18:40:47 +07:00
Roman Golyshev
1dded486f1 i18n: fix bundle messages/testData messages where necessary 2020-03-16 18:40:47 +07:00
Roman Golyshev
e1cb561398 i18n: add bundle for idea/refactoring/rename
- Modify `text.parameter` value to `Parameter`;
use `text.parameter.0` in previous usages
- Add @Nls and @NonNls annotations to few places
2020-03-16 18:40:47 +07:00
Roman Golyshev
4fc76e25a8 i18n: add bundle for idea/refactoring/pushDown 2020-03-16 18:40:47 +07:00
Roman Golyshev
37e1333fe1 i18n: add bundle for idea/refactoring/pullUp
- Add @NonNls to used methods from `KtPsiFactory`
2020-03-16 18:40:47 +07:00
Roman Golyshev
73de63cefc i18n: add bundle for idea/refactoring/move 2020-03-16 18:40:47 +07:00
Roman Golyshev
93493bdc09 i18n: add bundle for idea/refactoring/memberInfo 2020-03-16 18:40:47 +07:00
Dmitry Gridin
1c5b371249 i18n: fix compilation 2020-03-16 18:40:46 +07:00
Dmitry Gridin
94d10c7c63 i18n: move to KotlinBundle 2020-03-16 18:40:46 +07:00
Dmitry Gridin
bb6bdf0b69 i18n: add bundle for idea/refactoring/introduce 2020-03-16 18:40:46 +07:00
Dmitry Gridin
7564c91edd i18n: add bundle for idea/refactoring/inline 2020-03-16 18:40:46 +07:00
Dmitry Gridin
4d8375b571 i18n: add bundle for idea/refactoring/cutPaste 2020-03-16 18:40:46 +07:00
Dmitry Gridin
a1d7bd461d i18n: add bundle for idea/refactoring/copy 2020-03-16 18:40:46 +07:00
Dmitry Gridin
7e5c5927f0 i18n: add bundle for idea/refactoring/changeSignature 2020-03-16 18:40:46 +07:00
Dmitry Gridin
8de7d303a0 i18n: add @NotNls to bundles 2020-03-16 18:40:45 +07:00
Dmitry Gridin
354c9c913a i18n: add bundle for idea/reporter 2020-03-16 18:40:45 +07:00
Dmitry Gridin
e778a3fe34 i18n: add bundle for idea/roots 2020-03-16 18:40:45 +07:00
Dmitry Gridin
947cb6c5c8 i18n: add bundle for idea/script 2020-03-16 18:40:45 +07:00
Dmitry Gridin
7009aa6ecb i18n: add bundle for idea/slicer 2020-03-16 18:40:45 +07:00
Dmitry Gridin
a41f3ff17d i18n: add bundle for idea/testIntegration 2020-03-16 18:40:45 +07:00
Dmitry Gridin
1aa48e5f26 i18n: add bundle for idea/update 2020-03-16 18:40:45 +07:00
Dmitry Gridin
7f1aab5355 i18n: add bundle for idea/versions 2020-03-16 18:40:45 +07:00
Dmitry Gridin
670c529ded i18n: add bundle for idea/internal 2020-03-16 18:40:45 +07:00
Dmitry Gridin
c2d41744d0 i18n: add bundle for idea/imports 2020-03-16 18:40:44 +07:00
Dmitry Gridin
4c9e7773ad i18n: fix bundle for idea/findUsages 2020-03-16 18:40:44 +07:00
Dmitry Gridin
20ec600e2d i18n: add bundle for idea/highlighter 2020-03-16 18:40:44 +07:00
Dmitry Gridin
f837b01f85 i18n: add bundle for idea/hierarchy 2020-03-16 18:40:44 +07:00
Dmitry Gridin
a3f1dde413 i18n: add bundle for idea/framework 2020-03-16 18:40:44 +07:00
Dmitry Gridin
6ad1a9224c i18n: add bundle for idea/formatter 2020-03-16 18:40:44 +07:00
Yan Zhulanow
040204e36e i18n: Internationalize part of the 'idea' module 2020-03-16 18:40:44 +07:00
Dmitry Gridin
fff9ab5ac3 i18n: add bundle for idea/findUsages 2020-03-16 18:40:43 +07:00
Dmitry Gridin
dab6a12121 i18n: add bundle for idea/filters 2020-03-16 18:40:43 +07:00
Dmitry Gridin
d26a75055d i18n: add bundle for idea/facet 2020-03-16 18:40:43 +07:00
Dmitry Gridin
f59cb3e8ca i18n: add bundle for idea/editor 2020-03-16 18:40:43 +07:00
Dmitry Gridin
e2bb3204bb i18n: add bundle for idea/copy 2020-03-16 18:40:43 +07:00
Dmitry Gridin
177b7eb024 i18n: fix compilation 192 2020-03-16 18:40:43 +07:00
Dmitry Gridin
2da27a9e6a i18n: add bundle for idea/configuration 2020-03-16 18:40:43 +07:00
Dmitry Gridin
ddd6f81581 i18n: add bundle for j2k 2020-03-16 18:40:43 +07:00
Dmitry Gridin
540c0859c2 i18n: fix properties in idea-gradle 2020-03-16 18:40:43 +07:00
Yan Zhulanow
7a40274b71 i18n: Unify string naming in KotlinBundle 2020-03-16 18:40:42 +07:00
Yan Zhulanow
4cc19d3fda i18n: Add bundle for idea-jvm 2020-03-16 18:40:42 +07:00
Yan Zhulanow
40bdc099e3 i18n: Add bundle for idea-gradle-native 2020-03-16 18:40:42 +07:00
Yan Zhulanow
4e634b2b01 i18n: Add bundle for idea-new-project-wizard 2020-03-16 18:40:42 +07:00
Yan Zhulanow
f1d21b02e9 i18n: Add bundle for idea-native 2020-03-16 18:40:42 +07:00
Yan Zhulanow
2702be564a i18n: Add bundle for idea-maven 2020-03-16 18:40:42 +07:00
Yan Zhulanow
830c7cef07 i18n: Add bundle for JVM debugger (evaluation) 2020-03-16 18:40:42 +07:00
Yan Zhulanow
7f80fb8b98 i18n: Add bundle for JVM debugger (coroutine) 2020-03-16 18:40:42 +07:00
Yan Zhulanow
e0d5607fcd i18n: Add bundle for JVM debugger (core) 2020-03-16 18:40:41 +07:00
Yan Zhulanow
b0cd9911a4 i18n: Add bundle for New J2K 2020-03-16 18:40:41 +07:00
Yan Zhulanow
eabcff5c2a i18n: Add bundle for New J2K services 2020-03-16 18:40:41 +07:00
Yan Zhulanow
59b5505379 i18n: Add bundle for idea-git 2020-03-16 18:40:41 +07:00
Yan Zhulanow
3b931514ac i18n: Extract common caching code from bundles, J2K existing bundles 2020-03-16 18:40:41 +07:00
Yan Zhulanow
207ecf757b Rename .java to .kt 2020-03-16 18:40:41 +07:00
Dmitry Gridin
386fa50e99 i18n: add bundle for idea-gradle 2020-03-16 18:40:41 +07:00
Dmitry Gridin
dd6abec660 i18n: rewrite bundles with AbstractKotlinBundle 2020-03-16 18:40:40 +07:00
Dmitry Gridin
35f4ff000b i18n: add bundle for idea-gradle 2020-03-16 18:40:40 +07:00
Dmitry Gridin
3aa97643f5 i18n: add bundle for idea-core 2020-03-16 18:40:40 +07:00
Dmitry Gridin
d644214251 i18n: add bundle for ide-common 2020-03-16 18:40:40 +07:00
Dmitry Gridin
7e3c07865c i18n: add bundle for formatter 2020-03-16 18:40:40 +07:00
Dmitry Gridin
c8c316c379 i18n: introduce AbstractKotlinBundle 2020-03-16 18:40:40 +07:00
Sergey Igushkin
e1ec53d4e9 Filter kapt generate stubs classpath for non-existent entries (KT-37241) (#3192)
Issue #KT-37241 Fixed
2020-03-16 14:16:35 +03:00
Vladimir Dolzhenko
364d97e950 Invalidate partialBodyResolveCache on OCB instead of PSI modification
#KT-37466 Fixed
2020-03-16 11:14:50 +00:00
Vladimir Dolzhenko
9fdf8530ff Add checkCanceled in loops in KotlinImportOptimizer to avoid freezes
#KT-37301 Fixed
2020-03-16 11:08:19 +00:00
Vladimir Dolzhenko
ce9297c5d6 Be able to find annotated property accessor
#KT-37494 Fixed
2020-03-16 11:07:09 +00:00
Roman Golyshev
04ef1081b3 Disable stats-collector dependency for Android Studio
- AS40 has platform >= 193, but has no `stats-collector` plugin in it,
which caused build errors
2020-03-16 13:09:42 +03:00
Kirill Shmakov
5474d5f1d3 Support debug in Gradle tasks responsible for K/N tests 2020-03-16 12:20:29 +03:00
Igor Chevdar
a1eff7f4af [IR] Set source offsets in SAM lowering
This is needed for debug info generating in K/N
2020-03-16 11:58:36 +03:00
Vladimir Ilmov
9904304e07 (CoroutineDebugger) StackFrameInterceptor service added to KotlinPositionManager, dependency cleanup 2020-03-15 14:37:15 +01:00
Vladimir Dolzhenko
0af61293d5 Fix ExtensionTestUtil compilation for 191; CustomUsageSearcherTest compilation for 201
Relates to #KT-36657
2020-03-14 22:41:31 +01:00
Alexander Udalov
57fd449288 Minor, add check of const field modifiers to codegen test
#KT-29885
2020-03-13 23:26:12 +01:00
Roman Golyshev
1e3e791d43 Fix compilation error in MLCompletionForKotlin bunch files
- Remove leftover `override` modifier
2020-03-13 22:26:24 +03:00
Sergey Igushkin
a0aeb1554d Filter kapt generate stubs classpath for non-existent entries (KT-37241)
Issue #KT-37241 Fixed
2020-03-13 21:53:02 +03:00
Dmitriy Novozhilov
9daed1f2c6 Revert "[FIR-TEST] Move FIR ide tests to separate module"
This reverts commit 9955f342c0.
2020-03-13 20:51:41 +03:00
pyos
bdd88e1655 JVM_IR: place suspend markers in faux lambdas around inline references
Otherwise, the assumption that coroutine codegen makes about every
inlined function already having the markers breaks and it is no longer
true that calls to inline lambdas do not require them.
2020-03-13 18:33:41 +01:00
Roman Golyshev
f29e665dce Add "ML completion for Kotlin" experimental feature checkbox
- This checkbox should be shown only in IDEA >= 193 and should not
be shown in AS
- ML completion is enabled with `CompletionMLRankingSettings`, which
resides in `com.intellij.stats.completion` plugin that is bundled by
default
  - The `<depends>` section is required to be able to use classes from
  this plugin inside Kotlin plugin
- `CompletionMLRankingSettings` have package-private setter for enabling
ranking completion, so we have to use reflection to enable it (it will
probably change in the future)
2020-03-13 18:09:32 +03:00
Roman Golyshev
4c6ea7c26a KT-36808 Sink down member function Flow.collect in the completion
- This method is never supposed to be called, so we try to lower its
presence in the completion list by puting it on the last possible
position
- ^KT-36808 Fixed
2020-03-13 18:05:29 +03:00
Roman Artemev
d27954a6d4 [IR] Use erased types in backing field initializer in case of generic delegated property
- Since neither IrProperty nor IrField is Type Parameter container
 using of proprty's type parameter in IrField related code leads to
 creation of "hanging" type parameters which should be considered as
 incorrect IR.
 - Such code designed to be prohibited in LV 1.5
 - The fix makes use of erased type in such case
 where type parameter is expected.
2020-03-13 17:28:31 +03:00
Roman Artemev
13a73b67de [IR] Fix IrPropertyReference for delegated property
- Make sure that property CR passed to `getValue` doesn't have type
 arguments.
2020-03-13 17:28:30 +03:00
Roman Artemev
34c17e2bed [KLIB] Add regression to about VarAsFun type parameter leak 2020-03-13 17:28:30 +03:00
Roman Artemev
8c1772d623 [KLIB] Add regression test 2020-03-13 17:28:30 +03:00
Vladimir Dolzhenko
09239743c1 Fix compilation KotlinCopyPasteReferenceProcessor for 191, 192 2020-03-13 13:13:15 +01:00
Vladimir Dolzhenko
123311007b Fix compilation CustomUsageSearcherTest for 191, 201 2020-03-13 13:11:21 +01:00
Dmitriy Novozhilov
31776d9a3b [CFA] Mark arguments of all annotation calls as USED_AS_EXPRESSION
Also revert hacky fix of KT-37294 introduced in 80caa063b
#KT-37447 Fixed
2020-03-13 14:32:28 +03:00
Dmitry Gridin
b9ffed3f04 Replace ConfigurationFactory with SimpleConfigurationType
#KT-36781 Fixed
2020-03-13 17:56:10 +07:00
Alexander Udalov
43d6ddd405 Minor, fix typo in KotlinChunk.kt
#KT-37159 Fixed
2020-03-13 11:06:46 +01:00
Mikhail Glukhikh
20c4a7b244 [FIR2IR] Introduce staged transformation (first step)
Now FE IR -> BE IR transformation is performed in multiple stages
controller by Fir2IrConverter. Stages are
 * files & classes registration
 * supertypes & type parameters handling
 * functions & properties signature generation
 * body generation

After each step we have guarantee (with exception of local classes &
type inference combination, and external symbols) that required symbols
(class/function/property/variable/type parameter)
are already bound to real declarations and have correct parents.

This commit also fixes incorrect parents for local classes
2020-03-13 12:18:02 +03:00
Alexander Udalov
a9f7ff254b Add -Xno-optimized-callable-references to disable KT-27362 optimization
This argument is useful in situations where the stdlib version which the
code compiles against is different from the one which is available at
runtime, such as the case of kotlin-gradle-plugin, which depends on the
compiler/stdlib compiled by 1.4, but may be executed in Gradle where
only 1.3.x is available.

 #KT-37435
2020-03-13 10:07:22 +01:00
Vladimir Dolzhenko
ae4629a5a6 Fetch analysis results if it is available
The general idea is to try to fetch a full analysis if it is existed in PerFileAnalysisCache instead of go to ResolveElementCache and do analysis there. Do not perform analysis if it is not in PerFileAnalysisCache.

#KT-37467 Fixed
2020-03-13 09:25:28 +01:00
Zalim Bashorov
7cf8697e30 [JS BEs] use star projection when type parameter used recursively
#KT-37128 Fixed
2020-03-13 10:15:56 +03:00
Zalim Bashorov
8c7562d338 [CJS BE] don't crash when intersection types passed for a reified parameter
#KT-37163 Fixed
2020-03-13 10:15:53 +03:00
Zalim Bashorov
415893b8aa [JS CLI] revert disabling NI by default 2020-03-13 01:51:24 +03:00
Zalim Bashorov
5188bc6584 [JS FE] remove unused ReleaseCoroutinesDisabledLanguageVersionSettings 2020-03-13 01:51:24 +03:00
Vladimir Dolzhenko
87242b419a Improvements in KotlinCopyPasteReferenceProcessor
reduced scope of nonBlockingRead to avoid long rerun of it
used smart pointers to keep valid elements over changes
moved back to non-modal progress

Relates to #KT-37414
2020-03-12 22:42:58 +01:00
Victor Petukhov
b1c4b5f51b NI: Analyze lambdas which are return arguments of another lambda
^KT-36044 Fixed
2020-03-12 23:29:09 +03:00
Georgy Bronnikov
426738b7d4 JVM_IR: Cache stubs in CollectionStubMethodLowering 2020-03-12 23:14:17 +03:00
Georgy Bronnikov
92268c8144 JVM_IR: do not generate excessive stubs for immutable collections 2020-03-12 23:14:17 +03:00
Dmitriy Novozhilov
9955f342c0 [FIR-TEST] Move FIR ide tests to separate module 2020-03-12 18:15:38 +03:00
Abduqodiri Qurbonzoda
b1fac4e721 Implement reduceIndexedOrNull and reduceRightIndexedOrNull #KT-36866 2020-03-12 18:08:55 +03:00
Abduqodiri Qurbonzoda
b60633d79a Add associateWith to Array<T> #KT-30372 2020-03-12 18:06:54 +03:00
Abduqodiri Qurbonzoda
e632d58936 Nullable Array.contentEquals/contentHashCode/contentToString #KT-34161 2020-03-12 18:01:23 +03:00
Zalim Bashorov
179ec41a6b [JS BEs] Generate tests for whole "codegen/boxInline" 2020-03-12 17:22:33 +03:00
Zalim Bashorov
fe3a81ebc9 [JS BEs] Minor: fix warnings in abstract classes for generated tests 2020-03-12 17:21:06 +03:00
Abduqodiri Qurbonzoda
c664bfc62b Update property delegate test data 2020-03-12 16:52:36 +03:00
Alexander Udalov
3762b5cba7 Minor, remove extraneous field CodegenTestCase.coroutinesPackage
After a795c38eb7, this field is available in the base class
KotlinBaseTest.
2020-03-12 13:51:40 +01:00
Alexander Udalov
244db9bcf9 JVM IR: don't rename fake overrides for fields
In case derived class has a field with the same name as the base class,
RenameFieldsLowering previously tried to rename one of the fields by
adding the "...$1" suffix, which led to NoSuchFieldError.
2020-03-12 13:51:40 +01:00
kovalp
9ceca69154 Do not stop searchTextOccurrences when isSearchForTextOccurrences is false
#KT-36657 Fixed
2020-03-12 13:40:49 +01:00
Mikhail Glukhikh
6fd8ccc293 [FIR2IR] Support (simple) conversion of captured types 2020-03-12 15:17:51 +03:00
Sergey Bogolepov
e919e7b79a [Gradle][Native][Cache] Don't skip metadata-based interop libraries
`resolveSingleFileKlib` by default doesn't support klibs with
non-default ir providers. In case of cache generation for native interop
libraries we need to override this behavior because they have
ir_provider=kotlin.native.cinterop.
2020-03-12 18:11:47 +07:00
Dmitry Petrov
c0b15b1768 KT-37448 'this' in delegating constructor call may refer to outer object 2020-03-12 13:40:14 +03:00
Ilya Goncharov
2bd5872782 201: [Gradle, JS] Non jvm configurator from xml including 2020-03-12 13:23:46 +03:00
Ilya Goncharov
dc2dd2e3e3 [Gradle, JS] Remove idle test runner
#KT-37037 fixed
2020-03-12 13:23:45 +03:00
Ilya Goncharov
8c8307d0d2 201: [Gradle, JS] Remove redundant non jvm configurator for 201 2020-03-12 13:23:28 +03:00
Ilya Goncharov
857f3335bb [Gradle, JS] TestFramework is public to detect it in debug extension
#KT-37037 fixed
2020-03-12 13:23:27 +03:00
Ilya Goncharov
3728dd45ce [Gradle, JS] Remove redundant hacks for debug
#KT-37037 fixed
2020-03-12 13:22:42 +03:00
Ilmir Usmanov
7efab887aa JVM_IR: Do not generate accessor for private function
if the function is called in suspendCoroutine's lambda.
 #KT-37242 Fixed
2020-03-12 11:15:46 +01:00
Dmitry Gridin
80caa063b3 UnusedUnaryOperatorInspection: shouldn't report on annotation entry
#KT-37294 Fixed
2020-03-12 08:46:33 +00:00
Georgy Bronnikov
fded6fb494 JVM_IR: fix suspendCoroutineUninterceptedOrReturn 2020-03-12 11:28:42 +03:00
Ilya Chernikov
3cbfdd19f5 Optimize constraints simplification
simplify only when affecting changes are detected
2020-03-12 08:02:46 +01:00
Ilya Chernikov
c2b866fe7a Reduce number of constraints simplifications
assuming that MutableVariableWithConstraints is constructed either
with no initial constraints or already from simplified list
2020-03-12 08:02:46 +01:00
Ilya Chernikov
84a0e39956 Skip duplicates removal on constraints simplification
It is already coveren on addition. Speeds up inference a bit.
2020-03-12 08:02:46 +01:00
Ilya Chernikov
6f97745de2 Optimize MutableDiagnosticsWithSuppression
avoid modificationTracker and own diagnostics list initialization if
possible
2020-03-12 08:02:46 +01:00
Ilya Chernikov
a28c25b805 Add NI benchmarks configuration 2020-03-12 08:02:46 +01:00
Ilya Chernikov
e9cb7770e3 Fix benchmark compiler configuration 2020-03-12 08:02:46 +01:00
Ilya Chernikov
53d289206e Optimize hot TypeUtils.contains function
optimize for small number of visited types
2020-03-12 08:02:45 +01:00
Ilya Chernikov
4538e212db Optimize hot addSubTypeConstraintAndIncorporateIt function
reduce number of allocations, optimize for cases with small number
of possible new constraints
2020-03-12 08:02:45 +01:00
Ilya Chernikov
357ceeae19 Avoid unnecessary freshTypeConstructor() calls 2020-03-12 08:02:45 +01:00
Ilya Chernikov
54f10a709a Cache isProperType calculations in the constraint system
avoid expensive calculations with type.contains
2020-03-12 08:02:45 +01:00
Ilya Chernikov
70c89a28e1 Stop subtyping constraint search if equality constraints for...
all not fixed type vars are found
#KT-35626 fixed
2020-03-12 08:02:45 +01:00
Ilya Chernikov
b6c9432334 [minor] Optimize diagnostic reporting a bit
Eliminating a couple of function calls on reporting, speeds up
diagnostic tests for a few %
2020-03-12 08:02:45 +01:00
Ilya Chernikov
2727507d18 Fix diagnostic inferred type calculation for null in some cases
#KT-36222 fixed
2020-03-12 08:02:45 +01:00
Nikolay Krasko
997debdd42 201: Mute GradleMultiplatformWizardTest.testMobile because of leaked JDK 2020-03-12 03:02:30 +03:00
Nikolay Krasko
34fda45113 201: Update test data about test run markers under gradle 2020-03-12 03:02:30 +03:00
Nikolay Krasko
ab141bab1d 201: Update to 201.6073.9 2020-03-12 03:02:29 +03:00
Nikolay Krasko
0e65d0e00b 201: Mute JS android tests in MultiplatformProjectImportingTest 2020-03-12 03:02:29 +03:00
Nikolay Krasko
a9044b8a69 201: Mute test because of NPE: element.parent must not be null (IDEA-234737) 2020-03-12 03:02:29 +03:00
Nikolay Krasko
72a0a5327c 201: Fix setup for AbstractKotlinExceptionFilterTest tests 2020-03-12 03:02:29 +03:00
Nikolay Krasko
9370260022 201: Mute SpringRenameTestGenerated tests 2020-03-12 03:02:29 +03:00
Nikolay Krasko
62a772332d 201: Remove declarations added for dropped newApi in hierarchy 2020-03-12 03:02:29 +03:00
Nikolay Krasko
1afd3d929a 201: Update to 201.5985.32 2020-03-12 03:02:28 +03:00
Mikhail Zarechenskiy
7c86911f44 Filter out PSI values & valueOf methods from Java structure
These methods were recently added in Java PSI for IJ 201 and now have
 clash with the methods that we add on our side. Note that we can't
 start using methods from PSI as is because of different nullability:
 they have flexible types in their signatures while current methods
 have not-null types

 #KT-36095 Fixed
2020-03-12 00:15:03 +03:00
Mikhail Glukhikh
1321bf426b [FIR] Define argument lists and their builders more accurately 2020-03-11 22:08:59 +03:00
Mikhail Glukhikh
3d17ce05b5 [FIR] Introduce FirResolvedArgumentList with argument-parameter mapping
#KT-36345 Fixed
2020-03-11 22:08:59 +03:00
Mikhail Glukhikh
6b0a3aa176 [FIR] Cleanup vararg handling during call completion 2020-03-11 22:08:59 +03:00
Mikhail Glukhikh
91d51b93e1 [FIR] Introduce FirArgumentList node 2020-03-11 22:08:58 +03:00
Dmitriy Novozhilov
476d3c4092 Revert "[FIR-TEST] Move FIR ide tests to separate module"
This reverts commit 36ec0a2e2e.
2020-03-11 20:22:55 +03:00
Anton Yalyshev
b44be51b5c Disable FUS for Code Completion in 1.3.71 2020-03-11 19:52:01 +03:00
Dmitry Petrov
a9ab3ae192 KT-36047 Support when-with-subject in optimized 'when' generators 2020-03-11 18:09:17 +03:00
Ilmir Usmanov
fd70b10b17 JVM_IR: Generate suspend fun main wrapper as class instead of reference
This way, there is no getName, getOwner and getSignature generated.
 #KT-37404: Open
2020-03-11 15:34:38 +01:00
Leonid Startsev
e495c35ad7 Use upper bound as a type for polymorphic serializer
when it is used in sealed class case

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/753
2020-03-11 17:09:05 +03:00
Leonid Startsev
15fa6ea757 Do not insert @SerializableWith marker annotation if already present
Such situation may happen if generic class is customized by user
with object-kind serializer. In such case, both arguments from
generateSerializerGetter and generateSerializerFactory are objects.
See linked issue for details:

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/749
2020-03-11 17:07:17 +03:00
Leonid Startsev
e20354926b Do not check 'no ctor parameters' for serializable enums
fixes https://github.com/Kotlin/kotlinx.serialization/issues/742

Do not use serializableIrClass if it is not bound (this may happen
in case we're generating external serializer for library class)

fixes https://github.com/Kotlin/kotlinx.serialization/issues/744
2020-03-11 17:07:16 +03:00
Mark Punzalan
79fef09bf5 [JVM IR] Add tests for KT-15971. 2020-03-11 14:33:31 +01:00
Mark Punzalan
2239b5ceab [JVM IR] Maintain KT-36188 bug compatibility between non-IR and IR
backends.
2020-03-11 14:33:31 +01:00
Sergey Igushkin
435e74b74b Redirect warning output to error log when allWarningsAsErrors is enabled
Issue #KT-35447 Fixed
2020-03-11 16:03:55 +03:00
Mikhail Glukhikh
47ebd38534 FIR2IR: fix origin of object literal constructor call 2020-03-11 16:01:58 +03:00
Mikhail Glukhikh
8231377f6b FIR2IR: convert qualifiers inside getClass properly 2020-03-11 16:01:57 +03:00
Mikhail Glukhikh
1812b490a1 FIR: set anonymous object constructor return type properly 2020-03-11 16:01:57 +03:00
Nicolay Mitropolsky
d1739289c6 Uast: UastFakeLightMethod hashcode fix (KT-37200) 2020-03-11 15:54:01 +03:00
Alexander Podkhalyuzin
5bb74d9840 Fixed generated text from jvm classfile, when quotes is required
#KT-34759 Fixed
2020-03-11 15:41:41 +03:00
Dmitriy Novozhilov
36ec0a2e2e [FIR-TEST] Move FIR ide tests to separate module 2020-03-11 15:12:04 +03:00
Dmitriy Novozhilov
78f910e321 Regenerate tests 2020-03-11 15:12:04 +03:00
Alexander Udalov
4d2ee279c0 Remove unneeded workaround for IBM JDK and older intellij-core
The underlying problem (IDEA-206446) was fixed a long time ago and the
compiler is no longer affected by it.

 #KT-37286 Fixed
2020-03-11 12:49:38 +01:00
Svyatoslav Kuzmich
f113c22450 [JS IR BE] Fix enum entry initialization
Keep helper fields uninitialized. This way thier initialization
would not depend on field initialization order.
2020-03-11 14:28:20 +03:00
Pavel Kirpichenkov
04f9a03796 [NI] Fix isNullableType for definitely not null type parameter
Consider type parameter with nullable bound not null
if it is inside of a definitely not null type.
2020-03-11 13:55:25 +03:00
Pavel Kirpichenkov
88ae9bc7d5 minor: rename test 2020-03-11 13:55:24 +03:00
Vladimir Dolzhenko
8af5e2bb04 Make copy-paste resolve task modal to avoid invalid psi elements
Due to background formatting pasted PSI elements become invalid quite soon and it is not possible to make resolve

#KT-37414 Fixed
2020-03-11 11:53:03 +01:00
Roman Golyshev
90750483ee KT-36860 Collect extensions from object on first completion
- This should not affect the performance of the completion, since all
object extensions are collected on the last step, when all main variants
are already collected
- Add more tests
- Also, disable completion of extensions from objects as callable
references (^KT-37395 Fixed)
- ^KT-36860 Fixed
2020-03-11 13:31:56 +03:00
Zalim Bashorov
7dc9a2fc64 [JS IR BE] Add intrinsic for hashCode on Boolean 2020-03-11 12:54:43 +03:00
Zalim Bashorov
2103c0e0f8 [JS IR BE] Add intrinsic for hashCode on String 2020-03-11 12:54:43 +03:00
Zalim Bashorov
c8efe8c4ec Add tests for equals, hashCode, toString in String and Number 2020-03-11 12:54:42 +03:00
Zalim Bashorov
8e788e2169 [stdlib-js-ir] Copy Boolean and String sources and add equals, hashCode, toString 2020-03-11 12:54:42 +03:00
Zalim Bashorov
9e59d93ad5 [JS IR BE] Add intrinsics for hashCode on primitive number types 2020-03-11 12:54:42 +03:00
Zalim Bashorov
adfb296e45 [stdlib-js-ir] Add equals, hashCode, toString to some builtins
Namely:
* Throwable;
* primitive numbers except Long (which implemented in Kotlin).
2020-03-11 12:54:42 +03:00
Zalim Bashorov
97e86fb2ce [stdlib-js-ir] Char shouldn't be a data class 2020-03-11 12:54:41 +03:00
Zalim Bashorov
7c874ccf0c [stdlib-js-ir] Hack: mark Char.toString by JsName to force keeping it 2020-03-11 12:54:41 +03:00
Zalim Bashorov
9e7f72382f [stdlib-js-ir] Remove BitUtils object and make all members toplevel
It works slightly better with IR DCE --
we get about 6% less code on box tests.
2020-03-11 12:54:41 +03:00
Zalim Bashorov
62014e6711 [JS IR BE] Add better error message when some function not found during init JsIrBackendContext 2020-03-11 12:54:41 +03:00
Zalim Bashorov
43171f67a8 [stdlib-js-ir] Cleanup exceptions 2020-03-11 12:54:41 +03:00
Zalim Bashorov
d22e4495de [JS IR DCE] Improve handling overrides
Introduce the notion of contagious for overridable declarations.
So, now overriding uncontagious declaration will not lead to becoming a declaration reachable.
By default, all declarations treated as contagious, it's not the most efficient, but it's safest.
In case when we access a declaration through a fake-override declaration,
the original (real) one will not be marked as contagious, so, later,
other overrides will not be processed unconditionally only because
it overrides a reachable declaration.
2020-03-11 12:54:40 +03:00
Zalim Bashorov
f60d0b2c7c [JS IR CLI] Change K2JsIrCompiler#executableScriptFileName's body to TODO() and provide a proper fix later 2020-03-11 12:54:39 +03:00
Zalim Bashorov
2a7e32d3ae [JS IR DCE] Add CLI option to print reachability info 2020-03-11 12:54:39 +03:00
Zalim Bashorov
16cd3f0cef [JS IR DCE] Print reachability info 2020-03-11 12:54:39 +03:00
Zalim Bashorov
e6657b016f [JS IR DCE] Move withNested fun to get better diff in the next commit 2020-03-11 12:54:39 +03:00
Zalim Bashorov
95d248189f [JS IR BE] JsClassGenerator: don't use descriptor for error message 2020-03-11 12:54:39 +03:00
Leonid Startsev
01108d595c Fix broken test data from 5d73550b 2020-03-11 12:25:13 +03:00
Anton Bannykh
63a909dee6 JS: fix KT-37386
Anonymous object constructor parameters should not reuse JsName's
of the super class. Otherwise the temporary name renamer gets
confused.
2020-03-11 12:15:23 +03:00
Dmitriy Dolovov
182c1cee05 [Commonizer] Don't regenerate commonized KLIBs for *-SNAPSHOT versions 2020-03-11 15:18:35 +07:00
Georgy Bronnikov
d032f9b9cc JVM_IR: handle common klibs when compiled via cli 2020-03-11 11:03:58 +03:00
Georgy Bronnikov
6af099c11a Typo fix 2020-03-11 11:03:58 +03:00
Ilya Gorbunov
afab52c3bc Remove workarounds that called primary constructor manually 2020-03-11 02:09:32 +03:00
Vyacheslav Gerasimov
338dae7a83 Build: Apply checkCacheability.gradle.kts to buildSrc 2020-03-10 20:34:05 +03:00
Vyacheslav Gerasimov
35dc57d674 Build: Sort idea files in ivy repository to stabilize order
Sort by lowercase name, otherwise order may be different on win
2020-03-10 20:34:04 +03:00
Vyacheslav Gerasimov
da0eeb0c28 Build: Exclude plugin.xml from runtime classpath normalization
Version is written to the plugin.xml in every build so we exclude it to
improve caching.
Add test for kotlin plugin version to checkArtifacts.gradle.kts
2020-03-10 20:32:22 +03:00
Vyacheslav Gerasimov
a0b82c4dec Build: Compile against tollsJarApi in idea-jvm & jvm-debugger-coroutine 2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov
f735396ffb Build: Make toolsJarApi() helper for JPS build 2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov
c75ad13b66 Build: Remove all code from tools-jar-api leaving only declarations
Since method bodies are not required for compilation
strip them out to remove noise between different versions.
2020-03-10 17:24:21 +03:00
Vyacheslav Gerasimov
ef169aa12b Build: Use preprocessed tools.jar for compilation
tools.jar from JDK has different public api on different platforms which
makes impossible to reuse caches for tasks which depend on it. Since we
can't compile against those classes & stay cross-platform anyway, we
may just exclude them from compile classpath. This should make tools.jar
compatible at least within one build of JDK for different platforms
2020-03-10 17:24:21 +03:00
Mikhail Zarechenskiy
8fbd22ff73 Add test to check consistency of pre_release flag in the compiler
It's important to have consistent pre_release flag values in the
 current and bootstrap compiler. Otherwise, it's possible to publish
 release compiler with pre_release artifacts (stdlib, for example) and
 vice versa.

 Once this test fails, the next step is to advance bootstrap compiler
2020-03-10 17:22:26 +03:00
Mikhail Zarechenskiy
8fdc39ecbc Update test data due to using stdlib with a pre_release flag
The problem here is that we have separate bootstrap compiler and
 artifacts (stdlib, for example) that are used in tests and implicitly
 participate in them.

 For example, this test started to fail when bootstrap compiler was
 advanced to a version where pre_release flag is enabled. As a result,
 dependent stdlib become pre_release as well and now we have additional
 error about `Unit` type
2020-03-10 17:22:26 +03:00
Ilya Goncharov
ae6a603a92 [Gradle, JS] Fix for produceExecutable in Groovy build script 2020-03-10 17:01:40 +03:00
Dmitry Petrov
90d012cecb Handle unbound extension receiver in callable reference adaptation 2020-03-10 16:56:48 +03:00
Dmitry Petrov
e175ff0d73 KT-36953 break/continue/return/throw have kotlinType Nothing 2020-03-10 16:56:48 +03:00
Mikhail Glukhikh
603685b5a4 Mute FIR2IR test (pushed as unmuted accidentally?) 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh
2651fe9fb8 FIR2IR: use CLASS kind for anonymous objects 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh
9c3dfed2d7 FIR2IR: provide IR_EXTERNAL_DECLARATION_STUB origin also for members 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh
e9699e7173 FIR2IR: provide correct origins for arithmetic operators 2020-03-10 15:19:35 +03:00
Mikhail Glukhikh
64e71e9d25 FIR2IR: use IR_EXTERNAL_DECLARATION_STUB for external classes 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh
ed6c9e67a1 FIR2IR: convert qualifiers to companion objects, if any 2020-03-10 15:19:34 +03:00
Mikhail Glukhikh
7ea4c20f3d [FIR TEST] Fix FIR_IDENTICAL adding for Fir2IrTextTestGenerated 2020-03-10 15:19:34 +03:00
Dmitriy Novozhilov
dd7ac1343e [FIR] Unwrap when subject expression recursively in DFA variable storage
#KT-37327 Fixed
2020-03-10 15:05:05 +03:00
Alexander Udalov
676ffff015 Minor, fix builtinFunctionReferenceOwner.kt for android-tests
In codegen tests on Android, everything is being run with kotlin-reflect
in the classpath. So a package is no longer represented by a
reflect-less PackageReference, but by a full-blown KPackageImpl. Use a
less specific supertype ClassBasedDeclarationContainer instead, the one
which is a supertype of both PackageReference and KPackageImpl, and
which still allows to get the underlying jClass.
2020-03-10 12:59:54 +01:00
Alexander Udalov
ac6be2edba Treat class files with no bytecode version as having the current version
This has no effect currently because all class files produced by Kotlin
have the bytecode version in the metadata (currently 1.0.3).

However, this change will allow us to stop writing bytecode version to
metadata in Kotlin 1.5. In fact, we could do it while the default here
was INVALID_VERSION too, but then for example compiling with Kotlin 1.3
against binaries of version 1.5 would lead to extraneous "incompatible
bytecode version" errors (because INVALID_VERSION is basically 0, which
is incompatible to 1.0.3+), in addition to the correct "incompatible
metadata version" error.

The reason why we might want to avoid writing bytecode version is the
fact that the initial use case it was added for is already supported by
the metadata version, and the bytecode version error reporting was never
fully implemented. Actually bytecode version was almost unused because
of that.
2020-03-10 12:07:39 +01:00
Alexander Udalov
787e4503e5 Migrate -Xuse-experimental -> -Xopt-in in project sources 2020-03-10 12:07:15 +01:00
Alexander Udalov
d668808b44 Migrate Experimental->RequiresOptIn in project sources 2020-03-10 12:07:15 +01:00
Alexander Udalov
795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Victor Petukhov
125b39d9be NI: Temporary apply test data until fix KT-37380 2020-03-10 13:25:11 +03:00
Toshiaki Kameyama
77f85d8b7c Move to top level: update import directives on the usage site when the declaration to be moved is not private
#KT-37213 Fixed
2020-03-10 10:28:23 +01:00
Alexander Gorshenev
b06a3ea5ac Print out abi version as a full triple 2020-03-10 12:06:59 +03:00
Alexander Gorshenev
a635748848 Provide library producer compiler version in klib abi mismatch disagnostics 2020-03-10 12:06:59 +03:00
Alexander Gorshenev
fac71ac812 Be prepared if in the future we extend klib abi version to a triple 2020-03-10 12:06:59 +03:00
Leonid Startsev
5d73550b48 Do not check visibility of enum entries in explicit api mode
Although they're instances of DeclarationDescriptorWithVisibility,
they can't have visibilities

#KT-37040 Fixed
2020-03-10 11:55:59 +03:00
Nicolay Mitropolsky
753d4b3cbd Uast: UastFakeLightMethod equality fix (KT-37200) 2020-03-10 11:33:56 +03:00
Yan Zhulanow
c1f89159d9 Pill: Add compiler.version module to Pill 2020-03-10 17:24:23 +09:00
Roman Artemev
7fff4e78e5 [KLIB] Do not include return type into mangle 2020-03-10 11:12:09 +03:00
Roman Artemev
62621de4fc [KLIB] Don't have a special mangle for internal declarations 2020-03-10 11:12:09 +03:00
Roman Artemev
7430bfe518 [KLIB] Update test data
- mute temporary broken test
 - add regression test
2020-03-10 11:12:08 +03:00
Roman Artemev
7034edac4c [JS IR] Move signature consistency checker into appropriate place 2020-03-10 11:12:08 +03:00
Vladimir Dolzhenko
3c26d38804 Revert Clear computable when value is calculated in LockBasedStorageManager
Relates to #KT-35256
2020-03-10 09:10:46 +01:00
Vladimir Dolzhenko
ddba8e7691 Extend incremental analysis to object declaration
Fixed #KT-37250
2020-03-10 09:08:47 +01:00
Georgy Bronnikov
ae208f58a4 Workaround for KT-37302 2020-03-10 10:58:36 +03:00
pyos
735fae0e5a JVM_IR: apply TailCallOptimizationLowering to all suspend functions
Even if a function is known to be tail call because it's a compiler
generated bridge, the tail return might still need to be added in case
of Unit return type.
2020-03-09 19:21:32 +01:00
pyos
dc388f3f3a JVM_IR: add a test for suspend inline fun with defaults in a class
This is one example of a function replaced by a lowering after
AddContinuationLowering mentioned in the last commit: the lowering that
makes default stubs static is further down. Although this is not a
lambda, calling getOrCreateSuspendFunctionViewIfNeeded on it in the
inliner is fatal all the same.
2020-03-09 17:05:42 +01:00
pyos
862cd5665b JVM_IR: add continuations to inline suspend lambdas in the lowering
Delaying suspend view generation until the inliner is not a good idea
because it prevents lowerings after AddContinuationLowering from
further transforming the declarations.
2020-03-09 17:05:42 +01:00
pyos
b393f2f680 JVM_IR: merge suspend view and suspend stub maps 2020-03-09 17:05:42 +01:00
Denis Zharkov
15a0157c42 FIR: Support proper loading of Map.merge 2020-03-09 12:56:02 +03:00
Denis Zharkov
4a1302e385 FIR: Add problematic test case
^KT-37318 Open
2020-03-09 12:56:02 +03:00
Denis Zharkov
b2ff4d7f9a FIR: Support expansion of flexible type-alias-based types in inference 2020-03-09 12:56:02 +03:00
Denis Zharkov
afb84b1d2a FIR: Support type aliased declarations in HtmlFirDump 2020-03-09 12:56:02 +03:00
Victor Petukhov
92a0ddfe71 NI: discard def not null types if they appear in return positions, in inv or in variance
^KT-37343 Fixed
2020-03-08 19:00:27 +03:00
Mark Punzalan
368b0d9b0b [JVM IR] Use reference equality when comparing enums. 2020-03-06 23:01:32 +01:00
Mark Punzalan
a732e8f5fe [JVM IR] Ensure there is one accessor for each super access from a
subclass when there are multiple subclasses in a file.
2020-03-06 22:59:52 +01:00
Steven Schäfer
34fb636904 JVM: Generate generic signatures for delegate fields 2020-03-06 21:51:30 +01:00
pyos
20ea77d55d JVM_IR: refactor ToArrayLowering and make matching more precise
* If `toArray` is inherited from Java, it may take an argument or
    return a value of a flexible type, which looks nullable in IR;
  * The returned array may also have `out` variance of the type
    argument;
  * `Array<T>` is not the same as `Array<Any?>` if `T` is neither `Any`
    nor `in Something`, so presence of `toArray(): Array<T>` does not
    mean we don't need to generate a new `toArray`.
2020-03-06 18:33:25 +01:00
Alexander Udalov
a2b6282d49 Refactor ApiVersion.KOTLIN_1_4 usages in relation to unified null checks 2020-03-06 16:55:55 +01:00
Alexander Udalov
98aecbef6b Optimize runtime representation for callable reference subclasses
Instead of generating overrides for getOwner/getName/getSignature in
each anonymous class representing a callable reference, pass them to the
superclass' constructor and store as fields. This occupies some small
memory but helps to reduce the size of the generated class files, and
will be helpful for adding further runtime information to callable
references, such as information about implicit conversions this
reference has been subject to.

Represent owner as java.lang.Class + boolean instead of
KDeclarationContainer, so that the unnecessary wrapping Class->KClass
wouldn't happen before it's needed, and also to make sure all callable
references remain serializable.

Note that the argument type where the "is declaration container a class"
is passed is int instead of boolean. The plan is to pass the
aforementioned implicit conversion information as bits of this same
integer value.

 #KT-27362 Fixed
2020-03-06 16:55:07 +01:00
Alexander Udalov
8d7c8672ac Generate reference to existing class for builtin function references
Instead of non-existing `kotlin.KotlinPackage`, which led to
NoClassDefFoundError as soon as reflection tried to call getOwner on a
builtin callable reference, use a reference to a new physical class
`kotlin.jvm.internal.Intrinsics$Kotlin`. This will allow to support
KT-17151.

Note that for API version less than 1.4, this will still lead to
NoClassDefFoundError, but this is not worse than the current situation
where it happens anyway.
2020-03-06 16:55:05 +01:00
simon.ogorodnik
bfa371ea73 [FIR] Rewrite casts to reduce performance dispersion 2020-03-06 18:13:00 +03:00
simon.ogorodnik
426f498e87 [FIR] Forking runner for modularized test 2020-03-06 18:12:59 +03:00
Dmitriy Novozhilov
63a1e7c6ff [FIR] Add test for #KT-37321 2020-03-06 18:10:52 +03:00
Dmitriy Novozhilov
92449d6d9b [FIR] Organize code for postponed arguments 2020-03-06 18:10:52 +03:00
Dmitriy Novozhilov
1c0fd7342f [FIR] Support completion of lambdas with type variable as expected type
#KT-37310 Fixed
#KT-37304 Fixed
2020-03-06 18:10:52 +03:00
Dmitriy Novozhilov
643d7be12d [FIR] Add base class for PostponedResolvedAtomMarker to FIR 2020-03-06 18:10:51 +03:00
Dmitriy Novozhilov
2a58fc238f [FIR-TEST] Move stdlib tests for delegates to separate directory 2020-03-06 18:10:51 +03:00
Dmitriy Novozhilov
3655f0c499 [FIR-TEST] Move fixed test from problems directory 2020-03-06 18:10:51 +03:00
pyos
037b442e86 JVM_IR: do not explicitly initialize Refs to default values 2020-03-06 17:58:36 +03:00
pyos
13b04e63be JVM_IR: wrap inline class objects in unboxed refs 2020-03-06 17:58:36 +03:00
pyos
68745ec43f JVM_IR: refactor JvmSharedVariablesManager 2020-03-06 17:58:35 +03:00
Dmitriy Dolovov
ed96b81a42 [Commonzer] Fix ISE during commonization, improve interner performance
Issue #MMPP-191
2020-03-06 21:44:58 +07:00
Ilya Goncharov
7da220b0a2 [Gradle, JS] Check current chosen js compiler for targets in JS and MPP 2020-03-06 17:26:48 +03:00
Ilya Goncharov
a1263e445e [Gradle, JS] Add redundant methods for single js plugin 2020-03-06 17:26:48 +03:00
pyos
8487211ae1 JVM_IR: refine the condition for mangling names of multifile members
Private $$forInline versions of public suspend functions should not
be mangled. (Note that there are no $$forInline versions of private
suspend functions, as those are effectively inline-only.)
2020-03-06 14:33:50 +01:00
Ilya Goncharov
8fbfa8b819 [Gradle, JS] Migrate from singletons to classes 2020-03-06 16:07:11 +03:00
Ilya Goncharov
82de930574 [Gradle, JS] Consider transitivity in cache of npm dependencies 2020-03-06 16:07:11 +03:00
Ilya Goncharov
49814c438c [Gradle, JS] Fix naming 2020-03-06 16:07:10 +03:00
Ilya Goncharov
2eea8b0760 [Gradle, JS] Support transitive mode for npm dependencies
#KT-36196 fixed
2020-03-06 16:07:10 +03:00
Ilya Goncharov
d108c8ef51 [Gradle, JS] Move logic of resolving NpmDependency to Npm Api
#KT-36196 fixed
2020-03-06 16:07:10 +03:00
Sergey Igushkin
90f4f5db26 Internal visibility between common source sets in Gradle (KT-37264)
In KotlinCompileCommon, pass the friendPaths and refinesPaths arguments

In KotlinNativeCompilation, add both friend and refined dependencies as
friends for now.

In getVisibleSourceSetsFromAssociateCompilations, exclude the metadata
compilations to avoid incorrect results (those compilations don't have
proper kotlin

Issue #KT-37264 Fixed
2020-03-06 15:56:41 +03:00
Sergey Igushkin
3858c8e1f8 Support friend internal visibility in K2Metadata compiler (KT-37264)
Add and handle the friend paths and refines paths compiler arguments;
Reuse klib dependency module descriptors in the resolver for project;

Issue #KT-37264
2020-03-06 15:56:40 +03:00
Natalia Selezneva
04c924a119 Remove idea-gradle-tooling-api.jar from IDEA 2020
Because gradle-6.1.jar is now bundled into idea-gradle plugin
2020-03-06 14:59:20 +03:00
Natalia Selezneva
33368590e4 KotlinDslScriptsModelResolver: return back requireTaskRunning override
It is required for collecting KotlinDslScriptsModels because we need to run `prepareKotlinBuildScriptModel` task before
2020-03-06 14:59:20 +03:00
Natalia Selezneva
d063dbef10 Drop modification stamps for gradle scripts after project import
^KT-36763 Fixed
2020-03-06 14:59:19 +03:00
LepilkinaElena
61f5523805 Added Native-specific checker for properties of top level singletons (#3172) 2020-03-06 14:58:09 +03:00
Dmitry Petrov
eba45d4f89 KT-36963 Deparenthesize !! argument when generating expression 2020-03-06 14:55:41 +03:00
Dmitry Petrov
71e4b0c9ad KT-31649 Use 'Any#hashCode' in generated hashCode if class has none 2020-03-06 14:55:40 +03:00
Vladimir Dolzhenko
dc6be68a41 Handle properly lambda change in incremental analysis
Fixed #KT-37273
2020-03-06 11:12:33 +01:00
Igor Chevdar
93394656a3 [IR] Supported fake overrides in SAM lowering + enabled test 2020-03-06 12:47:00 +03:00
Georgy Bronnikov
56b983e625 Typo fix 2020-03-06 11:56:15 +03:00
Georgy Bronnikov
18d95bb670 JVM_IR: move BridgeLowering lower, remove special case for default arg stubs 2020-03-06 11:53:53 +03:00
Dmitriy Novozhilov
af67aff303 [FIR] Support Clonable
#KT-36762 Fixed
2020-03-06 10:44:14 +03:00
Dmitriy Novozhilov
83d01fbaaa [FIR-TEST] Move fixed test from problems directory 2020-03-06 10:44:14 +03:00
Alexander Podkhalyuzin
b6b0819f40 Revert "Since build updated for 193 branch due incompatibility"
This reverts commit 135ae32f
2020-03-06 10:30:49 +03:00
Alexander Podkhalyuzin
135ae32f75 Since build updated for 193 branch due incompatibility 2020-03-06 10:19:04 +03:00
Dmitriy Dolovov
17152899ac IDE perf tests for K/N: Produce duplicated *.kt files on demand 2020-03-06 10:14:54 +07:00
Dmitriy Dolovov
44c8a85241 IDE perf tests for K/N: Don't run tests on inapplicable host OSes 2020-03-06 10:14:47 +07:00
Dmitriy Dolovov
8635045a53 IDE perf tests for K/N: add more tests (Linux, AndroidNative) 2020-03-06 10:14:41 +07:00
Dmitriy Dolovov
80f2c091b4 IDE perf tests for K/N: keep Kotlin & Gradle versions in *.properties 2020-03-06 10:14:34 +07:00
Dmitriy Dolovov
c4a89c0201 IDE perf tests for K/N: check successful Gradle project import 2020-03-06 10:14:28 +07:00
Steven Schäfer
bb5a639153 JVM IR: Turn static callable references into singletons 2020-03-05 22:19:53 +03:00
Pavel Kirpichenkov
ac5c255c20 [NI-TESTS] Add regression tests
^KT-33638 Obsolete

Add test for case mentioned in KT-33629.
Used to be runtime failure instead of error diagnostic.
2020-03-05 20:20:47 +03:00
Pavel Kirpichenkov
dc42b20ae3 [NI] Use alternative to intersection type in public declarations
The new inference uses inferred intersection types normally, unlike the old inference.
However, intersection types in public declarations are approximated to supertype, which
potentially may give a less presice type, then it would be with the OI.
For non-related T1, T2 the NI approximates {T1 & T2} to Any in public declarations,
and if the OI was inferring T1 instead of the intersection type, it may lead to
less precise declaration type and related errors.

The solution is to remember an alternative for an intersection type when present.
Before approximation the alternative replaces the intersection type.

^KT-36249 Fixed
2020-03-05 20:20:47 +03:00
Dmitry Petrov
4038c758ca KT-37131 Record default arguments in argument adaptation
Also, don't adapt argument when expected type is base reflection type
(KCallable<T>, etc), since such types don't contain parameter types.
2020-03-05 19:32:39 +03:00
Vyacheslav Gerasimov
7c7245fbb9 Build: Add compiler.version to embedded in JPS sync 2020-03-05 18:10:17 +03:00
Vyacheslav Gerasimov
1cb52861b1 Build: Set captureTaskInputFiles for buildScan 2020-03-05 18:05:54 +03:00
Vyacheslav Gerasimov
c77130d0f3 Build: Add test for reporting all gradle build cache misses
`kotlin.build.cache.check.enabled` will be used for cacheability testing
on teamcity
2020-03-05 18:05:54 +03:00
Vyacheslav Gerasimov
b3f16cfc96 Build: Add test for dist artifacts manifests and compiler.version 2020-03-05 18:05:53 +03:00
Vyacheslav Gerasimov
ebb75813f9 Build: Don't disable incremental compilation for CI
Using different incremental setting for KotlinCompile makes impossible
using caches built on CI since it is marked as @Input. Same property for
JavaCompile marked as @Internal.
We do clean checkout now so it shouldn't matter but we want to build
incrementally in some cases for Dev builds on CI.
2020-03-05 18:05:53 +03:00
Vyacheslav Gerasimov
bab87c9837 Build: Extract compiler version to separate module to improve caching
Compiler version changes every build and makes impossible to reuse
caches for heavy tasks such as compiler proguard. We may fix that by
adding version module directly to the final jar.
2020-03-05 18:05:53 +03:00
Vyacheslav Gerasimov
c2457cae60 Read KotlinCompilerVersion from resource file
Writing build number into a public constant field leads to poor gradle
cache reuse between different builds. Public constant value is a part of
public api and its changes affect inputs of dependent modules.
Extracting build number to resource file allows to ignore it from
runtime classpath which fixes same problem for KotlinCompile tasks
2020-03-05 18:05:53 +03:00
Vyacheslav Gerasimov
f8437743c5 Build: Ignore META-INF/MANIFEST.MF from classpath normalization
We are writing build numbers there which breaks caching
2020-03-05 18:05:52 +03:00
Abduqodiri Qurbonzoda
d5c851980c String.toBoolean() should be String?.toBoolean() #KT-14119 2020-03-05 17:53:29 +03:00
Dmitry Savvinov
b8b1dd753c Add builtins_platform property to klib manifest 2020-03-05 17:27:38 +03:00
Dmitry Savvinov
8fcd98639d Minor: merge HierarchicalExpectActualMatchingTests into MultiplatformHighlightingTests 2020-03-05 17:27:19 +03:00
Konstantin Tskhovrebov
9eab75650c Remove target name from gradle test filters.
Issue #KT-36909 Fixed
2020-03-05 17:14:49 +03:00
Abduqodiri Qurbonzoda
a32f742893 Inherit ReadWriteProperty from ReadOnlyProperty #KT-27729 2020-03-05 16:53:02 +03:00
Dmitriy Novozhilov
3742586209 [FIR-TEST] Unmute some blackbox tests 2020-03-05 16:48:48 +03:00
Dmitriy Novozhilov
2bce279a9e [FIR] Support smartcasts from lhs of boolean operator with jump in rhs 2020-03-05 16:48:48 +03:00
Dmitriy Novozhilov
e3e7b40f85 [FIR] Fix determining coercion to Unit 2020-03-05 16:48:48 +03:00
Dmitriy Novozhilov
770dfb69ba [FIR] Analyze all statements in block except last one in independent mode
Some broken tests will be fixed in next commit
#KT-37176 Fixed
2020-03-05 16:48:47 +03:00
Dmitriy Novozhilov
1c728e8184 [FIR] Fix return expressions calculator
There was a problem that if las statement of lambda was a return
  expression from that lambda then result of return counted twice
2020-03-05 16:48:47 +03:00
Dmitriy Novozhilov
5f9876479e [FIR] Add saving of local context in anonymous functions for further resolve
#KT-37066 Fixed
2020-03-05 16:48:47 +03:00
Dmitriy Novozhilov
8023d04c61 [FIR] Add separate local scope for init blocks 2020-03-05 16:48:47 +03:00
Dmitriy Novozhilov
50742a4686 [FIR] Move local scopes immutable 2020-03-05 16:48:47 +03:00
Dmitriy Novozhilov
25dc9f948a Revert "[FIR] Support deserialization of annotations on JVM"
This is needed because of that commit tragically decreases performance,
  so this changes will be delayed for now
2020-03-05 16:48:47 +03:00
Leonid Startsev
a2c24e696f Leverage existing psi2ir function declaration generator in plugin
This seems to be the only reasonable way to provide function declarations with
_correctly_ substituted type parameters without rewriting logic from scratch;
correctly scoped type parameters in IR are now required in serialization
plugin by all backends.

Also fix some missing upper bounds.
2020-03-05 16:40:55 +03:00
Abduqodiri Qurbonzoda
fc22cfa896 String.format does not support no locale #KT-22932 2020-03-05 16:38:43 +03:00
Alexander Udalov
f4d53c18a1 Fix JarContentTest by adding dependency on jar creating task
Otherwise tests could be run before the final jar was created and stored
to `build/libs`.
2020-03-05 14:36:24 +01:00
Alexander Udalov
505ec072bb Remove dependency of JarContentTest on JDK 8
It turns out that `jvmTarget` and `javaHome` settings in
build.gradle.kts were changing the module settings and affected the
compilation of kotlinx-metadata-jvm sources. The correct way to use JDK
8 in tests would be to change JVM target / JDK home of the specific
KotlinCompile task via its `kotlinOptions`, but JarContentTest doesn't
need JDK 8 anyway at this moment, so simplify that instead.
2020-03-05 14:36:23 +01:00
Vladimir Dolzhenko
d1a29df581 Revert "Added AllowNullableArrayArgsInMain (1.4+) language setting"
#KT-35965 Fixed
2020-03-05 14:08:27 +01:00
Alexander Udalov
0f7122a88a Support MutablePropertyReferenceN supertypes in LambdaInfo
#KT-37087 Fixed
2020-03-05 14:01:30 +01:00
Alexander Udalov
058c6bc578 Minor, reformat and slightly refactor JvmRuntimeTypes.kt 2020-03-05 14:01:29 +01:00
Alexander Udalov
8588f96ec8 Fix inspections in kotlin.jvm.internal runtime classes 2020-03-05 14:01:29 +01:00
Alexander Udalov
aaff1d1670 Minor, add ReadMe to spec-docs 2020-03-05 14:01:13 +01:00
Mikhail Glukhikh
5af4efd5a7 Remove FIR test data file accidentally left in 8884cbe4 2020-03-05 15:51:41 +03:00
Mikhail Glukhikh
db38dfc21b Diagnostic test: make messages about FIR_IDENTICAL inconsistency clearer 2020-03-05 09:41:07 +03:00
Mikhail Glukhikh
737c91c5cf FIR test merging: compare diagnostic files symbol-by-symbol 2020-03-05 09:40:45 +03:00
Mikhail Glukhikh
48d30daa47 Diagnostic tests: don't create '.fir.kt' file if FIR_IDENTICAL 2020-03-05 09:40:24 +03:00
Mikhail Glukhikh
951fb0b7e7 Move loadTestDataWithoutDiagnostics to FirTestUtils 2020-03-05 09:40:02 +03:00
Mikhail Glukhikh
8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
Georgy Bronnikov
186e0b0cba Do not call IR backend when there's a script involved 2020-03-05 09:23:13 +03:00
Kirill Shmakov
03c6f13831 Add fallback value in K/N version computation 2020-03-05 08:35:34 +03:00
Alexander Udalov
3a4e540d44 Minor refactoring and style fixes in JarContentTest
Inline unnecessary members, remove commented code, refactor according to
the style guide, some other minor improvements
2020-03-05 02:25:00 +01:00
Jinseong Jeon
79790ca227 Avoid uses of plain "kotlin" in metadata deserialization.
KT-35587 Fixed
2020-03-05 02:22:36 +01:00
Vyacheslav Gerasimov
744c4c545e Build: Make DexMethodCount task cacheable, extract print stats to task 2020-03-05 00:47:52 +03:00
Ilmir Usmanov
354fb3c4ba JVM_IR: Generate fake continuations and their constructors as public
#KT-37093 Fixed
2020-03-04 21:32:35 +01:00
Ilmir Usmanov
c94f8d3767 JVM_IR: Do not generate nullability annotation for synthetic result field
of continuation class.
 #KT-37084 Fixed
2020-03-04 21:32:34 +01:00
Ilmir Usmanov
4b4a6101c1 JVM_IR: Generate inline functions with reified generics as public synthetic
Otherwise, proguard will remove them.
 #KT-37004 Fixed
2020-03-04 21:32:31 +01:00
Ilmir Usmanov
f8903ca04b JVM_IR: Generate private suspend functions as synthetic package-private
Do not generate accessors for them.
 #KT-37086 Fixed
2020-03-04 21:32:29 +01:00
Ilmir Usmanov
5826db97c7 JVM_IR: Do not duplicate inline suspend functions with reified type parameters
They are inline-only.
Generate $$forInline versions of inline suspend functions as private.
This way, there is no nullability annotation on there parameters and return
values. Unfortunately, old BE does generate them.
 #KT-37088 Fixed
2020-03-04 21:32:27 +01:00
Dmitry Petrov
3bf2c17f9e KT-37024 Optimized delegated property metadata generation in inline fun 2020-03-04 18:48:03 +03:00
Vladimir Dolzhenko
0be5a82460 Use LightJavaModule.getModule for 193
Fixed #KT-37229
2020-03-04 15:30:09 +01:00
Mikhael Bogdanov
1ffde2a3c4 Minor. Fix test compilation 2020-03-04 15:24:08 +01:00
Mikhail Glukhikh
4745cd4fea FIR2IR: refactor 'getArrayType' using standard class ids 2020-03-04 16:55:34 +03:00
Mikhail Glukhikh
0c9da6d715 FIR2IR: extract 'enumClassModality' 2020-03-04 16:55:34 +03:00
Mikhail Glukhikh
76ccaf13ba FIR2IR: cache properties & fields more correctly 2020-03-04 16:55:34 +03:00
Mikhail Glukhikh
fe658ce47f FIR2IR: remove redundant receiver generation from visitor
Now static functions have no dispatch receiver: they really shouldn't.
2020-03-04 16:55:34 +03:00
Mikhail Glukhikh
9788a7cfbc FIR2IR: cache constructors and their parents properly 2020-03-04 16:55:34 +03:00
Mikhail Glukhikh
0fee8a6946 FIR2IR: cache functions and their parents properly 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh
940567b8bd FIR2IR: set enum class modality properly for complex entries case 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh
3ffe1a1876 FIR2IR: create IrEnumConstructorCall even in complex entries 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh
5af3d92271 FIR2IR: cache enum entry classes properly 2020-03-04 16:55:33 +03:00
Mikhail Glukhikh
03eab2ec6c FIR2IR: get rid of setParentAndContent + fixes around anonymous objects 2020-03-04 16:55:32 +03:00
Mikhail Glukhikh
20eddef06f FIR2IR: eliminate hacky replacement for invoke() & next() calls
At this moment the generic logic for fake override calls
replacement is in use.
2020-03-04 16:55:32 +03:00
Mikhail Glukhikh
50c4c3f4fb FIR2IR: extract fake override generator 2020-03-04 16:55:32 +03:00
Mikhail Glukhikh
0bb3a42ceb FIR2IR: mute black box test due to parent logic problems 2020-03-04 16:55:32 +03:00
Mikhail Glukhikh
698e259438 FIR2IR: register file first and convert declarations second
This allows to find parent declaration from another file correctly
2020-03-04 16:55:31 +03:00
Mikhail Glukhikh
cfa626ad77 FIR2IR: introduce conversion scope, remove dispatch receiver for lambdas 2020-03-04 16:55:31 +03:00
Mikhail Glukhikh
a14cb075c3 FIR2IR: inline some conversion one-liners 2020-03-04 16:55:31 +03:00
Mikhail Glukhikh
4c2522631b FIR2IR (refactoring): introduce Fir2IrTypeConverter 2020-03-04 16:55:31 +03:00
Mikhail Glukhikh
9257949a5a Minor: eliminate unused typeContext in FIR2IR 2020-03-04 16:55:30 +03:00
Mikhail Glukhikh
211411a920 Fix FIR test data according to last changes of demiurg 2020-03-04 16:55:30 +03:00
Mikhael Bogdanov
32bcab2867 Switch rest of test to new scheme with configuration kind processing 2020-03-04 14:51:21 +01:00
Mikhael Bogdanov
46397dca4a Switch 'AbstractVisualizer' to new scheme with configuration kind 2020-03-04 14:51:20 +01:00
Mikhael Bogdanov
ae9a91e17d Switch 'AbstractCompilerLightClassTest' to new scheme with configuration kind 2020-03-04 14:51:19 +01:00
Mikhael Bogdanov
f84ac5e3f9 Remove configuration kind from AbstractDumpDeclarationsTest tests 2020-03-04 14:51:18 +01:00
Mikhael Bogdanov
e3efab5765 Remove FULL_JDK from AbstractFirResolveTestCaseWithStdlib tests 2020-03-04 14:51:17 +01:00
Mikhael Bogdanov
0a8454d5fc Remove FULL_JDK from AbstractForeignAnnotationsTest tests 2020-03-04 14:51:16 +01:00
Mikhael Bogdanov
59679476f6 Always create test files, directive processing would be based on them
This is required for extracted 'getTestJdkKind' in previous commits
2020-03-04 14:51:16 +01:00
Mikhael Bogdanov
dbdc4d9ee0 Move 'extractConfigurationKind' to base class, use it in KotlinMultiFileTestWithJava 2020-03-04 14:51:15 +01:00
Mikhael Bogdanov
7040857d77 Convert KotlinMultiFileTestWithJava.java to Kotlin 2020-03-04 14:51:14 +01:00
Mikhael Bogdanov
06a36465a5 Rename .java to .kt 2020-03-04 14:51:13 +01:00
Mikhael Bogdanov
999b762288 Merge 'getTestJdkKind' and 'getJdkKind' and move to base class 2020-03-04 14:51:12 +01:00
Mikhael Bogdanov
6e855f3bbd Split 'analyzeAndCheck' into 'shouldSkipTest' and 'setupEnvironment' 2020-03-04 14:51:11 +01:00
Mikhael Bogdanov
9052ef06a7 Introduce configureEnvironment, avoid 'createEnvironment' calls 2020-03-04 14:51:10 +01:00
Mikhael Bogdanov
a795c38eb7 Introduce base class for codegen and diagnostic tests
Extract base TestFile and TestModule classes.
 Move coroutinePackage related logic to base class
2020-03-04 14:51:10 +01:00
LepilkinaElena
b031706ea9 Added Native-specific frontend checker for @SharedImmutable (#3091) 2020-03-04 16:45:37 +03:00
Georgy Bronnikov
8b559b20e2 Add a test for getOrDefault() bridge 2020-03-04 16:02:54 +03:00
Georgy Bronnikov
dd7d5dfdb3 JVM_IR: try to avoid resolveFakeOverride() in BridgeLowering
One of the uses can be avoided, the other remains.
Special overrides are now generated for MutableMap.remove and
getOrDefault when there is an intermediate Java class, same as in old
backend.
2020-03-04 16:02:54 +03:00
nataliya.valtman
fa74eabbd1 use bootstrap.kotlin.default.version bootstrap for buildSrc 2020-03-04 15:15:32 +03:00
Yan Zhulanow
f7a7c169f8 Changelog: remove "trailing comma" feature from 1.3.70 2020-03-04 20:44:15 +09:00
Yan Zhulanow
9e605b1798 Remove 1.4-specific language features from 1.3.70 changelog 2020-03-04 17:19:12 +09:00
Vladimir Dolzhenko
15e2afe5ab Add checkCanceled on common for autocompletion and highlighting resolve path 2020-03-04 08:59:17 +01:00
Vladimir Dolzhenko
9c530b1121 Add performance stress tests 2020-03-04 08:47:51 +01:00
Yan Zhulanow
9ea97a3dfb Update changelog: add changes from 1.3.70 2020-03-04 15:15:55 +09:00
Georgy Bronnikov
394c660a82 Mute a FIR test 2020-03-04 01:34:17 +03:00
Vyacheslav Gerasimov
52b88bf753 Build: Fix various libraryJarWithIr task inputs 2020-03-04 01:14:56 +03:00
anastasiia.spaseeva
401023a893 [FIR] Add test for object inner class KT-37120 2020-03-03 23:40:11 +03:00
anastasiia.spaseeva
1ce96b7433 [FIR] Add tests for KT-37091 , KT-37081 2020-03-03 23:40:11 +03:00
anastasiia.spaseeva
9a352ad7b0 [FIR] Add tests for KT-37070 , KT-37066 2020-03-03 23:40:11 +03:00
anastasiia.spaseeva
97007ae6c5 [FIR] Add tests for companionObjectCall 2020-03-03 23:40:11 +03:00
Dmitry Petrov
f678db2f89 KT-36813 Generate optimizable null checks in JVM_IR 2020-03-03 22:38:21 +03:00
Nikolay Krasko
a52ef71d48 Use createForProduction for running standalone execution 2020-03-03 21:15:07 +03:00
Georgy Bronnikov
4ea0b4911a Avoid excessive JavaForKotlinOverridePropertyDescriptors
When there are two candidates for a Java method to be interpreted as a
getter for inherited Kotlin property, one from current class, another
from supertype, create just one JavaForKotlinOverridePropertyDescriptor.
Case in point: java.lang.Hashtable.
2020-03-03 20:01:27 +03:00
Georgy Bronnikov
0c266f9f45 Add hashtable test 2020-03-03 20:01:27 +03:00
Roman Artemev
4381a2d81b [JS IR] Clean up callable reference lowering 2020-03-03 19:19:43 +03:00
Roman Artemev
8f0e06ff70 [JS IR] Fix typo 2020-03-03 19:19:42 +03:00
Roman Artemev
98aa73ee6b [JS IR] Fix code clean-up optimizations
- Do not create an extra variable/field for in some lowerings
2020-03-03 19:19:41 +03:00
Roman Artemev
65011f96cc [JS IR] Clean up coroutine code 2020-03-03 19:19:39 +03:00
Roman Artemev
c4efd5a09b [JS IR] Use JsThisRef node for dispatch/instance receivers 2020-03-03 19:19:38 +03:00
Roman Artemev
62c86f2813 [JS IR] Remove filthy hacks from namer 2020-03-03 19:19:37 +03:00
Roman Artemev
3c7cc07263 [JS IR] Clean up code 2020-03-03 19:19:36 +03:00
Roman Artemev
133f3d359f [JS IR] remove hacks from DCE 2020-03-03 19:19:34 +03:00
Roman Artemev
adc022fde8 Fix some coroutine tests 2020-03-03 18:54:36 +03:00
Roman Artemev
4e002a41e6 [JS IR] Fix visibility & code clean up 2020-03-03 18:54:36 +03:00
Roman Artemev
8654dbdc6e [JS IR] Refactor property references
- implement separate lowering
 - fix issues with type checks
 - clean code up
2020-03-03 18:54:36 +03:00
Roman Artemev
5dcac16cf7 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev
c2676ded31 [JS IR] Implement KProperty runtime utils 2020-03-03 18:54:36 +03:00
Roman Artemev
6e75b56388 [JS IR] Fix bridge modality 2020-03-03 18:54:36 +03:00
Roman Artemev
161bb72439 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev
97b97ddbd7 [JS IR] Fix phases
- update phase description
 - remove unused phases
2020-03-03 18:54:35 +03:00
Roman Artemev
cf41172521 [JS IR] A bunch of fixes to make PIR mode work
- provide required mappings
 - fix fake overrides
 - fix local declaration lowering
 - fix DCE
2020-03-03 18:54:35 +03:00
Roman Artemev
f8d155c6a3 [JS IR] Fix native invoke checker 2020-03-03 18:54:35 +03:00
Roman Artemev
9e1c52f8cb [JS IR] Fix this reference name generation 2020-03-03 18:54:35 +03:00
Roman Artemev
536e380331 [JS IR] Fix kotlin.test framework 2020-03-03 18:54:35 +03:00
Roman Artemev
293ddb5389 [JS IR] Fix inline classes for new callable reference scheme 2020-03-03 18:54:35 +03:00
Roman Artemev
0e67c6ac7d [JS IR] Update coroutine runtime 2020-03-03 18:54:35 +03:00
Roman Artemev
b9eff4b246 [JS IR] Make coroutines work with new lambda scheme
- Do not create extra class for suspend lambda
2020-03-03 18:54:35 +03:00
Roman Artemev
3783205fb7 [JS IR] Lower suspend lambda as a regular lambda 2020-03-03 18:54:35 +03:00
Roman Artemev
26237f8bd5 [JS IR] Implement new function references scheme 2020-03-03 18:54:34 +03:00
Vyacheslav Gerasimov
2f087fe7a2 Build: Fix kotlin-stdlib-js-ir:tryRunFullCli task inputs 2020-03-03 18:46:05 +03:00
Dmitry Gridin
b4898e4043 Put arguments/parameters on separate/one line should update trailing comma
#KT-36411 Fixed
2020-03-03 21:53:11 +07:00
Dmitry Gridin
173f90c89c AbstractIntentionTest: support code style and registry settings 2020-03-03 21:53:11 +07:00
Dmitry Gridin
baf2dd6b9b KotlinLightCodeInsightFixtureTestCase: add configureCodeStyleAndRun 2020-03-03 21:53:11 +07:00
pyos
f66b994946 JVM_IR: make suspend lambda invoke()/create() creation shorter
Also, fix finality of fields corresponding to unbound parameters. (They
are set in invoke/create, not in the constructor.)
2020-03-03 15:12:13 +01:00
pyos
6184171a11 JVM_IR: carry less state while transforming suspend funs into views 2020-03-03 15:12:13 +01:00
pyos
5896d8003e JVM_IR: unify generateStateMachineFor{Lambda,NamedFunction} 2020-03-03 15:12:13 +01:00
pyos
159d292ea7 JVM_IR: make continuation detection more consistent
* unify various checks for whether a suspend function needs a
    continuation;

  * mark the continuation parameter with an origin (this also allows
    correctly computing the offset of the local in codegen -- see the
    new test);

  * when wrapping `suspend fun main`, use a suspend reference instead of
    a synthetic non-suspend lambda (required to correctly implement the
    previous point, as previously the continuation parameter was passed
    to main() itself correctly only because of very lenient checks in
    AddContinuationLowering).
2020-03-03 15:12:13 +01:00
Vyacheslav Gerasimov
c57f466494 Build: Use same com.eclipsesource.j2v8 artifact for compilation
We can't reuse caches from different platform when we compile against
different jar on each platform. Since they have same api we may use
platform specific jars only for runtime.
2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov
a4030d3abf Build: Make JavaExec relative path system independent 2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov
08ac7da7a6 Build: Fix input declaration for :kotlin-stdlib-js-ir:fullRuntimeSources
Input order was random because of unordered set
2020-03-03 16:47:55 +03:00
Vyacheslav Gerasimov
bb2cf38617 Build: Make :kotlin-stdlib-js-ir buildKLib tasks cacheable 2020-03-03 16:47:55 +03:00
Alexander Udalov
d84a6fa742 JVM IR: always generate inline class constructor with name 'constructor-impl'
Previously it was 'constructor-' + hash in case inline class property is
of inline class type.

No new tests added because this change fixes the constructor name in
`bytecodeListing/inlineClasses/inlineClassWithInlineClassUnderlyingType.kt`,
which is now failing due to other reasons.

 #KT-37041 Fixed
 #KT-37186
2020-03-03 14:16:03 +01:00
Vyacheslav Gerasimov
688208aa56 Build: Disable caching of Test tasks with doNotCacheIf 2020-03-03 15:55:38 +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
26174 changed files with 712470 additions and 318494 deletions

12
.bunch
View File

@@ -1,6 +1,8 @@
201
202
203_202
193
192
191_192
as35_191_192
as36_192
as40
192_193
as36_192_193
as40_193
as41

4
.gitattributes vendored
View File

@@ -1,4 +1,8 @@
**/testData/** linguist-vendored
*Generated.java linguist-generated=true
* text=auto
* eol=lf
*.png binary
*.jar binary
compiler/cli/bin/* eol=lf
compiler/cli/bin/*.bat eol=crlf

5
.gitignore vendored
View File

@@ -18,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
@@ -49,10 +50,12 @@ build/
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
.idea/artifacts/kotlin_stdlib_js_ir_*
.idea/artifacts/kotlin_test_js_ir_*
.idea/artifacts/kotlin_stdlib_wasm_*
.idea/jarRepositories.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-js-runner/lib/
libraries/tools/kotlin-source-map-loader/lib/
local.properties

View File

@@ -2,6 +2,8 @@
<dictionary name="4u7">
<words>
<w>bintray</w>
<w>cacheability</w>
<w>cacheable</w>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
@@ -9,6 +11,7 @@
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
<w>sonatype</w>
<w>unpresent</w>
</words>
</dictionary>

View File

@@ -1,12 +1,19 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>cinterop</w>
<w>commonizable</w>
<w>commonization</w>
<w>commonize</w>
<w>commonized</w>
<w>commonizer</w>
<w>commonizers</w>
<w>commonizes</w>
<w>commonizing</w>
<w>jetbrains</w>
<w>konan</w>
<w>kotlinx</w>
<w>macos</w>
</words>
</dictionary>
</component>

View File

@@ -6,6 +6,7 @@
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>inlined</w>
<w>kapt</w>
<w>kotlinc</w>
<w>mutators</w>

BIN
.idea/icon.png generated

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

22
.idea/misc.xml generated
View File

@@ -12,14 +12,8 @@
<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">
@@ -30,7 +24,7 @@
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="11">
<list size="14">
<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" />
@@ -42,12 +36,15 @@
<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" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="11">
<list size="14">
<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" />
@@ -59,6 +56,9 @@
<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" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
</list>
</value>
</option>
@@ -66,7 +66,7 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">

20
.idea/runConfigurations/Test__KMM.xml generated Normal file
View File

@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: KMM" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="kmmTest" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: stdlib-js public kotlin api test, overwrite results" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--tests &quot;org.jetbrains.kotlin.js.test.ApiTest&quot; -Poverwrite.output=true --parallel" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":js:js.tests:cleanTest" />
<option value=":js:js.tests:test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>false</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&amp;&amp;!file[*]:testData//*&amp;&amp;!file[*]:*.gradle.kts&amp;&amp;!file[*]:*.gradle" />
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&amp;&amp;!file[*]:testData//*&amp;&amp;!file[*]:*.gradle.kts&amp;&amp;!file[*]:*.gradle&amp;&amp;!file[kotlin.kotlin-ultimate]:*/&amp;&amp;!file[kotlin.kotlin-ultimate.*]:*/&amp;&amp;!file[kotlin.libraries]:stdlib/api//*" />
</component>

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
[![official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_KotlinPublic_Compiler.svg)](https://teamcity.jetbrains.com/buildConfiguration/Kotlin_KotlinPublic_Compiler?branch=%3Cdefault%3E&buildTypeTab=overview&mode=builds)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -37,11 +37,16 @@ In order to build Kotlin distribution you need to have:
JDK_18="path to JDK 1.8"
JDK_9="path to JDK 9"
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 1.8 and JDK 9 installed, and to point JDK_16 and JDK_17 environment variables to your JDK 1.8 installation.
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 1.8 and JDK 9 installed, and to point `JDK_16` and `JDK_17` environment variables to your JDK 1.8 installation.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties) to setup `JDK_*` variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
Note: The JDK 6 for MacOS is not available on Oracle's site. You can install it by
```bash
$ brew tap caskroom/versions
$ brew cask install java6
```
On Windows you might need to add long paths setting to the repo:
@@ -73,7 +78,7 @@ command line parameters on the first run:
- `clean` - clean build results
- `dist` - assembles the compiler distribution into `dist/kotlinc/` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/Kotlin` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/ideaPlugin/Kotlin/` folder
- `install` - build and install all public artifacts into local maven repository
- `runIde` - build IDEA plugin and run IDEA with it
- `coreLibsTest` - build and run stdlib, reflect and kotlin-test tests
@@ -106,28 +111,39 @@ bunch switch 191
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.
After cloning the project, to import the project in IntelliJ choose the project directory in the Open project dialog. Then, after project opened, select
`File` -> `New` -> `Module from Existing Sources...` in the menu, and select `build.gradle.kts` file in the project's root folder.
In the import dialog, select `use default gradle wrapper`.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings after importing the project.
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".
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`.
### Compiling and running
From this root project there are Run/Debug Configurations for running IDEA or the Compiler Tests for example; so if you want to try out the latest and greatest IDEA plugin
From this root project there are Run/Debug Configurations for running `IDEA` or the `Generate Compiler Tests` for example; so if you want to try out the latest and greatest IDEA plugin
* VCS -> Git -> Pull
* Run the "IDEA" run configuration in the project
* a child IntelliJ IDEA with the Kotlin plugin will then startup
* `VCS` -> `Git` -> `Pull`
* Run the `IDEA` run configuration in the project
* A child IntelliJ IDEA with the Kotlin plugin will then startup
### Including into composite build
To include kotlin compiler into [composite build](https://docs.gradle.org/current/userguide/composite_builds.html) you need to define `dependencySubstitution` for `kotlin-compiler` module in `settings.gradle`
To include kotlin compiler into [composite build](https://docs.gradle.org/current/userguide/composite_builds.html) you need to define `dependencySubstitution` for `kotlin-compiler` module in `settings.gradle.kts`
```Kotlin
includeBuild("/path/to/kotlin") {
dependencySubstitution {
substitute(module("org.jetbrains.kotlin:kotlin-compiler"))
.with(project(":include:kotlin-compiler"))
}
}
```
or in `settings.gradle`
```Groovy
includeBuild('/path/to/kotlin') {
dependencySubstitution {
substitute module('org.jetbrains.kotlin:kotlin-compiler') with project(':include:kotlin-compiler')

View File

@@ -75,6 +75,21 @@ benchmark {
include("CommonCallsBenchmark")
//include("InferenceBaselineCallsBenchmark")
}
register("ni") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("useNI", true)
param("isIR", false)
param("size", 1000)
include("InferenceBaselineCallsBenchmark")
include("InferenceExplicitArgumentsCallsBenchmark")
include("InferenceForInApplicableCandidate")
include("InferenceFromArgumentCallsBenchmark")
include("InferenceFromReturnTypeCallsBenchmark")
}
}
targets {
register("main")

View File

@@ -32,8 +32,8 @@ 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.fir.resolve.providers.impl.FirProviderImpl
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveProcessor
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.platform.TargetPlatform
@@ -66,25 +66,25 @@ 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)
)
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.put(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, "../compiler/cli/cli-common/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
)
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(
LanguageFeature.NewInference to newInferenceState
)
)
return configuration
}
@@ -105,21 +105,21 @@ abstract class AbstractSimpleFileBenchmark {
fun setUp() {
if (isIR && !useNewInference) error("Invalid configuration")
env = KotlinCoreEnvironment.createForTests(
myDisposable,
newConfiguration(useNewInference),
EnvironmentConfigFiles.JVM_CONFIG_FILES
myDisposable,
newConfiguration(useNewInference),
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
if (isIR) {
Extensions.getArea(env.project)
.getExtensionPoint(PsiElementFinder.EP_NAME)
.unregisterExtension(JavaElementFinder::class.java)
.getExtensionPoint(PsiElementFinder.EP_NAME)
.unregisterExtension(JavaElementFinder::class.java)
}
file = createFile(
"test.kt",
buildText(),
env.project
"test.kt",
buildText(),
env.project
)
}
@@ -134,22 +134,22 @@ abstract class AbstractSimpleFileBenchmark {
private fun analyzeGreenFileFrontend(bh: Blackhole) {
val tracker = ExceptionTracker()
val storageManager: StorageManager =
LockBasedStorageManager.createWithExceptionHandling("benchmarks", tracker)
LockBasedStorageManager.createWithExceptionHandling("benchmarks", tracker)
val context = SimpleGlobalContext(storageManager, tracker)
val module =
ModuleDescriptorImpl(
Name.special("<benchmark>"), storageManager,
JvmBuiltIns(storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
)
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) }
moduleContext.project,
listOf(file),
NoScopeRecordCliBindingTrace(),
env.configuration,
{ scope -> JvmPackagePartProvider(LANGUAGE_FEATURE_SETTINGS, scope) }
)
assert(result.bindingContext.diagnostics.none { it.severity == Severity.ERROR })
@@ -159,17 +159,15 @@ abstract class AbstractSimpleFileBenchmark {
private fun analyzeGreenFileIr(bh: Blackhole) {
val scope = GlobalSearchScope.filesScope(env.project, listOf(file.virtualFile))
.uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(env.project))
.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 totalTransformer = FirTotalResolveProcessor(session)
val firFile = builder.buildFirFile(file).also(firProvider::recordFile)
for (transformer in totalTransformer.transformers) {
transformer.transformFile(firFile, null)
}
totalTransformer.process(listOf(firFile))
bh.consume(firFile.hashCode())
}
@@ -178,37 +176,37 @@ abstract class AbstractSimpleFileBenchmark {
}
fun createSession(
environment: KotlinCoreEnvironment,
sourceScope: GlobalSearchScope,
librariesScope: GlobalSearchScope = GlobalSearchScope.notScope(sourceScope)
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 {
return FirJavaModuleBasedSession.create(moduleInfo, provider, sourceScope).also {
createSessionForDependencies(provider, moduleInfo, librariesScope, environment)
}
}
private fun createSessionForDependencies(
provider: FirProjectSessionProvider,
moduleInfo: FirTestModuleInfo,
librariesScope: GlobalSearchScope,
environment: KotlinCoreEnvironment
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)
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
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,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 {
appendLine("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
for (i in 1..size) {
appendLine("interface A$i {")
appendLine(" fun foo$i()")
appendLine("}")
appendLine()
}
appendLine()
append("fun test(")
append((1..size).joinToString(", ") { "a$it: A$it" })
appendLine(" {")
for (i in 1..size) {
appendLine("with(a$i) {")
}
for (i in 1..size) {
appendLine("foo$i()")
}
for (i in 1..size) {
appendLine("}")
}
appendLine("}")
}
}
}

View File

@@ -0,0 +1,49 @@
/*
* 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 PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark() {
@Param("9", "10", "11", "12", "13", "14")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText(): String = buildString {
appendLine(
"""
class A {
operator fun <T : Number> plus(other: (Int) -> T): A = this
operator fun <T : CharSequence> plusAssign(other: (String) -> T) {}
}
""".trimIndent()
)
appendLine("fun test() {")
appendLine("var a = A()")
for (i in 1..size) {
appendLine("a += {")
}
for (i in 1..size) {
appendLine(
"""
it.inc()
1
}
""".trimIndent()
)
}
appendLine()
}
}

View File

@@ -1,4 +1,3 @@
description = "Kotlin Build Common"
plugins {
@@ -12,7 +11,7 @@ dependencies {
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(project(":js:js.config"))
compileOnly(project(":kotlin-util-klib-metadata"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
@@ -23,8 +22,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

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.compilerRunner
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.messages.OutputMessageUtil
@@ -25,7 +25,7 @@ class MessageCollectorToOutputItemsCollectorAdapter(
private val delegate: MessageCollector,
private val outputCollector: OutputItemsCollector
) : MessageCollector by delegate {
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) {
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageSourceLocation?) {
// TODO: consider adding some other way of passing input -> output mapping from compiler, e.g. dedicated service
OutputMessageUtil.parseOutputMessage(message)?.let {
outputCollector.add(it.sourceFiles, it.outputFile)

View File

@@ -128,8 +128,8 @@ open class IncrementalJsCache(
}
for ((srcFile, irData) in incrementalResults.irFileData) {
val (fileData, symbols, types, strings, declarations, bodies, fqn) = irData
irTranslationResults.put(srcFile, fileData, symbols, types, strings, declarations, bodies, fqn)
val (fileData, types, signatures, strings, declarations, bodies, fqn) = irData
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn)
}
}
@@ -240,8 +240,8 @@ private class TranslationResultMap(
private object IrTranslationResultValueExternalizer : DataExternalizer<IrTranslationResultValue> {
override fun save(output: DataOutput, value: IrTranslationResultValue) {
output.writeArray(value.fileData)
output.writeArray(value.symbols)
output.writeArray(value.types)
output.writeArray(value.signatures)
output.writeArray(value.strings)
output.writeArray(value.declarations)
output.writeArray(value.bodies)
@@ -262,14 +262,14 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
override fun read(input: DataInput): IrTranslationResultValue {
val fileData = input.readArray()
val symbols = 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, symbols, types, strings, declarations, bodies, fqn)
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn)
}
}
@@ -280,8 +280,8 @@ private class IrTranslationResultMap(
BasicStringMap<IrTranslationResultValue>(storageFile, IrTranslationResultValueExternalizer) {
override fun dumpValue(value: IrTranslationResultValue): String =
"Filedata: ${value.fileData.md5()}, " +
"Symbols: ${value.symbols.md5()}, " +
"Types: ${value.types.md5()}, " +
"Signatures: ${value.signatures.md5()}, " +
"Strings: ${value.strings.md5()}, " +
"Declarations: ${value.declarations.md5()}, " +
"Bodies: ${value.bodies.md5()}"
@@ -289,15 +289,15 @@ private class IrTranslationResultMap(
fun put(
sourceFile: File,
newFiledata: ByteArray,
newSymbols: ByteArray,
newTypes: ByteArray,
newSignatures: ByteArray,
newStrings: ByteArray,
newDeclarations: ByteArray,
newBodies: ByteArray,
fqn: ByteArray
) {
storage[pathConverter.toPath(sourceFile)] =
IrTranslationResultValue(newFiledata, newSymbols, newTypes, newStrings, newDeclarations, newBodies, fqn)
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn)
}
operator fun get(sourceFile: File): IrTranslationResultValue? =

View File

@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.org.objectweb.asm.*
import java.io.File
@@ -476,8 +477,21 @@ open class IncrementalJvmCache(
if (inlineFunctions.isEmpty()) return emptyMap()
val result = HashMap<String, Long>()
var dummyVersion: Int = -1
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visit(
version: Int,
access: Int,
name: String?,
signature: String?,
superName: String?,
interfaces: Array<out String>?
) {
super.visit(version, access, name, signature, superName, interfaces)
dummyVersion = version
}
override fun visitMethod(
access: Int,
name: String,
@@ -485,7 +499,8 @@ open class IncrementalJvmCache(
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.API_VERSION)
val dummyClassWriter = ClassWriter(0)
dummyClassWriter.visit(dummyVersion, 0, "dummy", null, AsmTypes.OBJECT_TYPE.internalName, null)
return object : MethodVisitor(Opcodes.API_VERSION, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() {
@@ -493,6 +508,7 @@ open class IncrementalJvmCache(
if (jvmName !in inlineFunctions) return
val dummyBytes = dummyClassWriter.toByteArray()!!
val hash = dummyBytes.md5()
result[jvmName] = hash
}

View File

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

View File

@@ -206,6 +206,11 @@ open class ProtoCompareGenerated(
if (!checkStringEquals(old.getExtension(JvmProtoBuf.anonymousObjectOriginName), new.getExtension(JvmProtoBuf.anonymousObjectOriginName))) return false
}
if (old.hasExtension(JvmProtoBuf.jvmClassFlags) != new.hasExtension(JvmProtoBuf.jvmClassFlags)) return false
if (old.hasExtension(JvmProtoBuf.jvmClassFlags)) {
if (old.getExtension(JvmProtoBuf.jvmClassFlags) != new.getExtension(JvmProtoBuf.jvmClassFlags)) return false
}
if (old.getExtensionCount(JsProtoBuf.classAnnotation) != new.getExtensionCount(JsProtoBuf.classAnnotation)) {
return false
}
@@ -264,6 +269,7 @@ open class ProtoCompareGenerated(
JVM_EXT_CLASS_MODULE_NAME,
JVM_EXT_CLASS_LOCAL_VARIABLE_LIST,
JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME,
JVM_EXT_JVM_CLASS_FLAGS,
JS_EXT_CLASS_ANNOTATION_LIST,
JS_EXT_CLASS_CONTAINING_FILE_ID,
JAVA_EXT_IS_PACKAGE_PRIVATE_CLASS,
@@ -332,6 +338,11 @@ open class ProtoCompareGenerated(
if (!checkStringEquals(old.getExtension(JvmProtoBuf.anonymousObjectOriginName), new.getExtension(JvmProtoBuf.anonymousObjectOriginName))) result.add(ProtoBufClassKind.JVM_EXT_ANONYMOUS_OBJECT_ORIGIN_NAME)
}
if (old.hasExtension(JvmProtoBuf.jvmClassFlags) != new.hasExtension(JvmProtoBuf.jvmClassFlags)) result.add(ProtoBufClassKind.JVM_EXT_JVM_CLASS_FLAGS)
if (old.hasExtension(JvmProtoBuf.jvmClassFlags)) {
if (old.getExtension(JvmProtoBuf.jvmClassFlags) != new.getExtension(JvmProtoBuf.jvmClassFlags)) result.add(ProtoBufClassKind.JVM_EXT_JVM_CLASS_FLAGS)
}
if (old.getExtensionCount(JsProtoBuf.classAnnotation) != new.getExtensionCount(JsProtoBuf.classAnnotation)) {
result.add(ProtoBufClassKind.JS_EXT_CLASS_ANNOTATION_LIST)
}
@@ -1735,6 +1746,10 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
hashCode = 31 * hashCode + stringIndexes(getExtension(JvmProtoBuf.anonymousObjectOriginName))
}
if (hasExtension(JvmProtoBuf.jvmClassFlags)) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.jvmClassFlags)
}
for(i in 0..getExtensionCount(JsProtoBuf.classAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JsProtoBuf.classAnnotation, i).hashCode(stringIndexes, fqNameIndexes, typeById)
}

View File

@@ -28,42 +28,42 @@ 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
import kotlin.collections.LinkedHashSet
const val DELETE_MODULE_FILE_PROPERTY = "kotlin.delete.module.file.after.build"
fun makeModuleFile(
name: String,
isTest: Boolean,
outputDir: File,
sourcesToCompile: Iterable<File>,
commonSources: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpath: Iterable<File>,
friendDirs: Iterable<File>
name: String,
isTest: Boolean,
outputDir: File,
sourcesToCompile: Iterable<File>,
commonSources: Iterable<File>,
javaSourceRoots: Iterable<JvmSourceRoot>,
classpath: Iterable<File>,
friendDirs: Iterable<File>
): File {
val builder = KotlinModuleXmlBuilder()
builder.addModule(
name,
outputDir.absolutePath,
// important to transform file to absolute paths,
// otherwise compiler will use module file's parent as base path (a temporary file; see below)
// (see org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.getAbsolutePaths)
sourcesToCompile.map { it.absoluteFile },
javaSourceRoots,
classpath,
commonSources.map { it.absoluteFile },
null,
"java-production",
isTest,
// this excludes the output directories from the class path, to be removed for true incremental compilation
setOf(outputDir),
friendDirs
name,
outputDir.absolutePath,
// important to transform file to absolute paths,
// otherwise compiler will use module file's parent as base path (a temporary file; see below)
// (see org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.getAbsolutePaths)
sourcesToCompile.map { it.absoluteFile },
javaSourceRoots,
classpath,
commonSources.map { it.absoluteFile },
null,
"java-production",
isTest,
// this excludes the output directories from the class path, to be removed for true incremental compilation
setOf(outputDir),
friendDirs
)
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
@@ -84,9 +84,9 @@ private fun sanitizeJavaIdentifier(string: String) =
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
compilationCanceledStatus: CompilationCanceledStatus?
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,
compilationCanceledStatus: CompilationCanceledStatus?
): Services =
with(Services.Builder()) {
register(LookupTracker::class.java, lookupTracker)
@@ -106,12 +106,14 @@ fun updateIncrementalCache(
for (generatedFile in generatedFiles) {
when {
generatedFile is GeneratedJvmClass -> cache.saveFileToCache(generatedFile, changesCollector)
generatedFile.outputFile.isModuleMappingFile() -> cache.saveModuleMappingToCache(generatedFile.sourceFiles, generatedFile.outputFile)
generatedFile.outputFile.isModuleMappingFile() -> cache.saveModuleMappingToCache(
generatedFile.sourceFiles,
generatedFile.outputFile
)
}
}
javaChangesTracker?.javaClassesUpdates?.forEach {
(source, serializedJavaClass) ->
javaChangesTracker?.javaClassesUpdates?.forEach { (source, serializedJavaClass) ->
cache.saveJavaClassProto(source, serializedJavaClass, changesCollector)
}
@@ -119,9 +121,9 @@ fun updateIncrementalCache(
}
fun LookupStorage.update(
lookupTracker: LookupTracker,
filesToCompile: Iterable<File>,
removedFiles: Iterable<File>
lookupTracker: LookupTracker,
filesToCompile: Iterable<File>,
removedFiles: Iterable<File>
) {
if (lookupTracker !is LookupTrackerImpl) throw AssertionError("Lookup tracker is expected to be LookupTrackerImpl, got ${lookupTracker::class.java}")
@@ -131,8 +133,8 @@ fun LookupStorage.update(
}
data class DirtyData(
val dirtyLookupSymbols: Collection<LookupSymbol> = emptyList(),
val dirtyClassesFqNames: Collection<FqName> = emptyList()
val dirtyLookupSymbols: Collection<LookupSymbol> = emptyList(),
val dirtyClassesFqNames: Collection<FqName> = emptyList()
)
fun ChangesCollector.getDirtyData(
@@ -214,19 +216,21 @@ fun mapClassesFqNamesToFiles(
}
fun withSubtypes(
typeFqName: FqName,
caches: Iterable<IncrementalCacheCommon>
typeFqName: FqName,
caches: Iterable<IncrementalCacheCommon>
): Set<FqName> {
val types = LinkedList(listOf(typeFqName))
val types = LinkedHashSet(listOf(typeFqName))
val subtypes = hashSetOf<FqName>()
while (types.isNotEmpty()) {
val unprocessedType = types.pollFirst()
val iterator = types.iterator()
val unprocessedType = iterator.next()
iterator.remove()
caches.asSequence()
.flatMap { it.getSubtypesOf(unprocessedType) }
.filter { it !in subtypes }
.forEach { types.addLast(it) }
.flatMap { it.getSubtypesOf(unprocessedType) }
.filter { it !in subtypes }
.forEach { types.add(it) }
subtypes.add(unprocessedType)
}

View File

@@ -273,6 +273,10 @@ class DifferenceCalculatorForClass(
isClassAffected = true
areSubclassesAffected = true
}
ProtoBufClassKind.JVM_EXT_JVM_CLASS_FLAGS -> {
isClassAffected = true
areSubclassesAffected = true
}
}
}

View File

@@ -1,81 +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>(
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,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(), 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,122 +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.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,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), 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

@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.JpsPersistentHashMap
import com.intellij.util.io.PersistentHashMap
import java.io.File
@@ -28,10 +28,10 @@ class NonCachingLazyStorage<K, V>(
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: JpsPersistentHashMap<K, V>? = null
private var storage: PersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
@@ -43,7 +43,7 @@ class NonCachingLazyStorage<K, V>(
}
@Synchronized
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
@@ -69,7 +69,7 @@ class NonCachingLazyStorage<K, V>(
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendDataWithoutCache(key, value)
getStorageOrCreateNew().appendData(key) { dataOutput -> valueExternalizer.save(dataOutput, value) }
}
@Synchronized
@@ -79,7 +79,7 @@ class NonCachingLazyStorage<K, V>(
} catch (ignored: Throwable) {
}
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
PersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@@ -101,6 +101,6 @@ class NonCachingLazyStorage<K, V>(
storage?.close()
}
private fun createMap(): JpsPersistentHashMap<K, V> =
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
private fun createMap(): PersistentHashMap<K, V> =
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

@@ -0,0 +1,106 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.DataExternalizer
import com.intellij.util.io.KeyDescriptor
import com.intellij.util.io.JpsPersistentHashMap
import java.io.File
class NonCachingLazyStorage<K, V>(
private val storageFile: File,
private val keyDescriptor: KeyDescriptor<K>,
private val valueExternalizer: DataExternalizer<V>
) : LazyStorage<K, V> {
@Volatile
private var storage: JpsPersistentHashMap<K, V>? = null
@Synchronized
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
if (storage != null) return storage
if (storageFile.exists()) {
storage = createMap()
return storage
}
return null
}
@Synchronized
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
if (storage == null) {
storage = createMap()
}
return storage!!
}
override val keys: Collection<K>
get() = getStorageIfExists()?.allKeysWithExistingMapping ?: listOf()
override operator fun contains(key: K): Boolean =
getStorageIfExists()?.containsMapping(key) ?: false
override operator fun get(key: K): V? =
getStorageIfExists()?.get(key)
override operator fun set(key: K, value: V) {
getStorageOrCreateNew().put(key, value)
}
override fun remove(key: K) {
getStorageIfExists()?.remove(key)
}
override fun append(key: K, value: V) {
getStorageOrCreateNew().appendDataWithoutCache(key, value)
}
@Synchronized
override fun clean() {
try {
storage?.close()
} catch (ignored: Throwable) {
}
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
storage = null
}
@Synchronized
override fun flush(memoryCachesOnly: Boolean) {
val existingStorage = storage ?: return
if (memoryCachesOnly) {
if (existingStorage.isDirty) {
existingStorage.dropMemoryCaches()
}
} else {
existingStorage.force()
}
}
@Synchronized
override fun close() {
storage?.close()
}
private fun createMap(): JpsPersistentHashMap<K, V> =
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
}

View File

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

@@ -208,6 +208,65 @@ public final class DebugJvmModuleProtoBuf {
*/
org.jetbrains.kotlin.metadata.DebugProtoBuf.AnnotationOrBuilder getAnnotationOrBuilder(
int index);
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class>
getOptionalAnnotationClassList();
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class getOptionalAnnotationClass(int index);
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
int getOptionalAnnotationClassCount();
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
java.util.List<? extends org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder>
getOptionalAnnotationClassOrBuilderList();
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder getOptionalAnnotationClassOrBuilder(
int index);
}
/**
* Protobuf type {@code org.jetbrains.kotlin.metadata.jvm.Module}
@@ -320,6 +379,14 @@ public final class DebugJvmModuleProtoBuf {
annotation_.add(input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Annotation.PARSER, extensionRegistry));
break;
}
case 130: {
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
optionalAnnotationClass_ = new java.util.ArrayList<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class>();
mutable_bitField0_ |= 0x00000040;
}
optionalAnnotationClass_.add(input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.PARSER, extensionRegistry));
break;
}
}
}
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -340,6 +407,9 @@ public final class DebugJvmModuleProtoBuf {
if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
annotation_ = java.util.Collections.unmodifiableList(annotation_);
}
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
optionalAnnotationClass_ = java.util.Collections.unmodifiableList(optionalAnnotationClass_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
@@ -628,6 +698,76 @@ public final class DebugJvmModuleProtoBuf {
return annotation_.get(index);
}
public static final int OPTIONAL_ANNOTATION_CLASS_FIELD_NUMBER = 16;
private java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class> optionalAnnotationClass_;
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class> getOptionalAnnotationClassList() {
return optionalAnnotationClass_;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public java.util.List<? extends org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder>
getOptionalAnnotationClassOrBuilderList() {
return optionalAnnotationClass_;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public int getOptionalAnnotationClassCount() {
return optionalAnnotationClass_.size();
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class getOptionalAnnotationClass(int index) {
return optionalAnnotationClass_.get(index);
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder getOptionalAnnotationClassOrBuilder(
int index) {
return optionalAnnotationClass_.get(index);
}
private void initFields() {
packageParts_ = java.util.Collections.emptyList();
metadataParts_ = java.util.Collections.emptyList();
@@ -635,6 +775,7 @@ public final class DebugJvmModuleProtoBuf {
stringTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.StringTable.getDefaultInstance();
qualifiedNameTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.QualifiedNameTable.getDefaultInstance();
annotation_ = java.util.Collections.emptyList();
optionalAnnotationClass_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -666,6 +807,12 @@ public final class DebugJvmModuleProtoBuf {
return false;
}
}
for (int i = 0; i < getOptionalAnnotationClassCount(); i++) {
if (!getOptionalAnnotationClass(i).isInitialized()) {
memoizedIsInitialized = 0;
return false;
}
}
memoizedIsInitialized = 1;
return true;
}
@@ -691,6 +838,9 @@ public final class DebugJvmModuleProtoBuf {
for (int i = 0; i < annotation_.size(); i++) {
output.writeMessage(6, annotation_.get(i));
}
for (int i = 0; i < optionalAnnotationClass_.size(); i++) {
output.writeMessage(16, optionalAnnotationClass_.get(i));
}
getUnknownFields().writeTo(output);
}
@@ -729,6 +879,10 @@ public final class DebugJvmModuleProtoBuf {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(6, annotation_.get(i));
}
for (int i = 0; i < optionalAnnotationClass_.size(); i++) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeMessageSize(16, optionalAnnotationClass_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -843,6 +997,7 @@ public final class DebugJvmModuleProtoBuf {
getStringTableFieldBuilder();
getQualifiedNameTableFieldBuilder();
getAnnotationFieldBuilder();
getOptionalAnnotationClassFieldBuilder();
}
}
private static Builder create() {
@@ -883,6 +1038,12 @@ public final class DebugJvmModuleProtoBuf {
} else {
annotationBuilder_.clear();
}
if (optionalAnnotationClassBuilder_ == null) {
optionalAnnotationClass_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
} else {
optionalAnnotationClassBuilder_.clear();
}
return this;
}
@@ -959,6 +1120,15 @@ public final class DebugJvmModuleProtoBuf {
} else {
result.annotation_ = annotationBuilder_.build();
}
if (optionalAnnotationClassBuilder_ == null) {
if (((bitField0_ & 0x00000040) == 0x00000040)) {
optionalAnnotationClass_ = java.util.Collections.unmodifiableList(optionalAnnotationClass_);
bitField0_ = (bitField0_ & ~0x00000040);
}
result.optionalAnnotationClass_ = optionalAnnotationClass_;
} else {
result.optionalAnnotationClass_ = optionalAnnotationClassBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -1069,6 +1239,32 @@ public final class DebugJvmModuleProtoBuf {
}
}
}
if (optionalAnnotationClassBuilder_ == null) {
if (!other.optionalAnnotationClass_.isEmpty()) {
if (optionalAnnotationClass_.isEmpty()) {
optionalAnnotationClass_ = other.optionalAnnotationClass_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.addAll(other.optionalAnnotationClass_);
}
onChanged();
}
} else {
if (!other.optionalAnnotationClass_.isEmpty()) {
if (optionalAnnotationClassBuilder_.isEmpty()) {
optionalAnnotationClassBuilder_.dispose();
optionalAnnotationClassBuilder_ = null;
optionalAnnotationClass_ = other.optionalAnnotationClass_;
bitField0_ = (bitField0_ & ~0x00000040);
optionalAnnotationClassBuilder_ =
org.jetbrains.kotlin.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getOptionalAnnotationClassFieldBuilder() : null;
} else {
optionalAnnotationClassBuilder_.addAllMessages(other.optionalAnnotationClass_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -1098,6 +1294,12 @@ public final class DebugJvmModuleProtoBuf {
return false;
}
}
for (int i = 0; i < getOptionalAnnotationClassCount(); i++) {
if (!getOptionalAnnotationClass(i).isInitialized()) {
return false;
}
}
return true;
}
@@ -2426,6 +2628,372 @@ public final class DebugJvmModuleProtoBuf {
return annotationBuilder_;
}
private java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class> optionalAnnotationClass_ =
java.util.Collections.emptyList();
private void ensureOptionalAnnotationClassIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
optionalAnnotationClass_ = new java.util.ArrayList<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class>(optionalAnnotationClass_);
bitField0_ |= 0x00000040;
}
}
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder> optionalAnnotationClassBuilder_;
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class> getOptionalAnnotationClassList() {
if (optionalAnnotationClassBuilder_ == null) {
return java.util.Collections.unmodifiableList(optionalAnnotationClass_);
} else {
return optionalAnnotationClassBuilder_.getMessageList();
}
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public int getOptionalAnnotationClassCount() {
if (optionalAnnotationClassBuilder_ == null) {
return optionalAnnotationClass_.size();
} else {
return optionalAnnotationClassBuilder_.getCount();
}
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class getOptionalAnnotationClass(int index) {
if (optionalAnnotationClassBuilder_ == null) {
return optionalAnnotationClass_.get(index);
} else {
return optionalAnnotationClassBuilder_.getMessage(index);
}
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder setOptionalAnnotationClass(
int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class value) {
if (optionalAnnotationClassBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.set(index, value);
onChanged();
} else {
optionalAnnotationClassBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder setOptionalAnnotationClass(
int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder builderForValue) {
if (optionalAnnotationClassBuilder_ == null) {
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.set(index, builderForValue.build());
onChanged();
} else {
optionalAnnotationClassBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder addOptionalAnnotationClass(org.jetbrains.kotlin.metadata.DebugProtoBuf.Class value) {
if (optionalAnnotationClassBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.add(value);
onChanged();
} else {
optionalAnnotationClassBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder addOptionalAnnotationClass(
int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class value) {
if (optionalAnnotationClassBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.add(index, value);
onChanged();
} else {
optionalAnnotationClassBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder addOptionalAnnotationClass(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder builderForValue) {
if (optionalAnnotationClassBuilder_ == null) {
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.add(builderForValue.build());
onChanged();
} else {
optionalAnnotationClassBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder addOptionalAnnotationClass(
int index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder builderForValue) {
if (optionalAnnotationClassBuilder_ == null) {
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.add(index, builderForValue.build());
onChanged();
} else {
optionalAnnotationClassBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder addAllOptionalAnnotationClass(
java.lang.Iterable<? extends org.jetbrains.kotlin.metadata.DebugProtoBuf.Class> values) {
if (optionalAnnotationClassBuilder_ == null) {
ensureOptionalAnnotationClassIsMutable();
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
values, optionalAnnotationClass_);
onChanged();
} else {
optionalAnnotationClassBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder clearOptionalAnnotationClass() {
if (optionalAnnotationClassBuilder_ == null) {
optionalAnnotationClass_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
} else {
optionalAnnotationClassBuilder_.clear();
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public Builder removeOptionalAnnotationClass(int index) {
if (optionalAnnotationClassBuilder_ == null) {
ensureOptionalAnnotationClassIsMutable();
optionalAnnotationClass_.remove(index);
onChanged();
} else {
optionalAnnotationClassBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder getOptionalAnnotationClassBuilder(
int index) {
return getOptionalAnnotationClassFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder getOptionalAnnotationClassOrBuilder(
int index) {
if (optionalAnnotationClassBuilder_ == null) {
return optionalAnnotationClass_.get(index); } else {
return optionalAnnotationClassBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public java.util.List<? extends org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder>
getOptionalAnnotationClassOrBuilderList() {
if (optionalAnnotationClassBuilder_ != null) {
return optionalAnnotationClassBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(optionalAnnotationClass_);
}
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder addOptionalAnnotationClassBuilder() {
return getOptionalAnnotationClassFieldBuilder().addBuilder(
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.getDefaultInstance());
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder addOptionalAnnotationClassBuilder(
int index) {
return getOptionalAnnotationClassFieldBuilder().addBuilder(
index, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.getDefaultInstance());
}
/**
* <code>repeated .org.jetbrains.kotlin.metadata.Class optional_annotation_class = 16;</code>
*
* <pre>
* &#64;OptionalExpectation-annotated annotation classes in this module. This list is only used in the compiler frontend when compiling
* a second-tier multiplatform module against a multiplatform module which uses optional annotations, not actualized on the JVM.
* This is not needed in the IDE because optional annotations can only be used in common modules, where the IDE plugin resolves
* it to the corresponding class with the resolution capabilities of common modules.
* </pre>
*/
public java.util.List<org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder>
getOptionalAnnotationClassBuilderList() {
return getOptionalAnnotationClassFieldBuilder().getBuilderList();
}
private org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder>
getOptionalAnnotationClassFieldBuilder() {
if (optionalAnnotationClassBuilder_ == null) {
optionalAnnotationClassBuilder_ = new org.jetbrains.kotlin.protobuf.RepeatedFieldBuilder<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class, org.jetbrains.kotlin.metadata.DebugProtoBuf.Class.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.ClassOrBuilder>(
optionalAnnotationClass_,
((bitField0_ & 0x00000040) == 0x00000040),
getParentForChildren(),
isClean());
optionalAnnotationClass_ = null;
}
return optionalAnnotationClassBuilder_;
}
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.metadata.jvm.Module)
}
@@ -4644,7 +5212,7 @@ public final class DebugJvmModuleProtoBuf {
"\n,core/metadata.jvm/src/jvm_module.debug" +
".proto\022!org.jetbrains.kotlin.metadata.jv" +
"m\032&core/metadata/src/metadata.debug.prot" +
"o\"\205\003\n\006Module\022F\n\rpackage_parts\030\001 \003(\0132/.or" +
"o\"\316\003\n\006Module\022F\n\rpackage_parts\030\001 \003(\0132/.or" +
"g.jetbrains.kotlin.metadata.jvm.PackageP" +
"arts\022G\n\016metadata_parts\030\002 \003(\0132/.org.jetbr" +
"ains.kotlin.metadata.jvm.PackageParts\022\030\n" +
@@ -4653,16 +5221,18 @@ public final class DebugJvmModuleProtoBuf {
"ringTable\022O\n\024qualified_name_table\030\005 \001(\0132",
"1.org.jetbrains.kotlin.metadata.Qualifie" +
"dNameTable\022=\n\nannotation\030\006 \003(\0132).org.jet" +
"brains.kotlin.metadata.Annotation\"\276\002\n\014Pa" +
"ckageParts\022\027\n\017package_fq_name\030\001 \002(\t\022\030\n\020s" +
"hort_class_name\030\002 \003(\t\022*\n\036multifile_facad" +
"e_short_name_id\030\003 \003(\005B\002\020\001\022#\n\033multifile_f" +
"acade_short_name\030\004 \003(\t\022.\n&class_with_jvm" +
"_package_name_short_name\030\005 \003(\t\022F\n:class_" +
"with_jvm_package_name_multifile_facade_s" +
"hort_name_id\030\007 \003(\005B\002\020\001\0222\n&class_with_jvm",
"_package_name_package_id\030\006 \003(\005B\002\020\001B\030B\026De" +
"bugJvmModuleProtoBuf"
"brains.kotlin.metadata.Annotation\022G\n\031opt" +
"ional_annotation_class\030\020 \003(\0132$.org.jetbr" +
"ains.kotlin.metadata.Class\"\276\002\n\014PackagePa" +
"rts\022\027\n\017package_fq_name\030\001 \002(\t\022\030\n\020short_cl" +
"ass_name\030\002 \003(\t\022*\n\036multifile_facade_short" +
"_name_id\030\003 \003(\005B\002\020\001\022#\n\033multifile_facade_s" +
"hort_name\030\004 \003(\t\022.\n&class_with_jvm_packag" +
"e_name_short_name\030\005 \003(\t\022F\n:class_with_jv",
"m_package_name_multifile_facade_short_na" +
"me_id\030\007 \003(\005B\002\020\001\0222\n&class_with_jvm_packag" +
"e_name_package_id\030\006 \003(\005B\002\020\001B\030B\026DebugJvmM" +
"oduleProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4682,7 +5252,7 @@ public final class DebugJvmModuleProtoBuf {
internal_static_org_jetbrains_kotlin_metadata_jvm_Module_fieldAccessorTable = new
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_org_jetbrains_kotlin_metadata_jvm_Module_descriptor,
new java.lang.String[] { "PackageParts", "MetadataParts", "JvmPackageName", "StringTable", "QualifiedNameTable", "Annotation", });
new java.lang.String[] { "PackageParts", "MetadataParts", "JvmPackageName", "StringTable", "QualifiedNameTable", "Annotation", "OptionalAnnotationClass", });
internal_static_org_jetbrains_kotlin_metadata_jvm_PackageParts_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_org_jetbrains_kotlin_metadata_jvm_PackageParts_fieldAccessorTable = new

View File

@@ -18,6 +18,7 @@ public final class DebugJvmProtoBuf {
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.classModuleName);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.classLocalVariable);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.anonymousObjectOriginName);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.jvmClassFlags);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.packageModuleName);
registry.add(org.jetbrains.kotlin.metadata.jvm.DebugJvmProtoBuf.packageLocalVariable);
}
@@ -4650,6 +4651,21 @@ public final class DebugJvmProtoBuf {
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int JVM_CLASS_FLAGS_FIELD_NUMBER = 104;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*
* <pre>
* isFunctionBodyInInterface: 0 if actual body generated in DefaultImpl, 1 - otherwise (in interface default method)
* </pre>
*/
public static final
org.jetbrains.kotlin.protobuf.GeneratedMessage.GeneratedExtension<
org.jetbrains.kotlin.metadata.DebugProtoBuf.Class,
java.lang.Integer> jvmClassFlags = org.jetbrains.kotlin.protobuf.GeneratedMessage
.newFileScopedGeneratedExtension(
java.lang.Integer.class,
null);
public static final int PACKAGE_MODULE_NAME_FIELD_NUMBER = 101;
/**
* <code>extend .org.jetbrains.kotlin.metadata.Package { ... }</code>
@@ -4758,12 +4774,13 @@ public final class DebugJvmProtoBuf {
"\'.org.jetbrains.kotlin.metadata.Property",
":P\n\034anonymous_object_origin_name\022$.org.j" +
"etbrains.kotlin.metadata.Class\030g \001(\005B\004\230\265" +
"\030\001:I\n\023package_module_name\022&.org.jetbrain" +
"s.kotlin.metadata.Package\030e \001(\005B\004\230\265\030\001:o\n" +
"\026package_local_variable\022&.org.jetbrains." +
"kotlin.metadata.Package\030f \003(\0132\'.org.jetb" +
"rains.kotlin.metadata.PropertyB\022B\020DebugJ" +
"vmProtoBuf"
"\030\001:@\n\017jvm_class_flags\022$.org.jetbrains.ko" +
"tlin.metadata.Class\030h \001(\005:\0010:I\n\023package_" +
"module_name\022&.org.jetbrains.kotlin.metad" +
"ata.Package\030e \001(\005B\004\230\265\030\001:o\n\026package_local" +
"_variable\022&.org.jetbrains.kotlin.metadat" +
"a.Package\030f \003(\0132\'.org.jetbrains.kotlin.m" +
"etadata.PropertyB\022B\020DebugJvmProtoBuf"
};
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -4820,8 +4837,9 @@ public final class DebugJvmProtoBuf {
classModuleName.internalInit(descriptor.getExtensions().get(8));
classLocalVariable.internalInit(descriptor.getExtensions().get(9));
anonymousObjectOriginName.internalInit(descriptor.getExtensions().get(10));
packageModuleName.internalInit(descriptor.getExtensions().get(11));
packageLocalVariable.internalInit(descriptor.getExtensions().get(12));
jvmClassFlags.internalInit(descriptor.getExtensions().get(11));
packageModuleName.internalInit(descriptor.getExtensions().get(12));
packageLocalVariable.internalInit(descriptor.getExtensions().get(13));
org.jetbrains.kotlin.protobuf.ExtensionRegistry registry =
org.jetbrains.kotlin.protobuf.ExtensionRegistry.newInstance();
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.stringIdInTable);

View File

@@ -1,14 +1,13 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.crypto.checksum.Checksum
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
buildscript {
extra["defaultSnapshotVersion"] = "1.4-SNAPSHOT"
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap("1.4.0-dev-1075", cacheRedirectorEnabled))
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
repositories {
bootstrapKotlinRepo?.let(::maven)
@@ -28,9 +27,8 @@ buildscript {
dependencies {
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:6.1.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
}
}
@@ -40,9 +38,12 @@ if (kotlinBuildProperties.buildScanServer != null) {
}
plugins {
base
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
id("org.gradle.crypto.checksum") version "1.2.0"
signing
}
pill {
@@ -55,9 +56,6 @@ pill {
}
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 {
@@ -68,7 +66,11 @@ val configuredJdks: List<JdkId> =
val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
val kotlinVersion by extra(findProperty("deployVersion")?.toString() ?: buildNumber)
val kotlinVersion by extra(
findProperty("deployVersion")?.toString()?.let { deploySnapshotStr ->
if (deploySnapshotStr != "default.snapshot") deploySnapshotStr else defaultSnapshotVersion
} ?: buildNumber
)
val kotlinLanguageVersion by extra("1.4")
@@ -148,6 +150,9 @@ rootProject.apply {
from(rootProject.file("gradle/report.gradle.kts"))
from(rootProject.file("gradle/javaInstrumentation.gradle.kts"))
from(rootProject.file("gradle/jps.gradle.kts"))
from(rootProject.file("gradle/checkArtifacts.gradle.kts"))
from(rootProject.file("gradle/checkCacheability.gradle.kts"))
from(rootProject.file("gradle/retryPublishing.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(project)
@@ -161,25 +166,28 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
val coroutinesVersion = if (Platform[192].orHigher()) "1.2.1" else "1.1.1"
val coroutinesVersion = if (Platform[192].orHigher()) "1.3.7" else "1.1.1"
extra["versions.kotlinx-coroutines-core"] = coroutinesVersion
extra["versions.kotlinx-coroutines-jdk8"] = coroutinesVersion
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
extra["versions.robolectric"] = "3.1"
extra["versions.robolectric"] = "4.0"
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.0.2"
extra["versions.completion-ranking-kotlin"] = "0.1.2"
extra["versions.r8"] = "1.5.70"
val immutablesVersion = "0.3.1"
extra["versions.kotlinx-collections-immutable"] = immutablesVersion
extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
// 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.4-dev-14287"
extra["versions.kotlin-native"] = "1.4-M3-dev-15627"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
@@ -192,20 +200,25 @@ extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf(
if (Platform[191].orHigher()) "asm-all-7.0.1" else "asm-all",
when {
Platform[202].orHigher() -> "asm-all-8.0.1"
else -> "asm-all-7.0.1"
},
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
if (Platform[201].orHigher()) null else "picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
).filterNotNull()
extra["compilerModules"] = arrayOf(
":compiler:util",
":compiler:config",
":compiler:config.jvm",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
@@ -223,6 +236,7 @@ extra["compilerModules"] = arrayOf(
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":compiler:ir.serialization.jvm",
":compiler:ir.interpreter",
":kotlin-util-io",
":kotlin-util-klib",
":kotlin-util-klib-metadata",
@@ -230,16 +244,20 @@ extra["compilerModules"] = arrayOf(
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:javac-wrapper",
":compiler:cli",
":compiler:cli-js",
":compiler:incremental-compilation-impl",
":compiler:compiler.version",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.config",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":native:frontend.native",
":native:kotlin-native-utils",
":compiler",
":kotlin-build-common",
":core:metadata",
@@ -252,23 +270,48 @@ extra["compilerModules"] = arrayOf(
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:fir-serialization",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:lightTree",
":compiler:fir:raw-fir:fir-common",
":compiler:fir:raw-fir:psi2fir",
":compiler:fir:raw-fir:light-tree2fir",
":compiler:fir:fir2ir",
":compiler:fir:fir2ir:jvm-backend",
":compiler:fir:java",
":compiler:fir:jvm"
":compiler:fir:jvm",
":compiler:fir:checkers",
":compiler:fir:analysis-tests"
)
extra["compilerModulesForJps"] = listOf(
":core:type-system",
":kotlin-build-common",
":kotlin-util-io",
":kotlin-util-klib",
":kotlin-util-klib-metadata",
":compiler:cli-common",
":kotlin-compiler-runner",
":daemon-common",
":daemon-common-new",
":core:descriptors",
":core:descriptors.jvm",
":idea:idea-jps-common",
":kotlin-preloader",
":compiler:util",
":compiler:config",
":compiler:config.jvm",
":js:js.config",
":core:util.runtime",
":compiler:compiler.version"
)
val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// 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-annotations-common",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
@@ -281,14 +324,10 @@ val coreLibProjects = listOfNotNull(
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
// ":kotlin-gradle-plugin-integration-tests", // TODO: build fails
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
)
@@ -314,11 +353,27 @@ fun Task.listConfigurationContents(configName: String) {
val defaultJvmTarget = "1.8"
val defaultJavaHome = jdkPath(defaultJvmTarget)
val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toString()?.toBoolean() ?: project.hasProperty("teamcity"))
val ignoreTestFailures by extra(project.kotlinBuildProperties.ignoreTestFailures)
allprojects {
configurations.maybeCreate("embedded")
configurations.maybeCreate("embedded").apply {
isCanBeConsumed = false
isCanBeResolved = true
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
}
}
configurations.maybeCreate("embeddedElements").apply {
extendsFrom(configurations["embedded"])
isCanBeConsumed = true
isCanBeResolved = false
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named("embedded-java-runtime"))
}
}
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
@@ -342,15 +397,17 @@ allprojects {
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies")
maven("https://dl.google.com/dl/android/maven2")
bootstrapKotlinRepo?.let(::maven)
internalKotlinRepo?.let(::maven)
internalBootstrapRepo?.let(::maven)
}
configureJvmProject(javaHome!!, jvmTarget!!)
val commonCompilerArgs = listOfNotNull(
"-Xuse-experimental=kotlin.Experimental",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception",
"-progressive".takeIf { hasProperty("test.progressive.mode") }
)
@@ -385,12 +442,27 @@ allprojects {
isReproducibleFileOrder = true
}
tasks.withType<Test> {
outputs.doNotCacheIf("https://youtrack.jetbrains.com/issue/KT-37089") { true }
}
normalization {
runtimeClasspath {
ignore("META-INF/MANIFEST.MF")
ignore("META-INF/compiler.version")
ignore("META-INF/plugin.xml")
}
}
tasks {
register("listArchives") { listConfigurationContents("archives") }
register("listRuntimeJar") { listConfigurationContents("runtimeJar") }
register("listDistJar") { listConfigurationContents("distJar") }
// Aggregate task for build related checks
register("checkBuild")
}
afterEvaluate {
@@ -427,25 +499,17 @@ allprojects {
?.exclude("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
}
// Aggregate task for build related checks
tasks.register("checkBuild")
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
}
}
gradle.taskGraph.whenReady {
if (isTeamcityBuild) {
logger.warn("CI build profile is active (IC is off, proguard is on). Use -Pteamcity=false to reproduce local build")
for (task in allTasks) {
when (task) {
is AbstractKotlinCompile<*> -> task.incremental = false
is JavaCompile -> task.options.isIncremental = false
}
}
} else {
logger.warn("Local build profile is active (IC is on, proguard is off). Use -Pteamcity=true to reproduce TC build")
}
fun Boolean.toOnOff(): String = if (this) "on" else "off"
val profile = if (isTeamcityBuild) "CI" else "Local"
logger.warn("$profile build profile is active (proguard is ${kotlinBuildProperties.proguard.toOnOff()}" +
", jar compression is ${kotlinBuildProperties.jarCompression.toOnOff()})." +
" Use -Pteamcity=<true|false> to reproduce CI/local build")
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
task.entryCompression = if (kotlinBuildProperties.jarCompression)
@@ -459,6 +523,10 @@ val dist = tasks.register("dist") {
dependsOn(":kotlin-compiler:dist")
}
val syncMutedTests = tasks.register("syncMutedTests") {
dependsOn(":compiler:tests-mutes:run")
}
val copyCompilerToIdeaPlugin by task<Copy> {
dependsOn(dist)
into(ideaPluginDir)
@@ -471,7 +539,7 @@ val ideaPlugin by task<Task> {
}
tasks {
register("clean") {
named("clean") {
doLast {
delete("$buildDir/repo")
delete(distDir)
@@ -484,7 +552,7 @@ tasks {
}
}
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
listOf("clean", "assemble", "install").forEach { taskName ->
register("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
@@ -493,6 +561,8 @@ tasks {
register("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-stdlib-js-ir",
":kotlin-test:kotlin-test-js-ir".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlin-test:kotlin-test-js:kotlin-test-js-it".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
@@ -517,7 +587,7 @@ tasks {
":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests",
":compiler:tests-spec:test",
":compiler:tests-against-klib:test"
)
dependsOn(":plugins:jvm-abi-gen:test")
@@ -536,16 +606,32 @@ tasks {
}
register("wasmCompilerTest") {
dependsOn(":js:js.tests:wasmTest")
// TODO: fix once
// dependsOn(":js:js.tests:wasmTest")
}
register("nativeCompilerTest") {
dependsOn(":native:kotlin-native-utils:test")
}
register("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:raw-fir:psi2fir:test")
dependsOn(":compiler:fir:raw-fir:light-tree2fir:test")
dependsOn(":compiler:fir:analysis-tests:test")
dependsOn(":compiler:fir:fir2ir:test")
dependsOn(":compiler:fir:lightTree:test")
}
register("firAllTest") {
dependsOn(
":dist",
":compiler:fir:raw-fir:psi2fir:test",
":compiler:fir:raw-fir:light-tree2fir:test",
":compiler:fir:analysis-tests:test",
":compiler:fir:fir2ir:test",
":plugins:fir:fir-plugin-prototype:test"
)
}
register("compilerFrontendVisualizerTest") {
dependsOn("compiler:visualizer:test")
}
@@ -553,7 +639,7 @@ tasks {
register("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
dependsOn(":kotlin-scripting-compiler:test")
dependsOn(":kotlin-scripting-compiler-embeddable:test")
dependsOn(":kotlin-scripting-common:test")
dependsOn(":kotlin-scripting-jvm:test")
dependsOn(":kotlin-scripting-jvm-host-test:test")
@@ -564,14 +650,23 @@ tasks {
// dependsOn(":kotlin-scripting-jvm-host-test:embeddableTest")
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
dependsOn(":kotlin-main-kts-test:test")
dependsOn(":kotlin-scripting-ide-services-test:test")
dependsOn(":kotlin-scripting-ide-services-test:embeddableTest")
dependsOn(":kotlin-scripting-js-test:test")
}
register("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("miscCompilerTest")
}
register("miscCompilerTest") {
dependsOn("wasmCompilerTest")
dependsOn("nativeCompilerTest")
dependsOn("firCompilerTest")
dependsOn(":kotlin-daemon-tests:test")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
@@ -582,6 +677,7 @@ tasks {
register("toolsTest") {
dependsOn(":tools:kotlinp:test")
dependsOn(":native:kotlin-klib-commonizer:test")
}
register("examplesTest") {
@@ -612,13 +708,6 @@ tasks {
dependsOn(":jps-plugin:test")
}
register("konan-tests") {
dependsOn("dist")
dependsOn(
":native:kotlin-native-commonizer:test"
)
}
register("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
@@ -640,20 +729,32 @@ tasks {
)
}
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"
)
if (Ide.IJ()) {
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",
":idea:idea-new-project-wizard:test"
)
}
}
register("idea-plugin-tests") {
dependsOn("dist")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests",
"idea-new-project-wizard-tests"
"idea-plugin-additional-tests"
)
if (Ide.IJ()) {
dependsOn("idea-new-project-wizard-tests")
}
}
register("idea-plugin-performance-tests") {
dependsOn("dist")
dependsOn(
":idea:performanceTests:performanceTest"
)
}
@@ -670,7 +771,6 @@ tasks {
dependsOn("dist")
dependsOn(
":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
@@ -687,13 +787,60 @@ tasks {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"konan-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
)
}
register("publishIdeArtifacts") {
idePluginDependency {
dependsOn(
":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:allopen-compiler-plugin-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:incremental-compilation-impl-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-build-common-tests-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-compiler-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-dist-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide:publish",
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide:publish",
":prepare:ide-plugin-dependencies:compiler-components-for-jps:publish",
":kotlin-script-runtime:publish",
":kotlin-script-util:publish",
":kotlin-scripting-common:publish",
":kotlin-scripting-jvm:publish",
":kotlin-scripting-compiler:publish",
":kotlin-scripting-compiler-impl:publish",
":kotlin-android-extensions-runtime:publish",
":kotlin-stdlib-common:publish",
":kotlin-stdlib:publish",
":kotlin-stdlib-jdk7:publish",
":kotlin-stdlib-jdk8:publish",
":kotlin-reflect:publish",
":kotlin-main-kts:publish",
":kotlin-stdlib-js:publish",
":kotlin-test:kotlin-test-js:publish"
)
}
}
register("kmmTest", AggregateTest::class) {
dependsOn(
":idea:idea-gradle:test",
":idea:test",
":compiler:test",
":js:js.tests:test"
)
if (Ide.IJ193.orHigher())
dependsOn(":kotlin-gradle-plugin-integration-tests:test")
if (Ide.AS40.orHigher())
dependsOn(":kotlin-ultimate:ide:android-studio-native:test")
testPatternFile = file("tests/mpp/kmm-patterns.csv")
}
register("test") {
doLast {
@@ -701,9 +848,17 @@ tasks {
}
}
register("check") {
named("check") {
dependsOn("test")
}
named("checkBuild") {
if (kotlinBuildProperties.isTeamcityBuild) {
doFirst {
println("##teamcity[setParameter name='bootstrap.kotlin.version' value='$bootstrapKotlinVersion']")
}
}
}
}
fun CopySpec.setExecutablePermissions() {
@@ -713,15 +868,15 @@ fun CopySpec.setExecutablePermissions() {
val zipCompiler by task<Zip> {
dependsOn(dist)
destinationDir = file(distDir)
archiveName = "kotlin-compiler-$kotlinVersion.zip"
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-compiler-$kotlinVersion.zip")
from(distKotlinHomeDir)
into("kotlinc")
setExecutablePermissions()
doLast {
logger.lifecycle("Compiler artifacts packed to $archivePath")
logger.lifecycle("Compiler artifacts packed to ${archiveFile.get().asFile.absolutePath}")
}
}
@@ -730,6 +885,7 @@ val zipStdlibTests by task<Zip> {
archiveFileName.set("kotlin-stdlib-tests.zip")
from("libraries/stdlib/common/test") { into("common") }
from("libraries/stdlib/test") { into("test") }
from("libraries/kotlin.test/common/src/test/kotlin") { into("kotlin-test") }
doLast {
logger.lifecycle("Stdlib tests are packed to ${archiveFile.get()}")
}
@@ -758,21 +914,45 @@ val zipPlugin by task<Zip> {
}
val destPath = project.findProperty("pluginZipPath") as String?
val dest = File(destPath ?: "$buildDir/kotlin-plugin.zip")
destinationDir = dest.parentFile
archiveName = dest.name
doFirst {
if (destPath == null) throw GradleException("Specify target zip path with 'pluginZipPath' property")
}
destinationDirectory.set(dest.parentFile)
archiveFileName.set(dest.name)
from(src)
into("Kotlin")
setExecutablePermissions()
doLast {
logger.lifecycle("Plugin artifacts packed to $archivePath")
logger.lifecycle("Plugin artifacts packed to $archiveFile")
}
}
fun Project.secureZipTask(zipTask: TaskProvider<Zip>): RegisteringDomainObjectDelegateProviderWithAction<out TaskContainer, Task> {
val checkSumTask = tasks.register("${zipTask.name}Checksum", Checksum::class) {
dependsOn(zipTask)
val compilerFile = zipTask.get().outputs.files.singleFile
files = files(compilerFile)
outputDir = compilerFile.parentFile
algorithm = Checksum.Algorithm.SHA256
}
val signTask = tasks.register("${zipTask.name}Sign", Sign::class) {
description = "Signs the archive produced by the '" + zipTask.name + "' task."
sign(zipTask.get())
}
return tasks.registering {
dependsOn(checkSumTask)
dependsOn(signTask)
}
}
signing {
useGpgCmd()
}
val zipCompilerWithSignature by secureZipTask(zipCompiler)
val zipPluginWithSignature by secureZipTask(zipPlugin)
configure<IdeaModel> {
module {
excludeDirs = files(
@@ -900,3 +1080,15 @@ val Jar.outputFile: File
val Project.sourceSetsOrNull: SourceSetContainer?
get() = convention.findPlugin(JavaPluginConvention::class.java)?.sourceSets
val disableVerificationTasks = System.getProperty("disable.verification.tasks") == "true"
if (disableVerificationTasks) {
gradle.taskGraph.whenReady {
allTasks.forEach {
if (it is VerificationTask) {
logger.info("DISABLED: '$it'")
it.enabled = false
}
}
}
}

View File

@@ -1,11 +1,11 @@
extra["versions.shadow"] = "5.2.0"
extra["versions.native-platform"] = "0.14"
buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
extra["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
repositories {
if (cacheRedirectorEnabled) {
@@ -16,27 +16,29 @@ buildscript {
maven("https://kotlin.bintray.com/kotlin-dependencies")
}
buildSrcKotlinRepo?.let {
project.bootstrapKotlinRepo?.let {
maven(url = it)
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$buildSrcKotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:$buildSrcKotlinVersion")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
}
}
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
logger.info("buildSrcKotlinVersion: " + extra["buildSrcKotlinVersion"])
logger.info("buildSrcKotlinVersion: " + extra["bootstrapKotlinVersion"])
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
apply {
plugin("kotlin")
plugin("kotlin-sam-with-receiver")
from("../gradle/checkCacheability.gradle.kts")
}
plugins {
@@ -46,10 +48,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"
@@ -57,6 +55,10 @@ gradlePlugin {
}
}
kotlinDslPluginOptions {
experimentalWarning.set(false)
}
fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)?.let {
val v = it.toString()
if (v.isBlank()) true
@@ -70,12 +72,12 @@ rootProject.apply {
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"
@@ -87,22 +89,25 @@ repositories {
maven("https://kotlin.bintray.com/kotlin-dependencies")
gradlePluginPortal()
extra["buildSrcKotlinRepo"]?.let {
extra["bootstrapKotlinRepo"]?.let {
maven(url = it)
}
}
dependencies {
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
implementation("com.gradle.publish:plugin-publish-plugin:0.11.0")
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")
implementation("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
implementation("org.jetbrains.intellij.deps:asm-all:7.0.1")
implementation("com.github.jengelman.gradle.plugins:shadow:${rootProject.extra["versions.shadow"]}")
implementation("net.sf.proguard:proguard-gradle:6.2.2")
implementation("org.jetbrains.intellij.deps:asm-all:8.0.1")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}

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

@@ -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

@@ -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

@@ -2,18 +2,20 @@
import org.gradle.internal.os.OperatingSystem
import java.io.Closeable
import java.io.FileWriter
import java.io.OutputStreamWriter
import java.net.URI
import java.text.SimpleDateFormat
import java.util.*
import javax.xml.stream.XMLOutputFactory
import org.jetbrains.kotlin.gradle.tasks.internal.CleanableStore
import java.time.Duration
import java.time.Instant
plugins {
base
}
val verifyDependencyOutput: Boolean by rootProject.extra
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
@@ -22,7 +24,7 @@ val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelea
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val installIntellijUltimate = intellijUltimateEnabled && androidStudioRelease == null
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
@@ -31,7 +33,6 @@ if (intellijVersionDelimiterIndex == -1) {
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("verifyDependencyOutput: $verifyDependencyOutput")
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
@@ -105,7 +106,7 @@ val nodeJSPlugin by configurations.creating
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val dependenciesDir = (findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File)
?: rootProject.rootDir.parentFile.resolve("dependencies")
?: rootProject.gradle.gradleUserHomeDir.resolve("kotlin-build-dependencies")
val customDepsRepoDir = dependenciesDir.resolve("repo")
@@ -147,14 +148,20 @@ val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, custo
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val targetDir = File(repoDir, "$intellijRuntimeAnnotations/$intellijVersion")
val annotationsStore = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath]
val targetDir = annotationsStore[intellijVersion].use()
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doFirst {
annotationsStore.cleanStore()
}
doLast {
writeIvyXml(
customDepsOrg,
@@ -171,7 +178,11 @@ val makeIntellijAnnotations by tasks.registering(Copy::class) {
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
from(provider { sources.map(::zipTree) })
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
@@ -186,8 +197,8 @@ val makeIde = if (androidStudioBuild != null) {
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
@@ -205,7 +216,6 @@ val makeIde = if (androidStudioBuild != null) {
}
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
val buildNodeJsPlugin = buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") {
dependsOn(
@@ -215,15 +225,12 @@ tasks.named("build") {
makeIntellijAnnotations
)
if (installIntellijUltimate) {
dependsOn(buildNodeJsPlugin)
}
}
// Task to delete legacy repo locations
tasks.register<Delete>("cleanLegacy") {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
}
tasks.named<Delete>("clean") {
@@ -236,86 +243,96 @@ fun buildIvyRepositoryTask(
repoDirectory: File,
pathRemap: ((String) -> String)? = null,
sources: File? = null
) = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
): TaskProvider<Task> {
fun ResolvedArtifact.storeDirectory(): CleanableStore =
CleanableStore[repoDirectory.resolve("$organization/${moduleVersion.id.name}").absolutePath]
fun ResolvedArtifact.moduleDirectory(): File =
File(repoDirectory, "$organization/${moduleVersion.id.name}/${moduleVersion.id.version}")
storeDirectory()[moduleVersion.id.version].use()
dependsOn(configuration)
inputs.files(configuration)
return tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
dependsOn(configuration)
inputs.files(configuration)
if (verifyDependencyOutput) {
outputs.dir(provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory()
})
} else {
outputs.upToDateWhen {
configuration.resolvedConfiguration.resolvedArtifacts.single()
.moduleDirectory()
.exists()
}
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
doFirst {
val artifact = configuration.resolvedConfiguration.resolvedArtifacts.single()
val moduleDirectory = artifact.moduleDirectory()
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
artifact.storeDirectory().cleanStore()
from(fileTree.matching {
exclude("**/plugins/Kotlin/**")
})
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
if (moduleDirectory.exists()) {
logger.info("Path ${moduleDirectory.absolutePath} already exists, skipping unpacking.")
return@doFirst
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
with(artifact) {
val artifactsDirectory = File(moduleDirectory, "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
from(
fileTree.matching {
exclude("**/plugins/Kotlin/**")
}
)
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
}
}
}
}
}
}
fun CleanableStore.cleanStore() = cleanDir(Instant.now().minus(Duration.ofDays(30)))
fun writeIvyXml(
organization: String,
moduleName: String,
@@ -335,7 +352,7 @@ fun writeIvyXml(
val ivyFile = targetDir.resolve("$fileName.ivy.xml")
ivyFile.parentFile.mkdirs()
with(XMLWriter(FileWriter(ivyFile))) {
with(XMLWriter(ivyFile.writer())) {
document("UTF-8", "1.0") {
element("ivy-module") {
attribute("version", "2.0")
@@ -359,24 +376,24 @@ fun writeIvyXml(
}
element("publications") {
artifactDir.listFiles()?.filter(::shouldIncludeIntellijJar)?.forEach { jarFile ->
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
emptyElement("artifact") {
attributes(
"name" to relativeName,
"type" to "jar",
"ext" to "jar",
"conf" to "default"
)
}
artifactDir.listFiles()
?.filter(::shouldIncludeIntellijJar)
?.sortedBy { it.name.toLowerCase() }
?.forEach { jarFile ->
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
emptyElement("artifact") {
attributes(
"name" to relativeName,
"type" to "jar",
"ext" to "jar",
"conf" to "default"
)
}
}
sourcesJar.forEach { jarFile ->
emptyElement("artifact") {
val sourcesArtifactName = jarFile.name
.substringBeforeLast("-")
.substringBeforeLast("-")
val sourcesArtifactName = jarFile.name.substringBefore("-$version")
attributes(
"name" to sourcesArtifactName,
"type" to "jar",

View File

@@ -20,15 +20,13 @@ buildscript {
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
}
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
def projectVersions = file("../gradle/versions.properties").text
BuildCacheKt.setupBuildCache(settings)
include "prepare-deps"
def target_AppCode_Clion = buildProperties.includeCidrPlugins && !projectVersions.contains("versions.androidStudioRelease")
@@ -39,9 +37,12 @@ if (target_AppCode_Clion) {
logger.info("Including modules for AC and CL in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else if (target_AndroidStudio) {
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")

View File

@@ -0,0 +1,72 @@
/*
* 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.
*/
import org.gradle.api.GradleException
import org.gradle.api.tasks.*
import org.gradle.api.tasks.testing.Test
import java.io.File
// You can see "How To" via link: https://jetbrains.quip.com/xQ2WAUy9bZmy/How-to-use-AggregateTest-task
open class AggregateTest : Test() { // Inherit from Test to see test results in IDEA Test viewer
private var patterns: MutableMap<String, MutableList<String>> = mutableMapOf()
@InputFile
lateinit var testPatternFile: File
init {
// Set empty FileCollection to avoid NPE when initializing a base 'Test' class
classpath = project.objects.fileCollection()
testClassesDirs = project.objects.fileCollection()
project.gradle.taskGraph.whenReady {
if (allTasks.filterIsInstance<AggregateTest>().isNotEmpty()) {
initPatterns()
allTasks.filterIsInstance<Test>().forEach { testTask -> subTaskConfigure(testTask) }
if (!project.gradle.startParameter.taskNames.all { project.tasks.findByPath(it) is AggregateTest }) {
logger.warn("Please, don't use AggregateTest and non-AggregateTest test tasks together. You can get incorrect results.")
}
}
}
}
private fun initPatterns() {
if (!testPatternFile.exists())
throw GradleException("File with test patterns is not found")
testPatternFile
.readLines()
.asSequence()
.filter { it.isNotEmpty() }
.forEach { line ->
// patternType is exclude or include value
val (pattern, patternType) = line.split(',').map { it.trim() }
patterns.getOrPut(patternType) { mutableListOf() }.add(pattern)
}
}
private fun subTaskConfigure(testTask: Test) {
testTask.outputs.upToDateWhen { false }
testTask.ignoreFailures = true
testTask.filter {
isFailOnNoMatchingTests = false
patterns["include"]?.let {
it.forEach { pattern ->
includeTestsMatching(pattern)
}
}
patterns["exclude"]?.let {
it.forEach { pattern ->
excludeTestsMatching(pattern)
}
}
}
}
@Override
@TaskAction
override fun executeTests() {
// Do nothing
}
}

View File

@@ -1,114 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
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
}
var Project.bootstrapKotlinRepo: String?
get() = this.property("bootstrapKotlinRepo") as String?
private set(value) {
this.extra["bootstrapKotlinRepo"] = value
}
val Project.internalKotlinRepo: String?
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?
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?
val teamCityVersion = project.findProperty("bootstrap.teamcity.kotlin.version") as String?
val teamCityBuild = project.findProperty("bootstrap.teamcity.build.number") as String?
val teamCityProject = project.findProperty("bootstrap.teamcity.project") as String?
val bootstrapSource = when {
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(
project.findProperty("bootstrap.local.version") as String?,
project.findProperty("bootstrap.local.path") as String?
)
teamCityVersion != null -> BootstrapOption.TeamCity(
teamCityVersion,
teamCityBuild,
projectExtId = teamCityProject,
onlySuccessBootstrap = false
)
customVersion != null -> BootstrapOption.Custom(kotlinVersion = customVersion, repo = customRepo)
else -> defaultSource
}
bootstrapSource.applyToProject(project)
project.logger.lifecycle("Using kotlin bootstrap version $bootstrapKotlinVersion from repo $bootstrapKotlinRepo")
}
sealed class BootstrapOption {
abstract fun applyToProject(project: Project)
/** Manual repository and version specification.
*
* If [repo] is not specified the default buildscript and project repositories are used
*/
open class Custom(val kotlinVersion: String, val repo: String?, val cacheRedirector: Boolean = false) : BootstrapOption() {
override fun applyToProject(project: Project) {
project.bootstrapKotlinVersion = kotlinVersion
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 */
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
*
* [kotlinVersion] the version of maven artifacts
* [buildNumber] build number of a teamcity build, by default the same as [kotlinVersion],
* [projectExtId] extId of a teamcity build configuration, by default "Kotlin_dev_Compiler",
* [onlySuccessBootstrap] allow artifacts only from success builds of the default branch tagged with 'bootstrap' tag
*/
class TeamCity(
val kotlinVersion: String,
val 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 = "$teamcityUrl/guestAuth/app/rest/builds/buildType:(id:${projectExtId
?: "Kotlin_dev_Compiler"}),number:${buildNumber ?: kotlinVersion},$query/artifacts/content/maven/"
project.bootstrapKotlinVersion = kotlinVersion
}
}
/**
* Use previously published local artifacts from the build/repo maven repository
*
* [kotlinVersion] version of artifacts, by default the snapshot version of project is used
* [localPath] the path to local repository, if specified it is resolved with respect or project dir
*/
class Local(val kotlinVersion: String? = null, val localPath: String? = null) : BootstrapOption() {
override fun applyToProject(project: Project) {
val repoPath = if (localPath != null)
project.projectDir.resolve(localPath).canonicalFile
else
project.buildDir.resolve("repo")
project.bootstrapKotlinRepo = repoPath.toURI().toString()
project.bootstrapKotlinVersion = kotlinVersion ?: project.property("defaultSnapshotVersion") as String
}
}
}

View File

@@ -0,0 +1,20 @@
/*
* 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.
*/
val KotlinBuildProperties.includeJava9: Boolean
get() = !isInJpsBuildIdeaSync && getBoolean("kotlin.build.java9", true)
val KotlinBuildProperties.useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync || getBoolean("kotlin.build.useBootstrapStdlib", false)
val KotlinBuildProperties.postProcessing: Boolean get() = isTeamcityBuild || getBoolean("kotlin.build.postprocessing", true)
val KotlinBuildProperties.relocation: Boolean get() = postProcessing
val KotlinBuildProperties.proguard: Boolean get() = postProcessing && getBoolean("kotlin.build.proguard", isTeamcityBuild)
val KotlinBuildProperties.jarCompression: Boolean get() = getBoolean("kotlin.build.jar.compression", isTeamcityBuild)
val KotlinBuildProperties.ignoreTestFailures: Boolean get() = getBoolean("ignoreTestFailures", isTeamcityBuild)

View File

@@ -0,0 +1,385 @@
/*
* 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.
*/
import groovy.lang.Closure
import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.*
import org.gradle.internal.jvm.Jvm
import org.gradle.internal.jvm.inspection.JvmVersionDetector
import proguard.ClassSpecification
import java.io.File
import javax.inject.Inject
@CacheableTask
open class CacheableProguardTask @Inject constructor(
private val jvmVersionDetector: JvmVersionDetector
) : proguard.gradle.ProGuardTask() {
@Internal
var jdkHome: File? = null
@get:Optional
@get:Input
internal val jdkMajorVersion: String?
get() = jdkHome?.let { jvmVersionDetector.getJavaVersion(Jvm.forHome(jdkHome)) }?.majorVersion
@CompileClasspath
override fun getLibraryJarFileCollection(): FileCollection = super.getLibraryJarFileCollection().filter { libraryFile ->
jdkHome?.let { !libraryFile.absoluteFile.startsWith(it.absoluteFile) } ?: true
}
@InputFiles
@PathSensitive(PathSensitivity.RELATIVE)
override fun getConfigurationFileCollection(): FileCollection = super.getConfigurationFileCollection()
@InputFiles
@Classpath
override fun getInJarFileCollection(): FileCollection = super.getInJarFileCollection()
@Optional
@OutputFiles
override fun getOutJarFileCollection(): FileCollection = super.getOutJarFileCollection()
@get:Optional
@get:OutputFile
internal val printConfigurationFile: File?
get() = configuration.printConfiguration?.takeIf { it.path.isNotEmpty() }
@Input
override fun getOutJarFilters(): MutableList<Any?> = super.getOutJarFilters()
@Input
override fun getInJarFilters(): MutableList<Any?> = super.getInJarFilters()
@Input
override fun getLibraryJarFilters(): MutableList<Any?> = super.getLibraryJarFilters()
@Internal
override fun getOutJarFiles(): MutableList<Any?> = super.getOutJarFiles()
@Internal
override fun getInJarFiles(): MutableList<Any?> = super.getInJarFiles()
@Internal
override fun getInJarCounts(): MutableList<Any?> = super.getInJarCounts()
@Internal
override fun getLibraryJarFiles(): MutableList<Any?> = super.getLibraryJarFiles()
/*
* Inputs properly declared these methods so we don't override them
*
* configuration(configurationFiles: Any?)
* libraryjars(libraryJarFiles: Any?)
* libraryjars(filterArgs: MutableMap<Any?, Any?>?, libraryJarFiles: Any?)
* injars(inJarFiles: Any?)
* injars(filterArgs: MutableMap<Any?, Any?>?, inJarFiles: Any?)
* outjars(outJarFiles: Any?)
* outjars(filterArgs: MutableMap<Any?, Any?>?, outJarFiles: Any?)
* printconfiguration()
* printconfiguration(printConfiguration: Any?)
*/
override fun renamesourcefileattribute() = throw NotImplementedError()
override fun renamesourcefileattribute(newSourceFileAttribute: String?) = throw NotImplementedError()
override fun dontshrink() = throw NotImplementedError()
override fun assumenosideeffects(classSpecificationString: String?) = throw NotImplementedError()
override fun assumenosideeffects(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun keepnames(classSpecificationString: String?) = throw NotImplementedError()
override fun keepnames(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keepnames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keepnames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun printmapping() = throw NotImplementedError()
override fun printmapping(printMapping: Any?) = throw NotImplementedError()
override fun keep(classSpecificationString: String?) = throw NotImplementedError()
override fun keep(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keep(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keep(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun keepdirectories() = throw NotImplementedError()
override fun keepdirectories(filter: String?) = throw NotImplementedError()
override fun dontpreverify() = throw NotImplementedError()
override fun dontnote() = throw NotImplementedError()
override fun dontnote(filter: String?) = throw NotImplementedError()
@Internal
override fun getrenamesourcefileattribute(): Any? = throw NotImplementedError()
override fun useuniqueclassmembernames() = throw NotImplementedError()
override fun overloadaggressively() = throw NotImplementedError()
@Internal
override fun getprintusage(): Any? = throw NotImplementedError()
@Internal
override fun getforceprocessing(): Any? = throw NotImplementedError()
override fun whyareyoukeeping(classSpecificationString: String?) = throw NotImplementedError()
override fun whyareyoukeeping(classSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun whyareyoukeeping(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun obfuscationdictionary(obfuscationDictionary: Any?) = throw NotImplementedError()
override fun adaptclassstrings() = throw NotImplementedError()
override fun adaptclassstrings(filter: String?) = throw NotImplementedError()
override fun applymapping(applyMapping: Any?) = throw NotImplementedError()
override fun mergeinterfacesaggressively() = throw NotImplementedError()
@Internal
override fun getdontwarn(): Any? = throw NotImplementedError()
override fun ignorewarnings() = throw NotImplementedError()
@Internal
override fun getaddconfigurationdebugging(): Any? = throw NotImplementedError()
override fun field(memberSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
@Internal
override fun getallowaccessmodification(): Any? = throw NotImplementedError()
override fun constructor(memberSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun dontusemixedcaseclassnames() = throw NotImplementedError()
@Internal
override fun getignorewarnings(): Any? = throw NotImplementedError()
@Internal
override fun getkeepdirectories(): Any? = throw NotImplementedError()
override fun classobfuscationdictionary(classObfuscationDictionary: Any?) = throw NotImplementedError()
override fun verbose() = throw NotImplementedError()
override fun optimizations(filter: String?) = throw NotImplementedError()
@Internal
override fun getuseuniqueclassmembernames(): Any? = throw NotImplementedError()
@Internal
override fun getmicroedition(): Any? = throw NotImplementedError()
override fun assumenoescapingparameters(classSpecificationString: String?) = throw NotImplementedError()
override fun assumenoescapingparameters(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
@Internal
override fun getandroid(): Any? = throw NotImplementedError()
override fun keeppackagenames() = throw NotImplementedError()
override fun keeppackagenames(filter: String?) = throw NotImplementedError()
@Internal
override fun getoverloadaggressively(): Any? = throw NotImplementedError()
override fun skipnonpubliclibraryclasses() = throw NotImplementedError()
@Internal
override fun getdontusemixedcaseclassnames(): Any? = throw NotImplementedError()
@Internal
override fun getdontnote(): Any? = throw NotImplementedError()
override fun assumenoexternalreturnvalues(classSpecificationString: String?) = throw NotImplementedError()
override fun assumenoexternalreturnvalues(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun target(targetClassVersion: String?) = throw NotImplementedError()
override fun keepattributes() = throw NotImplementedError()
override fun keepattributes(filter: String?) = throw NotImplementedError()
override fun keepclassmembernames(classSpecificationString: String?) = throw NotImplementedError()
override fun keepclassmembernames(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keepclassmembernames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keepclassmembernames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
@Internal
override fun getdontpreverify(): Any? = throw NotImplementedError()
@Internal
override fun getverbose(): Any? = throw NotImplementedError()
@Internal
override fun getskipnonpubliclibraryclasses(): Any? = throw NotImplementedError()
@Internal
override fun getdontoptimize(): Any? = throw NotImplementedError()
override fun keepclasseswithmembernames(classSpecificationString: String?) = throw NotImplementedError()
override fun keepclasseswithmembernames(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keepclasseswithmembernames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keepclasseswithmembernames(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun keepclasseswithmembers(classSpecificationString: String?) = throw NotImplementedError()
override fun keepclasseswithmembers(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keepclasseswithmembers(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keepclasseswithmembers(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
@Internal
override fun getdump(): Any? = throw NotImplementedError()
override fun printseeds() = throw NotImplementedError()
override fun printseeds(printSeeds: Any?) = throw NotImplementedError()
override fun dontoptimize() = throw NotImplementedError()
override fun dontobfuscate() = throw NotImplementedError()
override fun extendClassSpecifications(
classSpecifications: MutableList<Any?>?,
classSpecification: ClassSpecification?
): MutableList<Any?> = throw NotImplementedError()
override fun allowaccessmodification() = throw NotImplementedError()
@Internal
override fun getdontobfuscate(): Any? = throw NotImplementedError()
@Internal
override fun getprintmapping(): Any? = throw NotImplementedError()
override fun flattenpackagehierarchy() = throw NotImplementedError()
override fun flattenpackagehierarchy(flattenPackageHierarchy: String?) = throw NotImplementedError()
override fun android() = throw NotImplementedError()
override fun dump() = throw NotImplementedError()
override fun dump(dump: Any?) = throw NotImplementedError()
@Internal
override fun getdontshrink(): Any? = throw NotImplementedError()
@Internal
override fun getkeepattributes(): Any? = throw NotImplementedError()
override fun microedition() = throw NotImplementedError()
override fun keepparameternames() = throw NotImplementedError()
override fun addconfigurationdebugging() = throw NotImplementedError()
override fun packageobfuscationdictionary(packageObfuscationDictionary: Any?) = throw NotImplementedError()
@Internal
override fun getdontskipnonpubliclibraryclassmembers(): Any? = throw NotImplementedError()
override fun dontskipnonpubliclibraryclassmembers() = throw NotImplementedError()
@Internal
override fun getprintconfiguration(): Any? = throw NotImplementedError()
override fun forceprocessing() = throw NotImplementedError()
override fun keepclassmembers(classSpecificationString: String?) = throw NotImplementedError()
override fun keepclassmembers(keepArgs: MutableMap<Any?, Any?>?, classSpecificationString: String?) = throw NotImplementedError()
override fun keepclassmembers(keepClassSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
override fun keepclassmembers(keepClassSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
@Internal
override fun getmergeinterfacesaggressively(): Any? = throw NotImplementedError()
@Internal
override fun getConfigurationFiles(): MutableList<Any?> = throw NotImplementedError()
@Internal
override fun getkeeppackagenames(): Any? = throw NotImplementedError()
override fun assumevalues(classSpecificationString: String?) = throw NotImplementedError()
override fun assumevalues(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun printusage() = throw NotImplementedError()
override fun printusage(printUsage: Any?) = throw NotImplementedError()
@Internal
override fun getprintseeds(): Any? = throw NotImplementedError()
@Internal
override fun getadaptresourcefilenames(): Any? = throw NotImplementedError()
override fun assumenoexternalsideeffects(classSpecificationString: String?) = throw NotImplementedError()
override fun assumenoexternalsideeffects(classSpecificationArgs: MutableMap<Any?, Any?>?, classMembersClosure: Closure<*>?) = throw NotImplementedError()
override fun dontwarn() = throw NotImplementedError()
override fun dontwarn(filter: String?) = throw NotImplementedError()
@Internal
override fun getrepackageclasses(): Any? = throw NotImplementedError()
@Internal
override fun getadaptresourcefilecontents(): Any? = throw NotImplementedError()
@Internal
override fun getflattenpackagehierarchy(): Any? = throw NotImplementedError()
override fun optimizationpasses(optimizationPasses: Int) = throw NotImplementedError()
override fun adaptresourcefilenames() = throw NotImplementedError()
override fun adaptresourcefilenames(filter: String?) = throw NotImplementedError()
override fun method(memberSpecificationArgs: MutableMap<Any?, Any?>?) = throw NotImplementedError()
@Internal
override fun getadaptclassstrings(): Any? = throw NotImplementedError()
override fun repackageclasses() = throw NotImplementedError()
override fun repackageclasses(repackageClasses: String?) = throw NotImplementedError()
@Internal
override fun getkeepparameternames(): Any? = throw NotImplementedError()
override fun adaptresourcefilecontents() = throw NotImplementedError()
override fun adaptresourcefilecontents(filter: String?) = throw NotImplementedError()
}

View File

@@ -7,10 +7,12 @@ import org.gradle.api.Task
import org.gradle.api.file.CopySourceSpec
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.gradle.kotlin.dsl.*
import proguard.gradle.ProGuardTask
import java.io.File
import java.util.concurrent.Callable
@@ -56,6 +58,7 @@ fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaE
classpath = (sourceSet ?: testSourceSet).runtimeClasspath
main = fqName
workingDir = rootDir
systemProperty("line.separator", "\n")
}
fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)?.let {
@@ -69,3 +72,11 @@ inline fun CopySourceSpec.from(crossinline filesProvider: () -> Any?): CopySourc
fun Project.javaPluginConvention(): JavaPluginConvention = the()
fun Project.findJavaPluginConvention(): JavaPluginConvention? = convention.findByType() ?: convention.findPlugin()
fun JavaExec.pathRelativeToWorkingDir(file: File): String = file.relativeTo(workingDir).invariantSeparatorsPath
fun Task.singleOutputFile(): File = when (this) {
is AbstractArchiveTask -> archiveFile.get().asFile
is ProGuardTask -> project.file(outJarFiles.single()!!)
else -> outputs.files.singleFile
}

View File

@@ -26,10 +26,12 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P183, P191, P192, P193;
P183, P191, P192, P193, P201, P202;
val version: Int = name.drop(1).toInt()
val displayVersion: String = "20${name.drop(1).dropLast(1)}.${name.last()}"
override fun matches(ide: Ide) = ide.platform == this
companion object {
@@ -44,14 +46,22 @@ enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ191(Platform.P191),
IJ192(Platform.P192),
IJ193(Platform.P193),
IJ201(Platform.P201),
IJ202(Platform.P202),
AS35(Platform.P183),
AS36(Platform.P192),
AS40(Platform.P193);
AS40(Platform.P193),
AS41(Platform.P201);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()
val displayVersion: String = when (kind) {
Kind.IntelliJ -> "IJ${platform.displayVersion}"
Kind.AndroidStudio -> "Studio${name.substringAfter("AS").toCharArray().joinToString(separator = ".")}"
}
override fun matches(ide: Ide) = ide == this
enum class Kind(val shortName: String) {

View File

@@ -6,14 +6,29 @@ import org.gradle.api.Task
import org.gradle.api.artifacts.ConfigurablePublishArtifact
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.PublishArtifact
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
import org.gradle.api.attributes.Bundling
import org.gradle.api.attributes.Category
import org.gradle.api.attributes.LibraryElements
import org.gradle.api.attributes.Usage
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPlugin.*
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.tasks.GenerateModuleMetadata
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.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.*
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer
import plugins.KotlinBuildPublishingPlugin
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -26,7 +41,7 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
pluginManager.withPlugin("java") {
from(testSourceSet.output)
}
classifier = "tests"
archiveClassifier.set("tests")
body()
project.addArtifact(testsJarCfg, this, this)
}
@@ -56,18 +71,26 @@ fun Project.noDefaultJar() {
}
}
fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun <T : Task> Project.runtimeJarArtifactBy(
task: TaskProvider<T>,
artifactRef: Any,
body: ConfigurablePublishArtifact.() -> Unit = {}
) {
addArtifact("archives", task, artifactRef, body)
addArtifact("runtimeJar", task, artifactRef, body)
configurations.findByName("runtime")?.let {
addArtifact(it, task, artifactRef, body)
addArtifact(it.name, task, artifactRef, body)
}
}
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", body)) { }
fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {}): TaskProvider<T> {
tasks.named<Jar>("jar").configure {
removeArtifacts(configurations.getOrCreate("archives"), this)
}
task.configure {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
@@ -76,21 +99,47 @@ fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {})
}
}
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
body()
project.runtimeJarArtifactBy(this, this)
}
project.runtimeJarArtifactBy(task, task)
val runtimeJar = configurations.maybeCreate("runtimeJar").apply {
isCanBeConsumed = true
isCanBeResolved = false
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
}
}
configurePublishedComponent {
withVariantsFromConfiguration(configurations[RUNTIME_ELEMENTS_CONFIGURATION_NAME]) { skip() }
addVariantsFromConfiguration(runtimeJar) { }
}
return task
}
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") {
configure<JavaPluginExtension> {
withSourcesJar()
}
val sourcesJar = getOrCreateTask<Jar>("sourcesJar") {
fun Project.mainJavaPluginSourceSet() = findJavaPluginConvention()?.sourceSets?.findByName("main")
fun Project.mainKotlinSourceSet() =
(extensions.findByName("kotlin") as? KotlinSourceSetContainer)?.sourceSets?.findByName("main")
fun Project.sources() = mainJavaPluginSourceSet()?.allSource ?: mainKotlinSourceSet()?.kotlin
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("sources")
from(project.mainSourceSet.allSource)
from(project.sources())
project.configurations.findByName("embedded")?.let { embedded ->
from(provider {
@@ -99,10 +148,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
.map { it.id.componentIdentifier }
.filterIsInstance<ProjectComponentIdentifier>()
.mapNotNull {
project(it.projectPath)
.findJavaPluginConvention()
?.mainSourceSet
?.allSource
project(it.projectPath).sources()
}
})
}
@@ -110,13 +156,21 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
body()
}
addArtifact("archives", task)
addArtifact("sources", task)
addArtifact("archives", sourcesJar)
addArtifact("sources", sourcesJar)
return task
configurePublishedComponent {
addVariantsFromConfiguration(configurations[SOURCES_ELEMENTS_CONFIGURATION_NAME]) { }
}
return sourcesJar
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
configure<JavaPluginExtension> {
withJavadocJar()
}
val javadocTask = getOrCreateTask<Jar>("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveClassifier.set("javadoc")
@@ -128,9 +182,40 @@ fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
}
addArtifact("archives", javadocTask)
configurePublishedComponent {
addVariantsFromConfiguration(configurations[JAVADOC_ELEMENTS_CONFIGURATION_NAME]) { }
}
return javadocTask
}
fun Project.modularJar(body: Jar.() -> Unit): TaskProvider<Jar> {
val modularJar = configurations.maybeCreate("modularJar").apply {
isCanBeConsumed = true
isCanBeResolved = false
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named("modular-jar"))
}
}
val modularJarTask = getOrCreateTask<Jar>("modularJar") {
archiveClassifier.set("modular")
body()
}
addArtifact("modularJar", modularJarTask)
addArtifact("archives", modularJarTask)
configurePublishedComponent {
addVariantsFromConfiguration(modularJar) { mapToMavenScope("runtime") }
}
return modularJarTask
}
fun Project.standardPublicJars() {
runtimeJar()
@@ -138,7 +223,22 @@ fun Project.standardPublicJars() {
javadocJar()
}
fun Project.publish(body: Upload.() -> Unit = {}): Upload {
fun Project.publish(moduleMetadata: Boolean = false, configure: MavenPublication.() -> Unit = { }) {
apply<KotlinBuildPublishingPlugin>()
if (!moduleMetadata) {
tasks.withType<GenerateModuleMetadata> {
enabled = false
}
}
val publication = extensions.findByType<PublishingExtension>()
?.publications
?.findByName(KotlinBuildPublishingPlugin.PUBLICATION_NAME) as MavenPublication
publication.configure()
}
fun Project.publishWithLegacyMavenPlugin(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
if (artifactsRemovedDiagnosticFlag) {
@@ -155,12 +255,87 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
fun Project.idePluginDependency(block: () -> Unit) {
val shouldActivate = rootProject.findProperty("publish.ide.plugin.dependencies")?.toString()?.toBoolean() == true
if (shouldActivate) {
block()
}
}
fun Project.publishProjectJars(projects: List<String>, libraryDependencies: List<String> = emptyList()) {
apply<JavaPlugin>()
val fatJarContents by configurations.creating
dependencies {
for (projectName in projects) {
fatJarContents(project(projectName)) { isTransitive = false }
}
for (libraryDependency in libraryDependencies) {
fatJarContents(libraryDependency)
}
}
publish()
val jar: Jar by tasks
jar.apply {
dependsOn(fatJarContents)
from {
fatJarContents.map(::zipTree)
}
}
sourcesJar {
from {
projects.map {
project(it).mainSourceSet.allSource
}
}
}
javadocJar()
}
fun Project.publishTestJar(projectName: String) {
apply<JavaPlugin>()
val fatJarContents by configurations.creating
dependencies {
fatJarContents(project(projectName, configuration = "tests-jar")) { isTransitive = false }
}
publish()
val jar: Jar by tasks
jar.apply {
dependsOn(fatJarContents)
from {
fatJarContents.map(::zipTree)
}
}
sourcesJar {
from {
project(projectName).testSourceSet.allSource
}
}
javadocJar()
}
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(baseName: String, classifier: String = "") {
val buildNumber = project.rootProject.extra["buildNumber"] as String
this.baseName = baseName
this.classifier = classifier
this.archiveBaseName.set(baseName)
this.archiveClassifier.set(classifier)
manifest.attributes.apply {
put("Implementation-Vendor", "JetBrains")
put("Implementation-Title", baseName)
@@ -179,9 +354,26 @@ fun Project.addArtifact(configuration: Configuration, task: Task, artifactRef: A
fun Project.addArtifact(configurationName: String, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun <T : Task> Project.addArtifact(configurationName: String, task: TaskProvider<T>, body: ConfigurablePublishArtifact.() -> Unit = {}) {
fun <T : Task> Project.addArtifact(
configurationName: String,
task: TaskProvider<T>,
body: ConfigurablePublishArtifact.() -> Unit = {}
): PublishArtifact {
configurations.maybeCreate(configurationName)
artifacts.add(configurationName, task, body)
return artifacts.add(configurationName, task, body)
}
fun <T : Task> Project.addArtifact(
configurationName: String,
task: TaskProvider<T>,
artifactRef: Any,
body: ConfigurablePublishArtifact.() -> Unit = {}
): PublishArtifact {
configurations.maybeCreate(configurationName)
return artifacts.add(configurationName, artifactRef) {
builtBy(task)
body()
}
}
fun Project.cleanArtifacts() {
@@ -191,3 +383,6 @@ fun Project.cleanArtifacts() {
}
}
}
fun Project.configurePublishedComponent(configure: AdhocComponentWithVariants.() -> Unit) =
(components.findByName(KotlinBuildPublishingPlugin.ADHOC_COMPONENT_NAME) as AdhocComponentWithVariants?)?.apply(configure)

View File

@@ -2,21 +2,34 @@
// usages in build scripts are not tracked properly
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.GradleException
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() =
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"
}
val Project.internalBootstrapRepo: String? get() =
when {
bootstrapKotlinRepo?.startsWith("https://buildserver.labs.intellij.net") == true ->
bootstrapKotlinRepo!!.replace("artifacts/content/maven", "artifacts/content/internal/repo")
else -> "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:$bootstrapKotlinVersion," +
"branch:default:any/artifacts/content/internal/repo/"
}
val Project.intellijRepo get() = "https://www.jetbrains.com/intellij-repository/" + if (isSnapshotIntellij) "snapshots" else "releases"
fun Project.commonDep(coord: String): String {
val parts = coord.split(':')
@@ -129,6 +142,12 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
}
fun Project.toolsJarApi(): Any =
if (kotlinBuildProperties.isInJpsBuildIdeaSync)
files(toolsJarFile() ?: error("tools.jar is not found!"))
else
dependencies.project(":dependencies:tools-jar-api")
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? =

View File

@@ -11,17 +11,19 @@ import java.io.File
val kotlinEmbeddableRootPackage = "org.jetbrains.kotlin"
val packagesToRelocate =
listOf( "com.intellij",
"com.google",
"com.sampullara",
"org.apache",
"org.jdom",
"org.picocontainer",
"org.jline",
"org.fusesource",
"kotlinx.coroutines",
"net.jpountz",
"one.util.streamex")
listOf(
"com.intellij",
"com.google",
"com.sampullara",
"org.apache",
"org.jdom",
"org.picocontainer",
"org.jline",
"org.fusesource",
"net.jpountz",
"one.util.streamex",
"kotlinx.collections.immutable"
)
// The shaded compiler "dummy" is used to rewrite dependencies in projects that are used with the embeddable compiler
// on the runtime and use some shaded dependencies from the compiler

View File

@@ -24,11 +24,14 @@ 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 org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.register
import java.io.File
private fun Project.kotlinBuildLocalDependenciesDir(): File =
(findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File) ?: project.rootDir.absoluteFile.resolve("dependencies")
(findProperty("kotlin.build.dependencies.dir") as String?)?.let(::File)
?: rootProject.gradle.gradleUserHomeDir.resolve("kotlin-build-dependencies")
private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenciesDir().resolve("repo")
@@ -174,12 +177,17 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Didea.tooling.debug=true",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
jvmArgs("-Didea.platform.prefix=Idea")
}
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")
}

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,420 +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("compileClasspath", "compileOnly") to Scope.PROVIDED,
listOf("embedded") to Scope.COMPILE
)
private val TEST_CONFIGURATION_MAPPING = mapOf(
listOf("runtimeClasspath", "testRuntimeClasspath") to Scope.RUNTIME,
listOf("compileClasspath", "testCompileClasspath", "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,343 +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 lateinit var intellijCoreDir: 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)
intellijCoreDir = File(platformDir.parentFile.parentFile.parentFile, "intellij-core")
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"
)
val kotlinJunitConfiguration = runManagerComponent.getOrCreateChild(
"configuration",
"default" to "true",
"type" to "KotlinJUnit",
"factoryName" to "Kotlin JUnit"
)
fun Element.applyJUnitTemplate() {
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"))
}
if (options.none { it == "-ea" }) {
options += "-ea"
}
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
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(" "))
}
}
junitConfiguration.applyJUnitTemplate()
kotlinJunitConfiguration.applyJUnitTemplate()
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) || it.startsWith(intellijCoreDir) }) {
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,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

@@ -0,0 +1,76 @@
/*
* 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.
*/
import com.gradle.publish.PluginBundleExtension
import com.gradle.publish.PluginConfig
import org.gradle.api.Project
import org.gradle.api.publish.PublicationContainer
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.*
import plugins.KotlinBuildPublishingPlugin
import plugins.configureRepository
import java.util.*
internal const val PLUGIN_MARKER_SUFFIX = ".gradle.plugin"
@UseExperimental(ExperimentalStdlibApi::class)
fun Project.publishPluginMarkers(withEmptyJars: Boolean = true) {
val pluginDevelopment = extensions.getByType<PluginBundleExtension>()
val publishingExtension = extensions.getByType<PublishingExtension>()
val mainPublication = publishingExtension.publications[KotlinBuildPublishingPlugin.PUBLICATION_NAME] as MavenPublication
pluginDevelopment.plugins.forEach { declaration ->
val markerPublication = createMavenMarkerPublication(declaration, mainPublication, publishingExtension.publications)
if (withEmptyJars) {
addEmptyJarArtifacts(markerPublication)
}
tasks.named<PublishToMavenRepository>(
"publish${markerPublication.name.capitalize(Locale.ROOT)}PublicationTo${KotlinBuildPublishingPlugin.REPOSITORY_NAME}Repository"
).configureRepository()
}
}
fun Project.addEmptyJarArtifacts(publication: MavenPublication) {
val emptyJar = getOrCreateTask<Jar>("emptyJar") {
archiveBaseName.set("empty")
}
publication.artifact(emptyJar.get()) { }
publication.artifact(emptyJar.get()) { classifier = "sources" }
publication.artifact(emptyJar.get()) { classifier = "javadoc" }
}
// Based on code from `java-gradle-plugin`
// https://github.com/gradle/gradle/blob/v6.4.0/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L84
private fun createMavenMarkerPublication(
declaration: PluginConfig,
coordinates: MavenPublication,
publications: PublicationContainer
): MavenPublication {
return publications.create<MavenPublication>(declaration.name.toString() + "PluginMarkerMaven") {
val pluginId: String = declaration.id
artifactId = pluginId + PLUGIN_MARKER_SUFFIX
groupId = pluginId
pom.withXml {
val root = asElement()
val document = root.ownerDocument
val dependencies = root.appendChild(document.createElement("dependencies"))
val dependency = dependencies.appendChild(document.createElement("dependency"))
val groupId = dependency.appendChild(document.createElement("groupId"))
groupId.textContent = coordinates.groupId
val artifactId = dependency.appendChild(document.createElement("artifactId"))
artifactId.textContent = coordinates.artifactId
val version = dependency.appendChild(document.createElement("version"))
version.textContent = coordinates.version
}
pom.name.set(declaration.displayName)
pom.description.set(declaration.description)
}
}

View File

@@ -5,10 +5,12 @@
import com.jakewharton.dex.*
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.tasks.*
import org.gradle.jvm.tasks.Jar
import java.io.File
@CacheableTask
open class DexMethodCount : DefaultTask() {
data class Counts(
@@ -19,34 +21,23 @@ open class DexMethodCount : DefaultTask() {
val byClass: Map<String, Int>
)
init {
outputs.upToDateWhen { !shouldPrintTeamCityStatistics } // always execute when teamCityStatistics output is required
}
@InputFile
@Classpath
lateinit var jarFile: File
@Input
@Optional
@Input
var ownPackages: List<String>? = null
// ##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}' value='62362']
@Input
@Optional
var teamCityStatistics: Boolean? = null
private val shouldPrintTeamCityStatistics = teamCityStatistics ?: project.hasProperty("teamcity")
@Input
@Optional
@Internal
var artifactName: String? = null
private val artifactOrArchiveName get() = artifactName ?: project.name
@get:Input
val artifactOrArchiveName: String
get() = artifactName ?: project.name
fun from(jar: Jar) {
jarFile = jar.archivePath
artifactName = jar.baseName
jarFile = jar.archiveFile.get().asFile
artifactName = jar.archiveBaseName.orNull
dependsOn(jar)
}
@@ -54,16 +45,13 @@ open class DexMethodCount : DefaultTask() {
lateinit var counts: Counts
@get:OutputFile
val detailOutputFile: File get() = project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
val detailOutputFile: File
get() = project.buildDir.resolve("$artifactOrArchiveName-method-count.txt")
@TaskAction
fun invoke() {
val methods = dexMethods(jarFile)
val counts = methods.getCounts().also { this.counts = it }
printTotals(counts)
printTCStats(counts)
outputDetails(counts)
}
@@ -71,7 +59,7 @@ open class DexMethodCount : DefaultTask() {
val byPackage = this.groupingBy { it.`package` }.eachCount()
val byClass = this.groupingBy { it.declaringType }.eachCount()
val ownPackages = ownPackages?.map { it + '.' }
val ownPackages = ownPackages?.map { "$it." }
val byOwnPackages = if (ownPackages != null) {
this.partition { method -> ownPackages.any { method.declaringType.startsWith(it) } }.let {
it.first.size to it.second.size
@@ -87,26 +75,6 @@ open class DexMethodCount : DefaultTask() {
)
}
private fun printTotals(counts: Counts) {
logger.lifecycle("Artifact $artifactOrArchiveName, total methods: ${counts.total}")
ownPackages?.let { packages ->
logger.lifecycle("Artifact $artifactOrArchiveName, total methods from packages ${packages.joinToString { "$it.*" }}: ${counts.totalOwnPackages}")
logger.lifecycle("Artifact $artifactOrArchiveName, total methods from other packages: ${counts.totalOtherPackages}")
}
}
private fun printTCStats(counts: Counts) {
if (shouldPrintTeamCityStatistics) {
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}' value='${counts.total}']")
counts.totalOwnPackages?.let { value ->
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}_OwnPackages' value='$value']")
}
counts.totalOtherPackages?.let { value ->
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}_OtherPackages' value='$value']")
}
}
}
private fun outputDetails(counts: Counts) {
detailOutputFile.printWriter().use { writer ->
writer.println("${counts.total.padRight()}\tTotal methods")
@@ -126,9 +94,67 @@ open class DexMethodCount : DefaultTask() {
}
}
}
}
open class DexMethodCountStats : DefaultTask() {
@Internal
lateinit var from: TaskProvider<DexMethodCount>
@get:InputFile
internal val inputFile
get() = from.get().detailOutputFile
@TaskAction
private fun printStats() {
val artifactOrArchiveName = from.get().artifactOrArchiveName
inputFile.reader().useLines { lines ->
fun String.getStatValue() = substringBefore("\t").trim()
val ownPackages = from.get().ownPackages
val statsLineCount = if (ownPackages == null) 1 else 3
val stats = lines.take(statsLineCount).map { it.getStatValue() }.toList()
val total = stats[0]
logger.lifecycle("Artifact $artifactOrArchiveName, total methods: $total")
if (project.kotlinBuildProperties.isTeamcityBuild) {
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}' value='$total']")
}
ownPackages?.let { packages ->
val totalOwnPackages = stats[1]
val totalOtherPackages = stats[2]
logger.lifecycle("Artifact $artifactOrArchiveName, total methods from packages ${packages.joinToString { "$it.*" }}: $totalOwnPackages")
logger.lifecycle("Artifact $artifactOrArchiveName, total methods from other packages: $totalOtherPackages")
if (project.kotlinBuildProperties.isTeamcityBuild) {
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}_OwnPackages' value='$totalOwnPackages']")
println("##teamcity[buildStatisticValue key='DexMethodCount_${artifactOrArchiveName}_OtherPackages' value='$totalOtherPackages']")
}
}
}
}
}
fun Project.printStats(dexMethodCount: TaskProvider<DexMethodCount>) {
val dexMethodCountStats = tasks.register("dexMethodCountStats", DexMethodCountStats::class.java) {
dependsOn(dexMethodCount)
from = dexMethodCount
}
dexMethodCount.configure {
finalizedBy(dexMethodCountStats)
}
}
fun Project.dexMethodCount(action: DexMethodCount.() -> Unit): TaskProvider<DexMethodCount> {
val dexMethodCount = tasks.register("dexMethodCount", DexMethodCount::class.java, action)
printStats(dexMethodCount)
tasks.getByName("check").dependsOn(dexMethodCount)
return dexMethodCount
}
private val DexMethod.`package`: String get() = declaringType.substringBeforeLast('.')
private fun Int.padRight() = toString().padStart(5, ' ')

View File

@@ -0,0 +1,160 @@
/*
* 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 plugins
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.attributes.Usage
import org.gradle.api.component.AdhocComponentWithVariants
import org.gradle.api.component.SoftwareComponentFactory
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import java.net.URI
import java.util.*
import javax.inject.Inject
class KotlinBuildPublishingPlugin @Inject constructor(
private val componentFactory: SoftwareComponentFactory
) : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
apply<MavenPublishPlugin>()
apply<SigningPlugin>()
val publishedRuntime = configurations.maybeCreate(RUNTIME_CONFIGURATION).apply {
isCanBeConsumed = false
isCanBeResolved = false
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
}
}
val publishedCompile = configurations.maybeCreate(COMPILE_CONFIGURATION).apply {
isCanBeConsumed = false
isCanBeResolved = false
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_API))
}
}
val kotlinLibraryComponent = componentFactory.adhoc(ADHOC_COMPONENT_NAME) as AdhocComponentWithVariants
components.add(kotlinLibraryComponent)
kotlinLibraryComponent.addVariantsFromConfiguration(publishedCompile) { mapToMavenScope("compile") }
kotlinLibraryComponent.addVariantsFromConfiguration(publishedRuntime) { mapToMavenScope("runtime") }
pluginManager.withPlugin("java-base") {
val runtimeElements by configurations
val apiElements by configurations
publishedRuntime.extendsFrom(runtimeElements)
publishedCompile.extendsFrom(apiElements)
kotlinLibraryComponent.addVariantsFromConfiguration(runtimeElements) {
mapToMavenScope("runtime")
if (configurationVariant.artifacts.any { JavaBasePlugin.UNPUBLISHABLE_VARIANT_ARTIFACTS.contains(it.type) }) {
skip()
}
}
}
configure<PublishingExtension> {
publications {
create<MavenPublication>(PUBLICATION_NAME) {
from(kotlinLibraryComponent)
pom {
packaging = "jar"
name.set(humanReadableName(project))
description.set(project.description ?: humanReadableName(project))
url.set("https://kotlinlang.org/")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
url.set("https://github.com/JetBrains/kotlin")
connection.set("scm:git:https://github.com/JetBrains/kotlin.git")
developerConnection.set("scm:git:https://github.com/JetBrains/kotlin.git")
}
developers {
developer {
name.set("Kotlin Team")
organization.set("JetBrains")
organizationUrl.set("https://www.jetbrains.com")
}
}
}
}
}
repositories {
maven {
name = REPOSITORY_NAME
url = file("${project.rootDir}/build/repo").toURI()
}
}
}
configure<SigningExtension> {
setRequired(provider {
project.findProperty("signingRequired")?.toString()?.toBoolean()
?: project.property("isSonatypeRelease") as Boolean
})
sign(extensions.getByType<PublishingExtension>().publications[PUBLICATION_NAME])
}
tasks.register("install") {
dependsOn(tasks.named("publishToMavenLocal"))
}
tasks.named<PublishToMavenRepository>("publish${PUBLICATION_NAME}PublicationTo${REPOSITORY_NAME}Repository")
.configureRepository()
}
companion object {
const val PUBLICATION_NAME = "Main"
const val REPOSITORY_NAME = "Maven"
const val ADHOC_COMPONENT_NAME = "kotlinLibrary"
const val COMPILE_CONFIGURATION = "publishedCompile"
const val RUNTIME_CONFIGURATION = "publishedRuntime"
@UseExperimental(ExperimentalStdlibApi::class)
fun humanReadableName(project: Project) =
project.name.split("-").joinToString(separator = " ") { it.capitalize(Locale.ROOT) }
}
}
fun TaskProvider<PublishToMavenRepository>.configureRepository() = configure {
dependsOn(project.rootProject.tasks.named("preparePublication"))
doFirst {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
val username: String? by preparePublication.extra
val password: String? by preparePublication.extra
val repoUrl: String by preparePublication.extra
repository.apply {
url = project.uri(repoUrl)
if (url.scheme != "file" && username != null && password != null) {
credentials {
this.username = username
this.password = password
}
}
}
}
}

View File

@@ -31,12 +31,18 @@ open class PublishedKotlinModule : Plugin<Project> {
plugins.apply("maven")
val publishedRuntime by configurations.creating {
configurations.maybeCreate("publishedRuntime").apply {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
}
configurations.maybeCreate("publishedCompile").apply {
the<MavenPluginConvention>()
.conf2ScopeMappings
.addMapping(0, this, Conf2ScopeMappingContainer.COMPILE)
}
if (!project.hasProperty("prebuiltJar")) {
plugins.apply("signing")

View File

@@ -23,3 +23,15 @@ fun DependencyHandler.publishedRuntime(
): ExternalModuleDependency =
addDependencyTo(this, "publishedRuntime", dependencyNotation, dependencyConfiguration)
val NamedDomainObjectContainer<Configuration>.publishedCompile: NamedDomainObjectProvider<Configuration> get() = named("publishedCompile")
fun DependencyHandler.publishedCompile(dependencyNotation: Any): Dependency? =
add("publishedCompile", dependencyNotation)
fun DependencyHandler.publishedCompile(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "publishedCompile", dependencyNotation, dependencyConfiguration)

View File

@@ -79,21 +79,20 @@ fun Project.projectTest(
}
}
doFirst {
val agent = tasks.findByPath(":test-instrumenter:jar")!!.outputs.files.singleFile
val args = project.findProperty("kotlin.test.instrumentation.args")?.let { "=$it" }.orEmpty()
jvmArgs("-javaagent:$agent$args")
if (project.findProperty("kotlin.test.instrumentation.disable")?.toString()?.toBoolean() != true) {
doFirst {
val agent = tasks.findByPath(":test-instrumenter:jar")!!.outputs.files.singleFile
val args = project.findProperty("kotlin.test.instrumentation.args")?.let { "=$it" }.orEmpty()
jvmArgs("-javaagent:$agent$args")
}
dependsOn(":test-instrumenter:jar")
}
dependsOn(":test-instrumenter:jar")
jvmArgs(
"-ea",
"-XX:+HeapDumpOnOutOfMemoryError",
"-XX:+UseCodeCacheFlushing",
"-XX:ReservedCodeCacheSize=128m",
"-XX:ReservedCodeCacheSize=256m",
"-Djna.nosys=true"
)
@@ -106,6 +105,11 @@ fun Project.projectTest(
environment("PROJECT_BUILD_DIR", buildDir)
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
systemProperty("org.jetbrains.kotlin.skip.muted.tests", if (rootProject.hasProperty("skipMutedTests")) "true" else "false")
if (Platform[202].orHigher()) {
systemProperty("idea.ignore.disabled.plugins", "true")
}
var subProjectTempRoot: Path? = null
doFirst {
@@ -154,6 +158,10 @@ object TaskUtils {
fun useAndroidJar(task: Task) {
task.useAndroidConfiguration(systemPropertyName = "android.jar", configName = "androidJar")
}
fun useAndroidEmulator(task: Task) {
task.useAndroidConfiguration(systemPropertyName = "android.sdk", configName = "androidEmulator")
}
}
private fun Task.useAndroidConfiguration(systemPropertyName: String, configName: String) {

View File

@@ -1,21 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Refresh PILL Model" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="pill" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>

View File

@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
isD8Enabled = project.findProperty('android.enableD8').toBoolean()
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.5.3'
}
}
apply plugin: 'com.android.application'
@@ -19,7 +19,7 @@ repositories {
}
android {
compileSdkVersion 19
compileSdkVersion 26
buildToolsVersion "28.0.3"
defaultConfig {
@@ -51,7 +51,7 @@ android {
dexOptions {
dexInProcess false
javaMaxHeapSize "1200m"
javaMaxHeapSize "1500m"
maxProcessCount 4
additionalParameters "--debug"
}
@@ -60,17 +60,42 @@ android {
resultsDir = "build/test/results"
}
if (isD8Enabled) {
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
flavorDimensions "box"
productFlavors {
ktest0 {
common0 {
dimension "box"
}
ktest1 {
common1 {
dimension "box"
}
common2 {
dimension "box"
}
reflect0 {
dimension "box"
}
if (isD8Enabled) {
jvm80 {
dimension "box"
}
reflectjvm80 {
dimension "box"
}
}
}
}
@@ -78,9 +103,9 @@ android {
task jarTestFolders() {
println "Jar folders..."
new File("${projectDir}/libs/").listFiles().each { File file ->
if (file.isDirectory() && !file.name.equals("test")) {
if (file.isDirectory()) {
println "Jar '${file.name}' folder..."
ant.jar(basedir: "libs/${file.name}/", destfile: "libs/test/" + file.name + ".jar")
ant.jar(basedir: "libs/${file.name}/", destfile: "libs/" + file.name + ".jar")
}
}
}
@@ -90,10 +115,18 @@ tasks.withType(JavaCompile) {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['kotlin-test.jar', 'kotlin-stdlib.jar'])
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
ktest0Implementation fileTree(dir: 'libs/test', include: ['libtest0.jar'])
ktest1Implementation fileTree(dir: 'libs/test', include: ['libtest1.jar'])
android.applicationVariants.all { variant ->
variant.productFlavors.each {
def configuration = configurations.getByName(it.name + 'Implementation').name
add(configuration, project.fileTree(dir: 'libs', include: [it.name + ".jar"]))
if (it.name.startsWith("reflect")) {
add(configuration, project.fileTree(dir: 'libs', include: ['kotlin-reflect.jar']))
}
}
}
}

View File

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

View File

@@ -1,3 +1,4 @@
import TaskUtils.useAndroidEmulator
plugins {
kotlin("jvm")
@@ -13,7 +14,10 @@ dependencies {
compile(project(":kotlin-reflect"))
compile(projectTests(":compiler:tests-common"))
compile(commonDep("junit:junit"))
compileOnly(intellijDep()) { includeJars("openapi") }
Platform[193].orLower {
compileOnly(intellijDep()) { includeJars("openapi") }
}
testCompile(project(":compiler:incremental-compilation-impl"))
testCompile(project(":core:descriptors"))
@@ -21,9 +25,16 @@ dependencies {
testCompile(project(":compiler:frontend.java"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
testCompile(intellijDep()) { includeJars("openapi", "util", "idea", "idea_rt", "groovy-all", rootProject = rootProject) }
Platform[191].orLower {
testCompile(intellijDep()) { includeJars("jps-builders") }
Platform[193].orLower {
testCompile(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", rootProject = rootProject) }
Platform[202].orHigher {
testCompile(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
}
Platform[201].orLower {
testCompile(intellijDep()) { includeJars("groovy-all", rootProject = rootProject) }
}
Platform[192].orHigher {
testCompile(intellijPluginDep("java")) { includeJars("jps-builders") }
@@ -52,6 +63,7 @@ projectTest {
}
workingDir = rootDir
useAndroidEmulator(this)
}
val generateAndroidTests by generator("org.jetbrains.kotlin.android.tests.CodegenTestsOnAndroidGenerator")

View File

@@ -19,10 +19,8 @@ package org.jetbrains.kotlin.android.tests
import com.intellij.util.PlatformUtils
import junit.framework.TestCase
import junit.framework.TestSuite
import org.jetbrains.kotlin.android.tests.download.SDKDownloader
import org.jetbrains.kotlin.android.tests.emulator.Emulator
import org.jetbrains.kotlin.android.tests.gradle.GradleRunner
import org.jetbrains.kotlin.android.tests.run.PermissionManager
import org.junit.Assert
import org.w3c.dom.Element
import org.xml.sax.SAXException
@@ -39,8 +37,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
private fun runTestsInEmulator(): TestSuite {
val rootSuite = TestSuite("Root")
downloadDependencies()
val emulatorType = if (isTeamcity) Emulator.ARM else Emulator.X86
println("Using $emulatorType emulator!")
val emulator = Emulator(pathManager, emulatorType)
@@ -56,16 +52,16 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
try {
emulator.waitEmulatorStart()
runTestsOnEmulator(gradleRunner, TestSuite("Dex")).apply {
runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply {
rootSuite.addTest(this)
}
renameFlavorFolder()
enableD8(true)
runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply {
enableD8(false)
runTestsOnEmulator(gradleRunner, TestSuite("DX")).apply {
(0 until this.countTestCases()).forEach {
val testCase = testAt(it) as TestCase
testCase.name += "_D8"
testCase.name += "_DX"
}
rootSuite.addTest(this)
}
@@ -106,14 +102,14 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
testCases.forEach { aCase -> suite.addTest(aCase) }
Assert.assertNotEquals("There is no test results in report", 0, testCases.size.toLong())
}
} catch (e: Exception) {
} catch (e: Throwable) {
throw RuntimeException("Can't parse test results in $reportFolder\n$resultOutput", e)
}
}
private fun renameFlavorFolder() {
val reportFolder = File(flavorFolder())
reportFolder.renameTo(File(reportFolder.parentFile, reportFolder.name + "_dex"))
reportFolder.renameTo(File(reportFolder.parentFile, reportFolder.name + "_d8"))
}
private fun flavorFolder() = pathManager.tmpFolder + "/build/test/results/connected/flavors"
@@ -134,18 +130,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
}
private fun downloadDependencies() {
val rootForAndroidDependencies = File(pathManager.dependenciesRoot)
if (!rootForAndroidDependencies.exists()) {
rootForAndroidDependencies.mkdirs()
}
val downloader = SDKDownloader(pathManager)
downloader.downloadAll()
downloader.unzipAll()
PermissionManager.setPermissions(pathManager)
}
companion object {
@JvmStatic

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.android.tests;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import java.io.File;
@@ -35,7 +35,7 @@ public class PathManager {
}
public String getAndroidAvdRoot() {
String androidEmulatorRoot = getAndroidSdkRoot() + "/emulatoravd";
String androidEmulatorRoot = getAndroidSdkRoot() + "/compiler_box_test_avd";
new File(androidEmulatorRoot).mkdirs();
return androidEmulatorRoot;
}
@@ -52,12 +52,8 @@ public class PathManager {
return getAndroidSdkRoot() + "/emulator";
}
public String getBuildToolsFolderInAndroidSdk() {
return getAndroidSdkRoot() + "/build-tools";
}
public String getOutputForCompiledFiles(int index) {
return tmpFolder + "/libs/libtest" + index;
public String getOutputForCompiledFiles(String flavor) {
return tmpFolder + "/libs/" + flavor;
}
public String getLibsFolderInAndroidTmpFolder() {
@@ -73,19 +69,7 @@ public class PathManager {
}
public String getAndroidSdkRoot() {
return getDependenciesRoot() + "/android-sdk";
}
public String getDependenciesRoot() {
return rootFolder + "/dependencies/android.tests.dependencies";
}
public String getGradleBinFolder() {
return getDependenciesRoot() + "/gradle-" + SDKDownloader.GRADLE_VERSION + "/bin";
}
public String getRootForDownload() {
return getDependenciesRoot() + "/download";
return KotlinTestUtils.getAndroidSdkSystemIndependentPath();
}
public String getAndroidModuleRoot() {

View File

@@ -1,269 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.android.tests.download;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.kotlin.android.tests.PathManager;
import org.jetbrains.kotlin.android.tests.run.RunUtils;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class SDKDownloader {
private final String platformZipPath;
private final String armImage;
private final String x86Image;
private final String platformToolsZipPath;
private final String skdToolsZipPath;
private final String buildToolsZipPath;
private final String gradleZipPath;
private final String emulatorZipPath;
private final PathManager pathManager;
private static final String PLATFORM_TOOLS = "28.0.1";
private static final String SDK_TOOLS = "4333796"; //"26.1.1";
public static final String BUILD_TOOLS = "28.0.3";
private static final int ANDROID_VERSION = 19;
public static final String GRADLE_VERSION = "5.1.1";
public static final String EMULATOR_TOOLS_VERSION = "5264690"; //"28.0.23";
public SDKDownloader(PathManager pathManager) {
this.pathManager = pathManager;
platformZipPath = pathManager.getRootForDownload() + "/platform" + ANDROID_VERSION + ".zip";
armImage = pathManager.getRootForDownload() + "/arm-image.zip";
x86Image = pathManager.getRootForDownload() + "/x86-image.zip";
platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools" + PLATFORM_TOOLS + ".zip";
skdToolsZipPath = pathManager.getRootForDownload() + "/sdk-tools" + SDK_TOOLS + ".zip";
buildToolsZipPath = pathManager.getRootForDownload() + "/build-tools" + BUILD_TOOLS + ".zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle" + GRADLE_VERSION + ".zip";
emulatorZipPath = pathManager.getRootForDownload() + "/emulator" + EMULATOR_TOOLS_VERSION + ".zip";
}
public void downloadPlatform() {
download("https://dl-ssl.google.com/android/repository/android-" + ANDROID_VERSION + "_r04.zip", platformZipPath); //Same for all platforms
}
private void downloadAbi() {
download("https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-" + ANDROID_VERSION + "_r05.zip", armImage); //Same for all platforms
download("https://dl.google.com/android/repository/sys-img/android/x86-" + ANDROID_VERSION + "_r06.zip", x86Image); //Same for all platforms
}
public void downloadPlatformTools() {
download(getDownloadUrl("https://dl-ssl.google.com/android/repository/platform-tools_r" + PLATFORM_TOOLS), platformToolsZipPath);
}
public void downloadSdkTools() {
download("https://dl.google.com/android/repository/sdk-tools-" + getPlatformName() + "-" + SDK_TOOLS + ".zip",
skdToolsZipPath);
}
public void downloadBuildTools() {
download(getDownloadUrl("https://dl.google.com/android/repository/build-tools_r" + BUILD_TOOLS), buildToolsZipPath);
}
public void downloadEmulator() {
download("https://dl.google.com/android/repository/emulator-" + getPlatformName() + "-" + EMULATOR_TOOLS_VERSION + ".zip",
emulatorZipPath);
}
public void downloadGradle() {
download("https://services.gradle.org/distributions/gradle-" + GRADLE_VERSION + "-bin.zip", gradleZipPath);
}
private static String getDownloadUrl(String prefix) {
String suffix;
if (SystemInfo.isWindows) {
suffix = "-windows.zip";
}
else if (SystemInfo.isMac) {
suffix = "-macosx.zip";
}
else if (SystemInfo.isUnix) {
suffix = "-linux.zip";
}
else {
throw new IllegalStateException("Your operating system isn't supported yet.");
}
return prefix + suffix;
}
private static String getPlatformName() {
if (SystemInfo.isWindows) {
return "windows";
}
else if (SystemInfo.isMac) {
return "darwin";
}
else if (SystemInfo.isUnix) {
return "linux";
}
else {
throw new IllegalStateException("Your operating system isn't supported yet.");
}
}
public void downloadAll() {
downloadSdkTools();
downloadAbi();
downloadPlatform();
downloadPlatformTools();
downloadBuildTools();
downloadGradle();
downloadEmulator();
}
public void unzipAll() {
String androidSdkRoot = pathManager.getAndroidSdkRoot();
unzip(platformZipPath, pathManager.getPlatformFolderInAndroidSdk());
new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-4.4.2").renameTo(new File(pathManager.getPlatformFolderInAndroidSdk() + "/android-" + ANDROID_VERSION));
unzip(armImage, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
unzip(x86Image, androidSdkRoot + "/system-images/android-" + ANDROID_VERSION + "/default/");
unzip(platformToolsZipPath, androidSdkRoot);
unzip(skdToolsZipPath, androidSdkRoot);
unzip(gradleZipPath, pathManager.getDependenciesRoot());
//BUILD TOOLS
String buildTools = androidSdkRoot + "/build-tools/";
unzip(buildToolsZipPath, buildTools);
unzip(emulatorZipPath, androidSdkRoot);
}
public void deleteAll() {
delete(platformZipPath);
delete(platformToolsZipPath);
delete(skdToolsZipPath);
delete(buildToolsZipPath);
delete(armImage);
delete(x86Image);
delete(gradleZipPath);
}
private static void download(String urlString, String output) {
System.out.println("Start downloading: " + urlString + " to " + output);
OutputStream outStream = null;
URLConnection urlConnection;
InputStream is;
try {
URL Url;
byte[] buf;
int read;
//int written = 0;
Url = new URL(urlString);
File outputFile = new File(output);
outputFile.getParentFile().mkdirs();
if (outputFile.exists()) {
System.out.println("File was already downloaded: " + output);
return;
}
outputFile.createNewFile();
FileOutputStream outputStream = new FileOutputStream(outputFile);
outStream = new BufferedOutputStream(outputStream);
urlConnection = Url.openConnection();
is = urlConnection.getInputStream();
buf = new byte[1024];
while ((read = is.read(buf)) != -1) {
outStream.write(buf, 0, read);
//written += read;
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
finally {
RunUtils.close(outStream);
}
System.out.println("Finish downloading: " + urlString + " to " + output);
}
protected void unzip(String pathToFile, String outputFolder) {
System.out.println("Start unzipping: " + pathToFile + " to " + outputFolder);
String pathToUnzip;
if (outputFolder.equals(pathManager.getPlatformFolderInAndroidSdk())) {
pathToUnzip = outputFolder;
}
else {
pathToUnzip = outputFolder + "/" + FileUtil.getNameWithoutExtension(new File(pathToFile));
}
if (new File(pathToUnzip).listFiles() != null) {
System.out.println("File was already unzipped: " + pathToFile);
return;
}
try {
byte[] buf = new byte[1024];
ZipEntry zipEntry = null;
try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(pathToFile))) {
zipEntry = zipInputStream.getNextEntry();
while (zipEntry != null) {
String entryName = zipEntry.getName();
int n;
File outputFile = new File(outputFolder + "/" + entryName);
if (zipEntry.isDirectory()) {
outputFile.mkdirs();
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
continue;
}
else {
File parentFile = outputFile.getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
outputFile.createNewFile();
}
try (FileOutputStream fileOutputStream = new FileOutputStream(outputFile)) {
while ((n = zipInputStream.read(buf, 0, 1024)) > -1) {
fileOutputStream.write(buf, 0, n);
}
}
zipInputStream.closeEntry();
zipEntry = zipInputStream.getNextEntry();
}
}
catch (IOException e) {
if (zipEntry != null) {
System.err.println("Entry name: " + zipEntry.getName());
}
e.printStackTrace();
}
}
catch (Exception e) {
e.printStackTrace();
}
System.out.println("Finish unzipping: " + pathToFile + " to " + outputFolder);
}
private static void delete(String filePath) {
new File(filePath).delete();
}
}

View File

@@ -48,8 +48,8 @@ public class Emulator {
private GeneralCommandLine getCreateCommand() {
GeneralCommandLine commandLine = new GeneralCommandLine();
String androidCmdName = SystemInfo.isWindows ? "android.bat" : "android";
commandLine.setExePath(pathManager.getToolsFolderInAndroidSdk() + "/" + androidCmdName);
String androidCmdName = SystemInfo.isWindows ? "avdmanager.bat" : "avdmanager";
commandLine.setExePath(pathManager.getToolsFolderInAndroidSdk() + "/bin/" + androidCmdName);
commandLine.addParameter("create");
commandLine.addParameter("avd");
commandLine.addParameter("--force");

View File

@@ -31,8 +31,8 @@ public class GradleRunner {
public GradleRunner(PathManager pathManager) {
listOfCommands = new ArrayList<>();
String cmdName = SystemInfo.isWindows ? "gradle.bat" : "gradle";
listOfCommands.add(pathManager.getGradleBinFolder() + "/" + cmdName);
String cmdName = SystemInfo.isWindows ? "gradlew.bat" : "gradlew";
listOfCommands.add(pathManager.getTmpFolder() + "/" + cmdName);
listOfCommands.add("--no-daemon");
listOfCommands.add("--build-file");
listOfCommands.add(pathManager.getTmpFolder() + "/build.gradle");

View File

@@ -1,64 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.android.tests.run;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.kotlin.android.tests.PathManager;
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
import java.io.File;
public class PermissionManager {
private PermissionManager() {
}
public static void setPermissions(PathManager pathManager) {
if (!SystemInfo.isWindows) {
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getPlatformToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() +"/bin"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/bin"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/qemu/linux-x86_64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getAndroidSdkRoot() + "/system-images/android-19/default/armeabi-v7a/"));
RunUtils.execute(generateChmodCmd(pathManager.getGradleBinFolder() + "/gradle"));
}
}
private static void setExecPermissionForSimpleNamedFiles(File folder) {
File[] files = folder.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && !file.getName().contains(".")) {
RunUtils.execute(generateChmodCmd(file.getAbsolutePath()));
}
}
}
}
private static GeneralCommandLine generateChmodCmd(String path) {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath("chmod");
commandLine.addParameter("a+x");
commandLine.addParameter(path);
return commandLine;
}
}

View File

@@ -41,7 +41,7 @@ public class AndroidJpsBuildTestCase extends BaseKotlinJpsBuildTestCase {
}
@Override
protected void runTest() throws Throwable {
protected void runTest() {
doTest();
}

View File

@@ -17,10 +17,10 @@
package org.jetbrains.kotlin.android.tests
import com.intellij.openapi.util.Ref
import org.jetbrains.kotlin.codegen.CodegenTestCase
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.test.KotlinBaseTest
import java.io.File
import java.util.regex.Pattern
@@ -34,7 +34,7 @@ private data class OldPackageAndNew(val oldFqName: FqName, val newFqName: FqName
internal fun patchFilesAndAddTest(
testFile: File,
testFiles: List<CodegenTestCase.TestFile>,
testFiles: List<KotlinBaseTest.TestFile>,
filesHolder: CodegenTestsOnAndroidGenerator.FilesWriter
): FqName? {
if (testFiles.any { it.name.endsWith(".java") }) {
@@ -46,18 +46,21 @@ internal fun patchFilesAndAddTest(
val newPackagePrefix = testFile.path.replace("\\\\|-|\\.|/".toRegex(), "_")
val oldPackage = Ref<FqName>()
val isJvmName = Ref<Boolean>(false)
val isSingle = testFiles.size == 1
val resultFiles = testFiles.map {
val fileName = if (isSingle) it.name else testFile.name.substringBeforeLast(".kt") + "/" + it.name
TestClassInfo(
fileName,
changePackage(newPackagePrefix, it.content, oldPackage),
changePackage(newPackagePrefix, it.content, oldPackage, isJvmName),
oldPackage.get(),
isJvmName.get(),
getGeneratedClassName(File(fileName), it.content, newPackagePrefix, oldPackage.get())
)
}
val packages =
resultFiles.map { OldPackageAndNew(it.oldPackage, it.newClassId.parent()) }.sortedByDescending { it.oldFqName.asString().length }
resultFiles.map { OldPackageAndNew(it.oldPackage, it.newPackagePartClassId.parent()) }
.sortedByDescending { it.oldFqName.asString().length }
//If files contain any val or var declaration with same name as any package name
// then use old conservative renaming scheme, otherwise use aggressive one
@@ -94,7 +97,7 @@ internal fun patchFilesAndAddTest(
/*replace all Class.forName*/
resultFiles.forEach { file ->
file.content = resultFiles.fold(file.content) { r, param ->
patchClassForName(param.newClassId, param.oldPackage, r, conservativeRenameScheme)
patchClassForName(param.newPackagePartClassId, param.oldPackage, r, conservativeRenameScheme)
}
}
@@ -103,6 +106,13 @@ internal fun patchFilesAndAddTest(
file.content = file.content.patchSelfImports(file.newPackage)
}
//patch root package parts usages in strings
resultFiles.forEach { file ->
file.content = resultFiles.fold(file.content) { r, param ->
patchRootPartNamesInStrings(param.newPackagePartClassId, param.oldPackage, param.isJvmName, r)
}
}
val boxFiles = resultFiles.filter { hasBoxMethod(it.content) }
if (boxFiles.size != 1) {
println("Several box methods in $testFile")
@@ -110,22 +120,22 @@ internal fun patchFilesAndAddTest(
filesHolder.addTest(
resultFiles.filter { resultFile -> resultFile.name.endsWith(".kt") || resultFile.name.endsWith(".kts") },
TestInfo("", boxFiles.last().newClassId, testFile)
TestInfo("", boxFiles.last().newPackagePartClassId, testFile)
)
return boxFiles.last().newClassId
return boxFiles.last().newPackagePartClassId
}
private fun hasBoxMethod(text: String): Boolean {
return text.contains("fun box()")
}
class TestClassInfo(val name: String, var content: String, val oldPackage: FqName, val newClassId: FqName) {
val newPackage = newClassId.parent()
class TestClassInfo(val name: String, var content: String, val oldPackage: FqName, val isJvmName: Boolean, val newPackagePartClassId: FqName) {
val newPackage = newPackagePartClassId.parent()
}
private fun changePackage(newPackagePrefix: String, text: String, oldPackage: Ref<FqName>): String {
private fun changePackage(newPackagePrefix: String, text: String, oldPackage: Ref<FqName>, isJvmName: Ref<Boolean>): String {
val matcher = packagePattern.matcher(text)
if (matcher.find()) {
val oldPackageName = matcher.toMatchResult().group(1)
@@ -137,6 +147,7 @@ private fun changePackage(newPackagePrefix: String, text: String, oldPackage: Re
if (text.contains("@file:")) {
val index = text.lastIndexOf("@file:")
val packageDirectiveIndex = text.indexOf("\n", index)
isJvmName.set(true)
return text.substring(0, packageDirectiveIndex + 1) + packageDirective + text.substring(packageDirectiveIndex + 1)
} else {
return packageDirective + text
@@ -169,6 +180,19 @@ private fun patchClassForName(className: FqName, oldPackage: FqName, text: Strin
)
}
private fun patchRootPartNamesInStrings(
className: FqName,
oldPackage: FqName,
isJvmName: Boolean,
text: String
): String {
if (!oldPackage.isRoot || isJvmName) return text
return text.replace(
("\"" + oldPackage.child(className.shortName()).asString()).toRegex(),
"\"" + className.asString()
)
}
private fun patchPackages(newPackage: FqName, oldPackage: FqName, text: String): String {
if (oldPackage.isRoot) return text

View File

@@ -5,7 +5,9 @@
package org.jetbrains.kotlin.android.tests
import com.intellij.openapi.Disposable
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import org.jetbrains.kotlin.cli.common.output.writeAllTo
@@ -17,50 +19,102 @@ import org.jetbrains.kotlin.codegen.GenerationUtils
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.JvmTarget
import org.jetbrains.kotlin.idea.KotlinFileType
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.test.*
import org.junit.Assert
import org.junit.Ignore
import java.io.File
import java.io.FileWriter
import java.io.IOException
import kotlin.test.assertTrue
data class ConfigurationKey(val kind: ConfigurationKind, val jdkKind: TestJdkKind, val configuration: String)
@Ignore
class CodegenTestsOnAndroidGenerator private constructor(private val pathManager: PathManager) : CodegenTestCase() {
private var writtenFilesCount = 0
class CodegenTestsOnAndroidGenerator private constructor(private val pathManager: PathManager) {
private var currentModuleIndex = 1
private val pathFilter: String? = System.getProperties().getProperty("kotlin.test.android.path.filter")
private val pendingUnitTestGenerators = hashMapOf<Int, UnitTestFileWriter>()
private val pendingUnitTestGenerators = hashMapOf<String, UnitTestFileWriter>()
//keep it globally to avoid test grouping on TC
private val generatedTestNames = hashSetOf<String>()
fun getFlavorUnitTestFilePath(index: Int): String {
return pathManager.srcFolderInAndroidTmpFolder + "/androidTestKtest$index/java/" + testClassPackage.replace(
".",
"/"
) + "/" + testClassName + "$index.java"
private val COMMON = FlavorConfig("common", 3);
private val REFLECT = FlavorConfig("reflect", 1);
private val JVM8 = FlavorConfig("jvm8", 1);
private val JVM8REFLECT = FlavorConfig("reflectjvm8", 1);
class FlavorConfig(private val prefix: String, val limit: Int) {
private var writtenFilesCount = 0
fun printStatistics() {
println("FlavorTestCompiler: $prefix, generated file count: $writtenFilesCount")
}
fun getFlavorForNewFiles(newFilesCount: Int): String {
writtenFilesCount += newFilesCount
//2500 files per folder that would be used by flavor to avoid multidex usage,
// each folder would be jared by build.gradle script
val index = writtenFilesCount / 2500
return getFlavorName(index, prefix).also {
assertTrue("Please Add new flavor in build.gradle for $it") { index < limit }
}
}
private fun getFlavorName(index: Int, prefix: String): String {
return prefix + index
}
}
private fun prepareAndroidModuleAndGenerateTests() {
prepareAndroidModule()
private fun prepareAndroidModuleAndGenerateTests(skipSdkDirWriting: Boolean) {
prepareAndroidModule(skipSdkDirWriting)
generateTestsAndFlavourSuites()
}
private fun prepareAndroidModule() {
private fun prepareAndroidModule(skipSdkDirWriting: Boolean) {
FileUtil.copyDir(File(pathManager.androidModuleRoot), File(pathManager.tmpFolder))
writeAndroidSkdToLocalProperties(pathManager)
if (!skipSdkDirWriting) {
writeAndroidSkdToLocalProperties(pathManager)
}
println("Copying kotlin-stdlib.jar and kotlin-reflect.jar in android module...")
copyKotlinRuntimeJars()
copyGradleWrapperAndPatch()
}
private fun copyGradleWrapperAndPatch() {
val projectRoot = File(pathManager.tmpFolder)
val target = File(projectRoot, "gradle/wrapper")
File("./gradle/wrapper/").copyRecursively(target)
val gradlew = File(projectRoot, "gradlew")
File("./gradlew").copyTo(gradlew).also {
if (!SystemInfo.isWindows) {
it.setExecutable(true)
}
}
File("./gradlew.bat").copyTo(File(projectRoot, "gradlew.bat"));
val file = File(target, "gradle-wrapper.properties")
file.readLines().map {
when {
it.startsWith("distributionUrl") -> "distributionUrl=https\\://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip"
it.startsWith("distributionSha256Sum") -> "distributionSha256Sum=$GRADLE_SHA_256"
else -> it
}
}.let { lines ->
FileWriter(file).use { fw ->
lines.forEach { line ->
fw.write("$line\n")
}
}
}
}
private fun copyKotlinRuntimeJars() {
FileUtil.copy(
ForTestCompileRuntime.runtimeJarForTests(),
@@ -96,9 +150,15 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
holders.values.forEach {
it.writeFilesOnDisk()
}
COMMON.printStatistics()
REFLECT.printStatistics()
JVM8.printStatistics()
JVM8REFLECT.printStatistics()
}
internal inner class FilesWriter(
private val flavorConfig: FlavorConfig,
private val configuration: CompilerConfiguration
) {
private val rawFiles = arrayListOf<TestClassInfo>()
@@ -113,38 +173,40 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
}
fun writeFilesOnDisk() {
val disposable = TestDisposable()
val disposable = Disposer.newDisposable()
val environment = KotlinCoreEnvironment.createForTests(
disposable,
configuration.copy().apply { put(CommonConfigurationKeys.MODULE_NAME, "android-module-" + currentModuleIndex++) },
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
writeFiles(
rawFiles.map {
try {
CodegenTestFiles.create(it.name, it.content, environment.project).psiFile
} catch (e: Throwable) {
throw RuntimeException("Error on processing ${it.name}:\n${it.content}", e)
}
}, environment
)
Disposer.dispose(disposable)
rawFiles.clear()
unitTestDescriptions.clear()
try {
writeFiles(
rawFiles.map {
try {
CodegenTestFiles.create(it.name, it.content, environment.project).psiFile
} catch (e: Throwable) {
throw RuntimeException("Error on processing ${it.name}:\n${it.content}", e)
}
}, environment, unitTestDescriptions
)
} finally {
rawFiles.clear()
unitTestDescriptions.clear()
Disposer.dispose(disposable)
}
}
private fun writeFiles(filesToCompile: List<KtFile>, environment: KotlinCoreEnvironment) {
private fun writeFiles(
filesToCompile: List<KtFile>,
environment: KotlinCoreEnvironment,
unitTestDescriptions: ArrayList<TestInfo>
) {
if (filesToCompile.isEmpty()) return
//3000 files per folder that would be used by flavor to avoid multidex usage,
// each folder would be jared by build.gradle script
writtenFilesCount += filesToCompile.size
val index = writtenFilesCount / 3000
val outputDir = File(pathManager.getOutputForCompiledFiles(index))
assertTrue("Add flavors for ktest$index", index < 2)
val flavorName = flavorConfig.getFlavorForNewFiles(filesToCompile.size)
val outputDir = File(pathManager.getOutputForCompiledFiles(flavorName))
println("Generating ${filesToCompile.size} files into ${outputDir.name}, configuration: '${environment.configuration}'...")
val outputFiles = GenerationUtils.compileFiles(filesToCompile, environment).run { destroy(); factory }
@@ -153,10 +215,10 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
outputDir.mkdirs()
}
Assert.assertTrue("Cannot create directory for compiled files", outputDir.exists())
val unitTestFileWriter = pendingUnitTestGenerators.getOrPut(index) {
val unitTestFileWriter = pendingUnitTestGenerators.getOrPut(flavorName) {
UnitTestFileWriter(
getFlavorUnitTestFilePath(index),
index,
getFlavorUnitTestFolder(flavorName),
flavorName,
generatedTestNames
)
}
@@ -164,6 +226,12 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
outputFiles.writeAllTo(outputDir)
}
private fun getFlavorUnitTestFolder(flavourName: String): String {
return pathManager.srcFolderInAndroidTmpFolder +
"/androidTest${flavourName.capitalize()}/java/" +
testClassPackage.replace(".", "/") + "/"
}
fun addTest(testFiles: List<TestClassInfo>, info: TestInfo) {
rawFiles.addAll(testFiles)
unitTestDescriptions.add(info)
@@ -180,9 +248,6 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
}
for (file in files) {
if (SpecialFiles.getExcludedFiles().contains(file.name)) {
continue
}
if (file.isDirectory) {
val listFiles = file.listFiles()
if (listFiles != null) {
@@ -195,7 +260,9 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
continue
}
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file)) {
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file) ||
InTextDirectivesUtils.isIgnoredTarget(TargetBackend.ANDROID, file)
) {
continue
}
@@ -211,23 +278,32 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
if (fullFileText.contains("@file:JvmPackageName(")) continue
// TODO: Support jvm assertions
if (fullFileText.contains("// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm")) continue
// TODO: support JVM 8 test with D8
if (fullFileText.contains("// JVM_TARGET")) continue
val targets = InTextDirectivesUtils.findLinesWithPrefixesRemoved(fullFileText, "// JVM_TARGET:")
.also { it.remove(JvmTarget.JVM_1_6.description) }
val isJvm8Target =
if (targets.isEmpty()) false
else if (targets.contains(JvmTarget.JVM_1_8.description) && targets.size == 1) true
else continue //TODO: support other targets on Android
// TODO: support SKIP_JDK6 on new platforms
if (fullFileText.contains("// SKIP_JDK6")) continue
if (hasBoxMethod(fullFileText)) {
val testFiles = createTestFiles(file, fullFileText)
val kind = extractConfigurationKind(testFiles)
val jdkKind = getJdkKind(testFiles)
val kind = KotlinBaseTest.extractConfigurationKind(testFiles)
val jdkKind = KotlinBaseTest.getTestJdkKind(testFiles)
val keyConfiguration = CompilerConfiguration()
updateConfigurationByDirectivesInTestFiles(testFiles, keyConfiguration)
KotlinBaseTest.updateConfigurationByDirectivesInTestFiles(testFiles, keyConfiguration)
val key = ConfigurationKey(kind, jdkKind, keyConfiguration.toString())
val compiler = if (isJvm8Target) {
if (kind.withReflection) JVM8REFLECT else JVM8
} else if (kind.withReflection) REFLECT else COMMON
val filesHolder = holders.getOrPut(key) {
FilesWriter(KotlinTestUtils.newConfiguration(kind, jdkKind, KotlinTestUtils.getAnnotationsJar()).apply {
FilesWriter(compiler, KotlinTestUtils.newConfiguration(kind, jdkKind, KotlinTestUtils.getAnnotationsJar()).apply {
println("Creating new configuration by $key")
updateConfigurationByDirectivesInTestFiles(testFiles, this)
KotlinBaseTest.updateConfigurationByDirectivesInTestFiles(testFiles, this)
})
}
@@ -237,19 +313,12 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
}
}
private fun createTestFiles(file: File, expectedText: String): List<TestFile> =
TestFiles.createTestFiles(
file.name,
expectedText,
object : TestFiles.TestFileFactoryNoModules<TestFile>() {
override fun create(fileName: String, text: String, directives: Map<String, String>): TestFile {
return TestFile(fileName, text)
}
}, false,
"kotlin.coroutines"
)
private fun createTestFiles(file: File, expectedText: String): List<KotlinBaseTest.TestFile> =
CodegenTestCase.createTestFilesFromFile(file, expectedText, "kotlin.coroutines", false, TargetBackend.JVM)
companion object {
const val GRADLE_VERSION = "5.6.4" // update GRADLE_SHA_256 on change
const val GRADLE_SHA_256 = "1f3067073041bc44554d0efe5d402a33bc3d3c93cc39ab684f308586d732a80d"
const val testClassPackage = "org.jetbrains.kotlin.android.tests"
const val testClassName = "CodegenTestCaseOnAndroid"
const val baseTestClassPackage = "org.jetbrains.kotlin.android.tests"
@@ -257,10 +326,11 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
const val generatorName = "CodegenTestsOnAndroidGenerator"
@JvmOverloads
@JvmStatic
@Throws(Throwable::class)
fun generate(pathManager: PathManager) {
CodegenTestsOnAndroidGenerator(pathManager).prepareAndroidModuleAndGenerateTests()
fun generate(pathManager: PathManager, skipSdkDirWriting: Boolean = false) {
CodegenTestsOnAndroidGenerator(pathManager).prepareAndroidModuleAndGenerateTests(skipSdkDirWriting)
}
private fun hasBoxMethod(text: String): Boolean {
@@ -269,7 +339,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
@Throws(IOException::class)
internal fun writeAndroidSkdToLocalProperties(pathManager: PathManager) {
val sdkRoot = File(pathManager.androidSdkRoot).invariantSeparatorsPath
val sdkRoot = KotlinTestUtils.getAndroidSdkSystemIndependentPath()
println("Writing android sdk to local.properties: $sdkRoot")
val file = File(pathManager.tmpFolder + "/local.properties")
FileWriter(file).use { fw -> fw.write("sdk.dir=$sdkRoot") }
@@ -281,7 +351,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
println("Created temporary folder for android tests: " + tmpFolder.absolutePath)
val rootFolder = File("")
val pathManager = PathManager(rootFolder.absolutePath, tmpFolder.absolutePath)
generate(pathManager)
generate(pathManager, true)
println("Android test project is generated into " + tmpFolder.absolutePath + " folder")
}
}
}

View File

@@ -1,90 +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.android.tests;
import java.util.HashSet;
import java.util.Set;
public class SpecialFiles {
private static final Set<String> excludedFiles = new HashSet<>();
static {
fillExcludedFiles();
}
public static Set<String> getExcludedFiles() {
return excludedFiles;
}
private static void fillExcludedFiles() {
// Reflection
excludedFiles.add("enclosing");
excludedFiles.add("kt10259.kt");
excludedFiles.add("simpleClassLiteral.kt");
//UnsatisfiedLinkError
excludedFiles.add("nativePropertyAccessors.kt");
excludedFiles.add("topLevel.kt");
//Test with no reflection at runtime
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("noReflect");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");
// "IOOBE: Invalid index 4, size is 4" for java.lang.reflect.ParameterizedType on Android
excludedFiles.add("innerGenericTypeArgument.kt");
// Cannot change package name
excludedFiles.add("kt6990.kt");
excludedFiles.add("typeParameters.kt");
excludedFiles.add("kt13133.kt");
// StackOverflow with StringBuilder (escape())
excludedFiles.add("kt684.kt");
// Wrong enclosing info or signature after package renaming
excludedFiles.add("enclosingInfo");
excludedFiles.add("signature");
// Some classes are not visible on android
excludedFiles.add("classpath.kt");
// Out of memory
excludedFiles.add("manyNumbers.kt");
// Native methods
excludedFiles.add("external");
// Additional nested class in 'Thread' class on Android
excludedFiles.add("nestedClasses.kt");
// KT-8120
excludedFiles.add("closureOfInnerLocalClass.kt");
excludedFiles.add("closureWithSelfInstantiation.kt");
excludedFiles.add("quotedClassName.kt");
//wrong function resolution after package renaming
excludedFiles.add("apiVersionAtLeast1.kt");
//special symbols in names
excludedFiles.add("nameWithWhitespace.kt");
}
private SpecialFiles() {
}
}

View File

@@ -15,7 +15,11 @@ import java.io.FileWriter
class TestInfo(val name: String, val fqName: FqName, val file: File)
class UnitTestFileWriter(private val fileName: String, private val index: Int, private val generatedTestNames: MutableSet<String>) {
class UnitTestFileWriter(
private val flavourFolder: String,
private val flavourName: String,
private val generatedTestNames: MutableSet<String>
) {
private val infos = arrayListOf<TestInfo>()
fun addTests(info: List<TestInfo>) {
@@ -23,7 +27,7 @@ class UnitTestFileWriter(private val fileName: String, private val index: Int, p
}
fun generate() {
FileWriter(File(fileName).also { it.parentFile.mkdirs() }).use { suite ->
FileWriter(File(flavourFolder, flavourName.capitalize() + ".java").also { it.parentFile.mkdirs() }).use { suite ->
val p = Printer(suite)
p.println(
"""package ${CodegenTestsOnAndroidGenerator.testClassPackage};
@@ -31,7 +35,7 @@ class UnitTestFileWriter(private val fileName: String, private val index: Int, p
|import ${CodegenTestsOnAndroidGenerator.baseTestClassPackage}.${CodegenTestsOnAndroidGenerator.baseTestClassName};
|
|/* This class is generated by ${CodegenTestsOnAndroidGenerator.generatorName}. DO NOT MODIFY MANUALLY */
|public class ${CodegenTestsOnAndroidGenerator.testClassName}$index extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|public class ${flavourName.capitalize()} extends ${CodegenTestsOnAndroidGenerator.baseTestClassName} {
|
""".trimMargin()
)

View File

@@ -8,7 +8,6 @@ dependencies {
compile(project(":core:descriptors"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:ir.tree"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
}

View File

@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.backend.common
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.backend.common.bridges.findInterfaceImplementation
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.DiagnosticSink
import org.jetbrains.kotlin.diagnostics.Errors
@@ -24,6 +23,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.multiplatform.ExpectedActualResolver
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.util.getExceptionMessage
import org.jetbrains.kotlin.util.getNonPrivateTraitMembersForDelegation
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments
@@ -55,14 +55,8 @@ object CodegenUtil {
@JvmOverloads
fun getNonPrivateTraitMethods(descriptor: ClassDescriptor, copy: Boolean = true): Map<FunctionDescriptor, FunctionDescriptor> {
val result = linkedMapOf<FunctionDescriptor, FunctionDescriptor>()
for (declaration in DescriptorUtils.getAllDescriptors(descriptor.defaultType.memberScope)) {
if (declaration !is CallableMemberDescriptor) continue
val traitMember = findInterfaceImplementation(declaration)
if (traitMember == null ||
Visibilities.isPrivate(traitMember.visibility) ||
traitMember.visibility == Visibilities.INVISIBLE_FAKE) continue
for ((declaration, traitMember) in getNonPrivateTraitMembersForDelegation(descriptor)) {
assert(traitMember.modality !== Modality.ABSTRACT) { "Cannot delegate to abstract trait method: $declaration" }
// inheritedMember can be abstract here. In order for FunctionCodegen to generate the method body, we're creating a copy here
@@ -93,20 +87,18 @@ object CodegenUtil {
private fun mapMembers(
inherited: CallableMemberDescriptor,
traitMember: CallableMemberDescriptor
): LinkedHashMap<FunctionDescriptor, FunctionDescriptor> {
val result = linkedMapOf<FunctionDescriptor, FunctionDescriptor>()
if (traitMember is SimpleFunctionDescriptor) {
result[traitMember] = inherited as FunctionDescriptor
} else if (traitMember is PropertyDescriptor) {
): Map<FunctionDescriptor, FunctionDescriptor> = when (traitMember) {
is SimpleFunctionDescriptor -> mapOf(traitMember to inherited as FunctionDescriptor)
is PropertyDescriptor -> linkedMapOf<FunctionDescriptor, FunctionDescriptor>().also { result ->
for (traitAccessor in traitMember.accessors) {
for (inheritedAccessor in (inherited as PropertyDescriptor).accessors) {
if (inheritedAccessor::class.java == traitAccessor::class.java) { // same accessor kind
result.put(traitAccessor, inheritedAccessor)
if ((inheritedAccessor is PropertyGetterDescriptor) == (traitAccessor is PropertyGetterDescriptor)) {
result[traitAccessor] = inheritedAccessor
}
}
}
}
return result
else -> error("Unexpected member: $inherited")
}
@JvmStatic

View File

@@ -16,17 +16,11 @@
package org.jetbrains.kotlin.backend.common
import org.jetbrains.kotlin.backend.common.CodegenUtil.getMemberToGenerate
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.BindingContextUtils
/**
* A platform-independent logic for generating data class synthetic methods.

View File

@@ -18,15 +18,16 @@ package org.jetbrains.kotlin.backend.common.bridges
import org.jetbrains.kotlin.utils.DFS
import java.util.*
import kotlin.collections.LinkedHashMap
interface FunctionHandle {
val isDeclaration: Boolean
val isAbstract: Boolean
/** On finding concrete super declaration we should distinguish non-abstract java8/js default methods from
* class ones (see [findConcreteSuperDeclaration] method in bridges.kt).
* Note that interface methods with body compiled to jvm 8 target are assumed to be non-abstract in bridges method calculation
* (more details in [DescriptorBasedFunctionHandle.isBodyOwner] comment).*/
* class ones (see [findConcreteSuperDeclaration] method in bridges.kt).
* Note that interface methods with body compiled to jvm 8 target are assumed to be non-abstract in bridges method calculation
* (more details in [DescriptorBasedFunctionHandle.isBodyOwner] comment).*/
val mayBeUsedAsSuperImplementation: Boolean
fun getOverridden(): Iterable<FunctionHandle>
@@ -34,18 +35,19 @@ interface FunctionHandle {
val mightBeIncorrectCode: Boolean get() = false
}
data class Bridge<out Signature>(
val from: Signature,
val to: Signature
data class Bridge<out Signature, out Function : FunctionHandle>(
val from: Signature,
val to: Signature,
val originalFunctions: Set<Function>
) {
override fun toString() = "$from -> $to"
}
fun <Function : FunctionHandle, Signature> generateBridges(
function: Function,
signature: (Function) -> Signature
): Set<Bridge<Signature>> {
function: Function,
signature: (Function) -> Signature
): Set<Bridge<Signature, Function>> {
// If it's an abstract function, no bridges are needed: when an implementation will appear in some concrete subclass, all necessary
// bridges will be generated there
if (function.isAbstract) return setOf()
@@ -58,7 +60,7 @@ fun <Function : FunctionHandle, Signature> generateBridges(
val implementation = findConcreteSuperDeclaration(function) ?: return setOf()
val bridgesToGenerate = findAllReachableDeclarations(function).mapTo(LinkedHashSet<Signature>(), signature)
val bridgesToGenerate = findAllReachableDeclarations(function).groupByTo(LinkedHashMap(), signature)
if (fake) {
// If it's a concrete fake override, some of the bridges may be inherited from the super-classes. Specifically, bridges for all
@@ -67,14 +69,20 @@ fun <Function : FunctionHandle, Signature> generateBridges(
@Suppress("UNCHECKED_CAST")
for (overridden in function.getOverridden() as Iterable<Function>) {
if (!overridden.isAbstract) {
bridgesToGenerate.removeAll(findAllReachableDeclarations(overridden).map(signature))
for (reachable in findAllReachableDeclarations(overridden)) {
bridgesToGenerate.remove(signature(reachable))
}
}
}
}
val method = signature(implementation)
bridgesToGenerate.remove(method)
return bridgesToGenerate.map { Bridge(it, method) }.toSet()
return bridgesToGenerate.entries
.map { (overriddenSignature, overriddenFunctions) ->
Bridge(overriddenSignature, method, overriddenFunctions.toSet())
}
.toSet()
}
fun <Function : FunctionHandle> findAllReachableDeclarations(function: Function): MutableSet<Function> {
@@ -95,7 +103,7 @@ fun <Function : FunctionHandle> findAllReachableDeclarations(function: Function)
* The implementation is guaranteed to exist because if it wouldn't, the given function would've been abstract
*/
fun <Function : FunctionHandle> findConcreteSuperDeclaration(function: Function): Function? {
require(!function.isAbstract, { "Only concrete functions have implementations: $function" })
require(!function.isAbstract) { "Only concrete functions have implementations: $function" }
if (function.isDeclaration) return function

View File

@@ -24,11 +24,13 @@ import org.jetbrains.kotlin.resolve.OverridingUtil
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.isOrOverridesSynthesized
import org.jetbrains.kotlin.resolve.descriptorUtil.isTypeRefinementEnabled
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.util.findImplementationFromInterface
import org.jetbrains.kotlin.util.findInterfaceImplementation
fun <Signature> generateBridgesForFunctionDescriptor(
descriptor: FunctionDescriptor,
signature: (FunctionDescriptor) -> Signature
): Set<Bridge<Signature>> {
): Set<Bridge<Signature, DescriptorBasedFunctionHandle>> {
return generateBridges(DescriptorBasedFunctionHandle(descriptor), { signature(it.descriptor) })
}
@@ -81,55 +83,4 @@ open class DescriptorBasedFunctionHandle(val descriptor: FunctionDescriptor) : F
override fun toString(): String {
return descriptor.toString()
}
}
/**
* Given a fake override in a class, returns an overridden declaration with implementation in trait, such that a method delegating to that
* trait implementation should be generated into the class containing the fake override; or null if the given function is not a fake
* override of any trait implementation or such method was already generated into the superclass or is a method from Any.
*/
fun findInterfaceImplementation(descriptor: CallableMemberDescriptor): CallableMemberDescriptor? {
if (descriptor.kind.isReal) return null
if (isOrOverridesSynthesized(descriptor)) return null
val implementation = findImplementationFromInterface(descriptor) ?: return null
val immediateConcreteSuper = firstSuperMethodFromKotlin(descriptor, implementation) ?: return null
if (!DescriptorUtils.isInterface(immediateConcreteSuper.containingDeclaration)) {
// If this implementation is already generated into the superclass, we need not generate it again, it'll be inherited
return null
}
return immediateConcreteSuper
}
/**
* Given a fake override, returns an overridden non-abstract function from an interface which is the actual implementation of this function
* that should be called when the given fake override is called.
*/
fun findImplementationFromInterface(descriptor: CallableMemberDescriptor): CallableMemberDescriptor? {
val overridden = OverridingUtil.getOverriddenDeclarations(descriptor)
val filtered = OverridingUtil.filterOutOverridden(overridden)
val result = filtered.firstOrNull { it.modality != Modality.ABSTRACT } ?: return null
if (DescriptorUtils.isClassOrEnumClass(result.containingDeclaration)) return null
return result
}
/**
* Given a fake override and its implementation (non-abstract declaration) somewhere in supertypes,
* returns the first immediate super function of the given fake override which overrides that implementation.
* The returned function should be called from TImpl-bridges generated for the given fake override.
*/
fun firstSuperMethodFromKotlin(
descriptor: CallableMemberDescriptor,
implementation: CallableMemberDescriptor
): CallableMemberDescriptor? {
return descriptor.overriddenDescriptors.firstOrNull { overridden ->
overridden.modality != Modality.ABSTRACT &&
(overridden == implementation || OverridingUtil.overrides(overridden, implementation, overridden.module.isTypeRefinementEnabled()))
}
}
}

View File

@@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.codegen.inline.FileMapping;
import org.jetbrains.kotlin.codegen.inline.SMAPBuilder;
import org.jetbrains.kotlin.codegen.inline.SourceMapper;
import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
import org.jetbrains.org.objectweb.asm.*;
@@ -38,8 +39,6 @@ public abstract class AbstractClassBuilder implements ClassBuilder {
private final JvmSerializationBindings serializationBindings = new JvmSerializationBindings();
private final List<FileMapping> fileMappings = new ArrayList<>();
private String sourceName;
private String debugInfo;
@@ -106,15 +105,7 @@ public abstract class AbstractClassBuilder implements ClassBuilder {
@Override
public void done() {
if (!fileMappings.isEmpty() && GENERATE_SMAP) {
FileMapping origin = fileMappings.get(0);
assert sourceName == null || origin.getName().equals(sourceName) : "Error " + origin.getName() + " != " + sourceName;
getVisitor().visitSource(origin.getName(), new SMAPBuilder(origin.getName(), origin.getPath(), fileMappings).build());
}
else {
getVisitor().visitSource(sourceName, debugInfo);
}
getVisitor().visitSource(sourceName, debugInfo);
getVisitor().visitEnd();
}
@@ -134,10 +125,21 @@ public abstract class AbstractClassBuilder implements ClassBuilder {
@Override
public void visitSource(@NotNull String name, @Nullable String debug) {
assert sourceName == null || sourceName.equals(name) : "inconsistent file name: " + sourceName + " vs " + name;
sourceName = name;
debugInfo = debug;
}
@Override
public void visitSMAP(@NotNull SourceMapper smap, boolean backwardsCompatibleSyntax) {
if (!GENERATE_SMAP) return;
List<FileMapping> fileMappings = smap.getResultMappings();
if (fileMappings.isEmpty()) return;
visitSource(fileMappings.get(0).getName(), SMAPBuilder.INSTANCE.build(fileMappings, backwardsCompatibleSyntax));
}
@Override
public void visitOuterClass(@NotNull String owner, @Nullable String name, @Nullable String desc) {
getVisitor().visitOuterClass(owner, name, desc);
@@ -154,9 +156,4 @@ public abstract class AbstractClassBuilder implements ClassBuilder {
assert thisName != null : "This name isn't set";
return thisName;
}
@Override
public void addSMAP(FileMapping mapping) {
fileMappings.add(mapping);
}
}

View File

@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.descriptors.annotations.*;
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor;
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
import org.jetbrains.kotlin.load.java.JvmAnnotationNames;
import org.jetbrains.kotlin.name.ClassId;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.AnnotationChecker;
@@ -40,7 +41,6 @@ import org.jetbrains.kotlin.types.FlexibleType;
import org.jetbrains.kotlin.types.FlexibleTypesKt;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.TypeUtils;
import org.jetbrains.kotlin.types.checker.SimpleClassicTypeSystemContext;
import org.jetbrains.org.objectweb.asm.*;
import java.lang.annotation.*;
@@ -90,12 +90,18 @@ public abstract class AnnotationCodegen {
private final KotlinTypeMapper typeMapper;
private final ModuleDescriptor module;
private final GenerationState state;
private final boolean skipNullabilityAnnotations;
private AnnotationCodegen(@NotNull InnerClassConsumer innerClassConsumer, @NotNull GenerationState state) {
this(innerClassConsumer, state, false);
}
private AnnotationCodegen(@NotNull InnerClassConsumer innerClassConsumer, @NotNull GenerationState state, boolean skipNullabilityAnnotations) {
this.innerClassConsumer = innerClassConsumer;
this.typeMapper = state.getTypeMapper();
this.module = state.getModule();
this.state = state;
this.skipNullabilityAnnotations = skipNullabilityAnnotations;
}
/**
@@ -105,6 +111,16 @@ public abstract class AnnotationCodegen {
@Nullable Annotated annotated,
@Nullable Type returnType,
@Nullable KotlinType typeForTypeAnnotations
) {
genAnnotations(annotated, returnType, typeForTypeAnnotations, null, Collections.emptyList());
}
public void genAnnotations(
@Nullable Annotated annotated,
@Nullable Type returnType,
@Nullable KotlinType typeForTypeAnnotations,
@Nullable DeclarationDescriptorWithVisibility parameterContainer,
@NotNull List<Class<?>> additionalAnnotations
) {
if (annotated == null) return;
@@ -139,22 +155,28 @@ public abstract class AnnotationCodegen {
}
}
generateAdditionalAnnotations(annotated, returnType, annotationDescriptorsAlreadyPresent);
for (Class<?> annotation : additionalAnnotations) {
String descriptor = generateAnnotationIfNotPresent(annotationDescriptorsAlreadyPresent, annotation);
annotationDescriptorsAlreadyPresent.add(descriptor);
}
generateAdditionalAnnotations(annotated, returnType, annotationDescriptorsAlreadyPresent, parameterContainer);
generateTypeAnnotations(annotated, typeForTypeAnnotations);
}
private void generateAdditionalAnnotations(
@NotNull Annotated annotated,
@Nullable Type returnType,
@NotNull Set<String> annotationDescriptorsAlreadyPresent
@NotNull Set<String> annotationDescriptorsAlreadyPresent,
@Nullable DeclarationDescriptorWithVisibility parameterContainer
) {
if (annotated instanceof CallableDescriptor) {
generateAdditionalCallableAnnotations((CallableDescriptor) annotated, returnType, annotationDescriptorsAlreadyPresent);
generateAdditionalCallableAnnotations((CallableDescriptor) annotated, returnType, annotationDescriptorsAlreadyPresent, parameterContainer);
}
else if (annotated instanceof FieldDescriptor) {
generateAdditionalCallableAnnotations(
((FieldDescriptor) annotated).getCorrespondingProperty(), returnType, annotationDescriptorsAlreadyPresent
);
((FieldDescriptor) annotated).getCorrespondingProperty(), returnType, annotationDescriptorsAlreadyPresent,
parameterContainer);
}
else if (annotated instanceof ClassDescriptor) {
generateAdditionalClassAnnotations(annotationDescriptorsAlreadyPresent, (ClassDescriptor) annotated);
@@ -164,11 +186,15 @@ public abstract class AnnotationCodegen {
private void generateAdditionalCallableAnnotations(
@NotNull CallableDescriptor descriptor,
@Nullable Type returnType,
@NotNull Set<String> annotationDescriptorsAlreadyPresent
@NotNull Set<String> annotationDescriptorsAlreadyPresent,
@Nullable DeclarationDescriptorWithVisibility parameterContainer
) {
// No need to annotate privates, synthetic accessors and their parameters
if (isInvisibleFromTheOutside(descriptor)) return;
if (descriptor instanceof ValueParameterDescriptor && isInvisibleFromTheOutside(descriptor.getContainingDeclaration())) return;
if (descriptor instanceof ParameterDescriptor &&
isInvisibleFromTheOutside(parameterContainer != null ? parameterContainer : descriptor.getContainingDeclaration())) {
return;
}
// No need to annotate annotation methods since they're always non-null
if (descriptor instanceof PropertyGetterDescriptor &&
@@ -176,7 +202,7 @@ public abstract class AnnotationCodegen {
return;
}
if (returnType != null && !AsmUtil.isPrimitive(returnType)) {
if (returnType != null && !AsmUtil.isPrimitive(returnType) && !skipNullabilityAnnotations) {
generateNullabilityAnnotation(descriptor.getReturnType(), annotationDescriptorsAlreadyPresent);
}
}
@@ -254,12 +280,11 @@ public abstract class AnnotationCodegen {
jvm8.put(KotlinTarget.TYPE, ElementType.TYPE_USE);
annotationTargetMaps.put(JvmTarget.JVM_1_6, jvm6);
annotationTargetMaps.put(JvmTarget.JVM_1_8, jvm8);
annotationTargetMaps.put(JvmTarget.JVM_9, jvm8);
annotationTargetMaps.put(JvmTarget.JVM_10, jvm8);
annotationTargetMaps.put(JvmTarget.JVM_11, jvm8);
annotationTargetMaps.put(JvmTarget.JVM_12, jvm8);
annotationTargetMaps.put(JvmTarget.JVM_13, jvm8);
for (JvmTarget target : JvmTarget.values()) {
if (target != JvmTarget.JVM_1_6) {
annotationTargetMaps.put(target, jvm8);
}
}
}
private void generateTargetAnnotation(
@@ -313,11 +338,13 @@ public abstract class AnnotationCodegen {
visitor.visitEnd();
}
private void generateAnnotationIfNotPresent(Set<String> annotationDescriptorsAlreadyPresent, Class<?> annotationClass) {
@NotNull
private String generateAnnotationIfNotPresent(Set<String> annotationDescriptorsAlreadyPresent, Class<?> annotationClass) {
String descriptor = Type.getType(annotationClass).getDescriptor();
if (!annotationDescriptorsAlreadyPresent.contains(descriptor)) {
visitAnnotation(descriptor, false).visitEnd();
}
return descriptor;
}
private static boolean isBareTypeParameterWithNullableUpperBound(@NotNull KotlinType type) {
@@ -434,8 +461,13 @@ public abstract class AnnotationCodegen {
@Override
public Void visitEnumValue(EnumValue value, Void data) {
String enumClassInternalName = AsmUtil.asmTypeByClassId(value.getEnumClassId()).getDescriptor();
ClassId enumClassId = value.getEnumClassId();
String enumClassInternalName = AsmUtil.asmTypeByClassId(enumClassId).getDescriptor();
String enumEntryName = value.getEnumEntryName().asString();
ClassDescriptor descriptor = FindClassInModuleKt.findClassAcrossModuleDependencies(state.getModule(), enumClassId);
if (descriptor != null) {
innerClassConsumer.addInnerClassInfoFromAnnotation(descriptor);
}
annotationVisitor.visitEnum(name, enumClassInternalName, enumEntryName);
return null;
}
@@ -452,8 +484,9 @@ public abstract class AnnotationCodegen {
@Override
public Void visitAnnotationValue(AnnotationValue value, Void data) {
String internalAnnName = typeMapper.mapType(value.getValue().getType()).getDescriptor();
AnnotationVisitor visitor = annotationVisitor.visitAnnotation(name, internalAnnName);
KotlinType classType = value.getValue().getType();
innerClassConsumer.addInnerClassInfoFromAnnotation(DescriptorUtils.getClassDescriptorForType(classType));
AnnotationVisitor visitor = annotationVisitor.visitAnnotation(name, typeMapper.mapType(classType).getDescriptor());
genAnnotationArguments(value.getValue(), visitor);
visitor.visitEnd();
return null;
@@ -461,7 +494,9 @@ public abstract class AnnotationCodegen {
@Override
public Void visitKClassValue(KClassValue value, Void data) {
annotationVisitor.visit(name, typeMapper.mapType(value.getArgumentType(module)));
KotlinType classType = value.getArgumentType(module);
innerClassConsumer.addInnerClassInfoFromAnnotation(DescriptorUtils.getClassDescriptorForType(classType));
annotationVisitor.visit(name, typeMapper.mapType(classType));
return null;
}
@@ -593,7 +628,16 @@ public abstract class AnnotationCodegen {
@NotNull InnerClassConsumer innerClassConsumer,
@NotNull GenerationState state
) {
return new AnnotationCodegen(innerClassConsumer, state) {
return forMethod(mv, innerClassConsumer, state, false);
}
public static AnnotationCodegen forMethod(
@NotNull MethodVisitor mv,
@NotNull InnerClassConsumer innerClassConsumer,
@NotNull GenerationState state,
boolean skipNullabilityAnnotations
) {
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
@NotNull
@Override
AnnotationVisitor visitAnnotation(String descr, boolean visible) {
@@ -613,7 +657,16 @@ public abstract class AnnotationCodegen {
@NotNull InnerClassConsumer innerClassConsumer,
@NotNull GenerationState state
) {
return new AnnotationCodegen(innerClassConsumer, state) {
return forField(fv, innerClassConsumer, state, false);
}
public static AnnotationCodegen forField(
@NotNull FieldVisitor fv,
@NotNull InnerClassConsumer innerClassConsumer,
@NotNull GenerationState state,
boolean skipNullabilityAnnotations
) {
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
@NotNull
@Override
AnnotationVisitor visitAnnotation(String descr, boolean visible) {
@@ -632,9 +685,10 @@ public abstract class AnnotationCodegen {
int parameter,
@NotNull MethodVisitor mv,
@NotNull InnerClassConsumer innerClassConsumer,
@NotNull GenerationState state
@NotNull GenerationState state,
boolean skipNullabilityAnnotations
) {
return new AnnotationCodegen(innerClassConsumer, state) {
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
@NotNull
@Override
AnnotationVisitor visitAnnotation(String descr, boolean visible) {

View File

@@ -17,11 +17,13 @@
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor
import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument
import org.jetbrains.kotlin.resolve.calls.model.ExpressionValueArgument
import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument
import org.jetbrains.kotlin.resolve.calls.model.VarargValueArgument
import org.jetbrains.kotlin.resolve.calls.components.hasDefaultValue
import org.jetbrains.kotlin.resolve.calls.model.*
import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeUniqueAsSequence
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.mapToIndex
@@ -35,10 +37,10 @@ abstract class ArgumentGenerator {
* @see kotlin.reflect.jvm.internal.KCallableImpl.callBy
*/
open fun generate(
valueArgumentsByIndex: List<ResolvedValueArgument>,
actualArgs: List<ResolvedValueArgument>,
// may be null for a constructor of an object literal
calleeDescriptor: CallableDescriptor?
valueArgumentsByIndex: List<ResolvedValueArgument>,
actualArgs: List<ResolvedValueArgument>,
// may be null for a constructor of an object literal
calleeDescriptor: CallableDescriptor?
): DefaultCallArgs {
assert(valueArgumentsByIndex.size == actualArgs.size) {
"Value arguments collection should have same size, but ${valueArgumentsByIndex.size} != ${actualArgs.size}"
@@ -50,9 +52,9 @@ abstract class ArgumentGenerator {
ArgumentAndDeclIndex(it, arg2Index[it]!!)
}.toMutableList()
valueArgumentsByIndex.withIndex().forEach {
if (it.value is DefaultValueArgument) {
actualArgsWithDeclIndex.add(it.index, ArgumentAndDeclIndex(it.value, it.index))
for ((index, value) in valueArgumentsByIndex.withIndex()) {
if (value is DefaultValueArgument) {
actualArgsWithDeclIndex.add(index, ArgumentAndDeclIndex(value, index))
}
}
@@ -70,8 +72,7 @@ abstract class ArgumentGenerator {
is DefaultValueArgument -> {
if (calleeDescriptor?.defaultValueFromJava(declIndex) == true) {
generateDefaultJava(declIndex, argument)
}
else {
} else {
defaultArgs.mark(declIndex)
generateDefault(declIndex, argument)
}
@@ -116,11 +117,42 @@ abstract class ArgumentGenerator {
}
private fun CallableDescriptor.defaultValueFromJava(index: Int): Boolean = DFS.ifAny(
listOf(this),
{ current -> current.original.overriddenDescriptors.map { it.original } },
{ descriptor ->
descriptor.original.overriddenDescriptors.isEmpty() &&
descriptor is JavaCallableMemberDescriptor &&
descriptor.valueParameters[index].declaresDefaultValue()
}
listOf(this),
{ current -> current.original.overriddenDescriptors.map { it.original } },
{ descriptor ->
descriptor.original.overriddenDescriptors.isEmpty() &&
descriptor is JavaCallableMemberDescriptor &&
descriptor.valueParameters[index].declaresDefaultValue()
}
)
fun shouldInvokeDefaultArgumentsStub(resolvedCall: ResolvedCall<*>): Boolean {
val descriptor = resolvedCall.resultingDescriptor
val valueArgumentsByIndex = resolvedCall.valueArgumentsByIndex ?: return false
for (index in valueArgumentsByIndex.indices) {
val resolvedValueArgument = valueArgumentsByIndex[index]
if (resolvedValueArgument is DefaultValueArgument && !descriptor.defaultValueFromJava(index)) {
return true
}
}
return false
}
fun getFunctionWithDefaultArguments(functionDescriptor: FunctionDescriptor): FunctionDescriptor {
if (functionDescriptor.containingDeclaration !is ClassDescriptor) return functionDescriptor
if (functionDescriptor.overriddenDescriptors.isEmpty()) return functionDescriptor
// We are calling a function with some arguments mapped as defaults.
// Multiple override-equivalent functions from different supertypes with (potentially different) default values
// can't be overridden by any function in a subtype.
// Also, a function overriding some other function can't introduce default parameter values.
// Thus, among all overridden functions should be one (and only one) function
// that doesn't override anything and has parameters with default values.
return functionDescriptor.overriddenTreeUniqueAsSequence(true)
.firstOrNull { function ->
function.kind == CallableMemberDescriptor.Kind.DECLARATION &&
function.overriddenDescriptors.isEmpty() &&
function.valueParameters.any { valueParameter -> valueParameter.hasDefaultValue() }
}
?: functionDescriptor
}

View File

@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.codegen.intrinsics.HashCode;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.config.ApiVersion;
import org.jetbrains.kotlin.config.JvmTarget;
import org.jetbrains.kotlin.config.LanguageFeature;
import org.jetbrains.kotlin.config.LanguageVersionSettings;
import org.jetbrains.kotlin.config.*;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
import org.jetbrains.kotlin.lexer.KtTokens;
@@ -42,10 +39,10 @@ import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.InlineClassDescriptorResolver;
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker;
import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver;
import org.jetbrains.kotlin.resolve.inline.InlineUtil;
import org.jetbrains.kotlin.resolve.jvm.*;
import org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor;
@@ -69,7 +66,6 @@ import static org.jetbrains.kotlin.resolve.DescriptorUtils.*;
import static org.jetbrains.kotlin.resolve.inline.InlineOnlyKt.isInlineOnlyPrivateInBytecode;
import static org.jetbrains.kotlin.resolve.inline.InlineOnlyKt.isInlineWithReified;
import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*;
import static org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt.hasJvmDefaultAnnotation;
import static org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt.hasJvmSyntheticAnnotation;
import static org.jetbrains.kotlin.types.TypeUtils.isNullableType;
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
@@ -309,9 +305,10 @@ public class AsmUtil {
return new Method(name, Type.getMethodDescriptor(returnType, parameterTypes));
}
public static boolean isAbstractMethod(FunctionDescriptor functionDescriptor, OwnerKind kind) {
public static boolean isAbstractMethod(FunctionDescriptor functionDescriptor, OwnerKind kind, JvmDefaultMode jvmDefaultMode) {
return (functionDescriptor.getModality() == Modality.ABSTRACT ||
(isJvmInterface(functionDescriptor.getContainingDeclaration()) && !hasJvmDefaultAnnotation(functionDescriptor)))
(isJvmInterface(functionDescriptor.getContainingDeclaration()) && !JvmAnnotationUtilKt
.isCompiledToJvmDefault(functionDescriptor, jvmDefaultMode)))
&& !isStaticMethod(kind, functionDescriptor);
}
@@ -326,10 +323,15 @@ public class AsmUtil {
}
public static int getMethodAsmFlags(FunctionDescriptor functionDescriptor, OwnerKind kind, GenerationState state) {
return getMethodAsmFlags(functionDescriptor, kind, state.getDeprecationProvider());
return getMethodAsmFlags(functionDescriptor, kind, state.getDeprecationProvider(), state.getJvmDefaultMode());
}
public static int getMethodAsmFlags(FunctionDescriptor functionDescriptor, OwnerKind kind, DeprecationResolver deprecationResolver) {
public static int getMethodAsmFlags(
FunctionDescriptor functionDescriptor,
OwnerKind kind,
DeprecationResolver deprecationResolver,
JvmDefaultMode jvmDefaultMode
) {
int flags = getCommonCallableFlags(functionDescriptor, kind, deprecationResolver);
for (AnnotationCodegen.JvmFlagAnnotation flagAnnotation : AnnotationCodegen.METHOD_FLAGS) {
@@ -357,7 +359,7 @@ public class AsmUtil {
flags |= ACC_STATIC;
}
if (isAbstractMethod(functionDescriptor, kind)) {
if (isAbstractMethod(functionDescriptor, kind, jvmDefaultMode)) {
flags |= ACC_ABSTRACT;
}
@@ -430,9 +432,6 @@ public class AsmUtil {
if (descriptor instanceof SyntheticClassDescriptorForLambda) {
return getVisibilityAccessFlagForAnonymous(descriptor);
}
if (ExpectedActualDeclarationChecker.isOptionalAnnotationClass(descriptor)) {
return NO_FLAG_PACKAGE_PRIVATE;
}
if (descriptor.getKind() == ClassKind.ENUM_ENTRY) {
return NO_FLAG_PACKAGE_PRIVATE;
}
@@ -1023,9 +1022,7 @@ public class AsmUtil {
}
value.put(asmType, v);
v.visitLdcInsn(name);
String methodName = state.getLanguageVersionSettings().getApiVersion().compareTo(ApiVersion.KOTLIN_1_4) >= 0
? "checkNotNullParameter"
: "checkParameterIsNotNull";
String methodName = state.getUnifiedNullChecks() ? "checkNotNullParameter" : "checkParameterIsNotNull";
v.invokestatic(IntrinsicMethods.INTRINSICS_CLASS_NAME, methodName, "(Ljava/lang/Object;Ljava/lang/String;)V", false);
}
}
@@ -1048,9 +1045,7 @@ public class AsmUtil {
if (innerType.getSort() == Type.OBJECT || innerType.getSort() == Type.ARRAY) {
v.dup();
v.visitLdcInsn(runtimeAssertionInfo.getMessage());
String methodName = state.getLanguageVersionSettings().getApiVersion().compareTo(ApiVersion.KOTLIN_1_4) >= 0
? "checkNotNullExpressionValue"
: "checkExpressionValueIsNotNull";
String methodName = state.getUnifiedNullChecks() ? "checkNotNullExpressionValue" : "checkExpressionValueIsNotNull";
v.invokestatic(IntrinsicMethods.INTRINSICS_CLASS_NAME, methodName, "(Ljava/lang/Object;Ljava/lang/String;)V", false);
}
StackValue.coerce(innerType, innerKotlinType, type, kotlinType, v);
@@ -1081,27 +1076,23 @@ public class AsmUtil {
}
public static void pushDefaultValueOnStack(@NotNull Type type, @NotNull InstructionAdapter v) {
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
v.aconst(null);
}
else {
pushDefaultPrimitiveValueOnStack(type, v);
}
v.visitInsn(defaultValueOpcode(type));
}
public static void pushDefaultPrimitiveValueOnStack(@NotNull Type type, @NotNull InstructionAdapter v) {
public static int defaultValueOpcode(@NotNull Type type) {
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
return ACONST_NULL;
}
if (type.getSort() == Type.FLOAT) {
v.fconst(0);
return FCONST_0;
}
else if (type.getSort() == Type.DOUBLE) {
v.dconst(0);
if (type.getSort() == Type.DOUBLE) {
return DCONST_0;
}
else if (type.getSort() == Type.LONG) {
v.lconst(0);
}
else {
v.iconst(0);
if (type.getSort() == Type.LONG) {
return LCONST_0;
}
return ICONST_0;
}
public static boolean isInstancePropertyWithStaticBackingField(@NotNull PropertyDescriptor propertyDescriptor) {

View File

@@ -6,6 +6,8 @@
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.codegen.coroutines.createCustomCopy
import org.jetbrains.kotlin.codegen.optimization.common.InsnSequence
import org.jetbrains.kotlin.codegen.optimization.common.findPreviousOrNull
import org.jetbrains.kotlin.config.JVMAssertionsMode
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.isTopLevelInPackage
@@ -19,12 +21,15 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.jetbrains.org.objectweb.asm.Label
import org.jetbrains.org.objectweb.asm.MethodVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode
import org.jetbrains.org.objectweb.asm.tree.LdcInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodNode
const val ASSERTIONS_DISABLED_FIELD_NAME = "\$assertionsDisabled"
@@ -130,7 +135,7 @@ private fun inlineAlwaysInlineAssert(resolvedCall: ResolvedCall<*>, codegen: Exp
)
}
fun generateAssertionsDisabledFieldInitialization(classBuilder: ClassBuilder, clInitBuilder: MethodVisitor) {
fun generateAssertionsDisabledFieldInitialization(classBuilder: ClassBuilder, clInitBuilder: MethodVisitor, className: String) {
classBuilder.newField(
JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_SYNTHETIC, ASSERTIONS_DISABLED_FIELD_NAME,
"Z", null, null
@@ -139,7 +144,7 @@ fun generateAssertionsDisabledFieldInitialization(classBuilder: ClassBuilder, cl
val elseLabel = Label()
with(InstructionAdapter(clInitBuilder)) {
mark(Label())
aconst(Type.getObjectType(classBuilder.thisName))
aconst(Type.getObjectType(className))
invokevirtual("java/lang/Class", "desiredAssertionStatus", "()Z", false)
ifne(thenLabel)
iconst(1)
@@ -153,6 +158,16 @@ fun generateAssertionsDisabledFieldInitialization(classBuilder: ClassBuilder, cl
}
}
fun rewriteAssertionsDisabledFieldInitialization(methodNode: MethodNode, className: String) {
InsnSequence(methodNode.instructions).firstOrNull {
it is FieldInsnNode && it.opcode == Opcodes.PUTSTATIC && it.name == ASSERTIONS_DISABLED_FIELD_NAME
}?.findPreviousOrNull {
it is MethodInsnNode && it.opcode == Opcodes.INVOKEVIRTUAL
&& it.owner == "java/lang/Class" && it.name == "desiredAssertionStatus" && it.desc == "()Z"
}?.previous?.safeAs<LdcInsnNode>()?.cst =
Type.getObjectType(className)
}
private fun <D : FunctionDescriptor> ResolvedCall<D>.replaceAssertWithAssertInner(): ResolvedCall<D> {
val newCandidateDescriptor = resultingDescriptor.createCustomCopy {
setName(Name.identifier(ALWAYS_ENABLED_ASSERT_FUNCTION_NAME))

View File

@@ -47,7 +47,7 @@ interface BaseExpressionCodegen {
functionReferenceReceiver: StackValue?
)
fun markLineNumberAfterInlineIfNeeded()
fun markLineNumberAfterInlineIfNeeded(registerLineNumberAfterwards: Boolean)
fun consumeReifiedOperationMarker(typeParameter: TypeParameterMarker)

View File

@@ -240,8 +240,9 @@ class ObjectCompare(
companion object {
fun getObjectCompareOpcode(opToken: IElementType): Int = when (opToken) {
KtTokens.EQEQEQ -> IF_ACMPNE
KtTokens.EXCLEQEQEQ -> IF_ACMPEQ
// "==" and "!=" are here because enum values are compared using reference equality.
KtTokens.EQEQEQ, KtTokens.EQEQ -> IF_ACMPNE
KtTokens.EXCLEQEQEQ, KtTokens.EXCLEQ -> IF_ACMPEQ
else -> throw UnsupportedOperationException("don't know how to generate this condjump")
}
}

View File

@@ -37,7 +37,7 @@ interface Callable {
fun invokeMethodWithArguments(resolvedCall: ResolvedCall<*>, receiver: StackValue, codegen: ExpressionCodegen): StackValue {
// it's important to use unsubstituted return type here to unbox value if it comes from type variable
return StackValue.functionCall(returnType, resolvedCall.resultingDescriptor.original.returnType) {
return StackValue.functionCall(returnType, returnKotlinType ?: resolvedCall.resultingDescriptor.original.returnType) {
codegen.invokeMethodWithArguments(this, resolvedCall, receiver)
}
}

View File

@@ -5,7 +5,6 @@
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
@@ -20,7 +19,7 @@ import org.jetbrains.org.objectweb.asm.util.Printer
class CallableMethod(
override val owner: Type,
private val defaultImplOwner: Type?,
computeDefaultMethodDesc: () -> String,
computeDefaultMethod: () -> Method,
private val signature: JvmMethodSignature,
val invokeOpcode: Int,
override val dispatchReceiverType: Type?,
@@ -32,7 +31,10 @@ class CallableMethod(
val isInterfaceMethod: Boolean,
private val isDefaultMethodInInterface: Boolean
) : Callable {
private val defaultMethodDesc: String by lazy(LazyThreadSafetyMode.PUBLICATION, computeDefaultMethodDesc)
private val defaultImplMethod: Method by lazy(LazyThreadSafetyMode.PUBLICATION, computeDefaultMethod)
private val defaultImplMethodName: String get() = defaultImplMethod.name
private val defaultMethodDesc: String get() = defaultImplMethod.descriptor
fun getValueParameters(): List<JvmMethodParameterSignature> =
signature.valueParameters
@@ -68,10 +70,14 @@ class CallableMethod(
} else {
v.visitMethodInsn(
INVOKESTATIC, defaultImplOwner.internalName,
method.name + JvmAbi.DEFAULT_PARAMS_IMPL_SUFFIX, defaultMethodDesc, isDefaultMethodInInterface
defaultImplMethodName, defaultMethodDesc, isDefaultMethodInInterface
)
StackValue.coerce(Type.getReturnType(defaultMethodDesc), Type.getReturnType(signature.asmMethod.descriptor), v)
StackValue.coerce(
Type.getReturnType(defaultMethodDesc),
Type.getReturnType(signature.asmMethod.descriptor),
v
)
}
}

View File

@@ -10,10 +10,10 @@ import kotlin.collections.CollectionsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.backend.common.CodegenUtil;
import org.jetbrains.kotlin.backend.common.bridges.ImplKt;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.codegen.context.ClassContext;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.psi.*;
import org.jetbrains.kotlin.psi.synthetics.SyntheticClassOrObjectDescriptor;
@@ -21,6 +21,7 @@ import org.jetbrains.kotlin.psi.synthetics.SyntheticClassOrObjectDescriptorKt;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
import org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt;
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter;
@@ -36,8 +37,8 @@ import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isJvmInterface;
import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.enumEntryNeedSubclass;
import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.descriptorToDeclaration;
import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE;
import static org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt.hasJvmDefaultAnnotation;
import static org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind.CLASS_MEMBER_DELEGATION_TO_DEFAULT_IMPL;
import static org.jetbrains.kotlin.util.DeclarationUtilKt.findInterfaceImplementation;
public abstract class ClassBodyCodegen extends MemberCodegen<KtPureClassOrObject> {
@NotNull
@@ -124,7 +125,7 @@ public abstract class ClassBodyCodegen extends MemberCodegen<KtPureClassOrObject
for (DeclarationDescriptor memberDescriptor : DescriptorUtils.getAllDescriptors(descriptor.getDefaultType().getMemberScope())) {
if (memberDescriptor instanceof CallableMemberDescriptor) {
CallableMemberDescriptor member = (CallableMemberDescriptor) memberDescriptor;
if (!member.getKind().isReal() && ImplKt.findInterfaceImplementation(member) == null) {
if (!member.getKind().isReal() && findInterfaceImplementation(member) == null) {
if (member instanceof FunctionDescriptor) {
functionCodegen.generateBridges((FunctionDescriptor) member);
}
@@ -219,17 +220,29 @@ public abstract class ClassBodyCodegen extends MemberCodegen<KtPureClassOrObject
protected void generateDelegatesToDefaultImpl() {
if (isJvmInterface(descriptor)) return;
boolean isErasedInlineClass = InlineClassesUtilsKt.isInlineClass(descriptor) && kind == OwnerKind.ERASED_INLINE_CLASS;
JvmKotlinType receiverType = new JvmKotlinType(typeMapper.mapType(descriptor), descriptor.getDefaultType());
for (Map.Entry<FunctionDescriptor, FunctionDescriptor> entry : CodegenUtil.getNonPrivateTraitMethods(descriptor).entrySet()) {
FunctionDescriptor interfaceFun = entry.getKey();
//skip java 8 default methods
if (!CodegenUtilKt.isDefinitelyNotDefaultImplsMethod(interfaceFun) && !hasJvmDefaultAnnotation(interfaceFun)) {
generateDelegationToDefaultImpl(interfaceFun, entry.getValue());
}
generateDelegationToDefaultImpl(entry.getKey(), entry.getValue(), receiverType, functionCodegen, state, isErasedInlineClass);
}
}
private void generateDelegationToDefaultImpl(@NotNull FunctionDescriptor interfaceFun, @NotNull FunctionDescriptor inheritedFun) {
public static void generateDelegationToDefaultImpl(
@NotNull FunctionDescriptor interfaceFun,
@NotNull FunctionDescriptor inheritedFun,
@NotNull JvmKotlinType receiverType,
@NotNull FunctionCodegen functionCodegen,
@NotNull GenerationState state,
boolean isErasedInlineClass
) {
// Skip Java 8 default methods
if (CodegenUtilKt.isDefinitelyNotDefaultImplsMethod(interfaceFun) ||
JvmAnnotationUtilKt.checkIsImplementationCompiledToJvmDefault(interfaceFun, state.getJvmDefaultMode())) {
return;
}
KotlinTypeMapper typeMapper = state.getTypeMapper();
functionCodegen.generateMethod(
new JvmDeclarationOrigin(
CLASS_MEMBER_DELEGATION_TO_DEFAULT_IMPL, descriptorToDeclaration(interfaceFun), interfaceFun, null
@@ -244,7 +257,7 @@ public abstract class ClassBodyCodegen extends MemberCodegen<KtPureClassOrObject
DeclarationDescriptor declarationInheritedFun = inheritedFun.getContainingDeclaration();
PsiElement classForInheritedFun = descriptorToDeclaration(declarationInheritedFun);
if (classForInheritedFun instanceof KtDeclaration) {
codegen.markLineNumber((KtElement) classForInheritedFun, false);
codegen.markLineNumber(classForInheritedFun, false);
}
ClassDescriptor containingTrait = (ClassDescriptor) containingDeclaration;
@@ -278,18 +291,15 @@ public abstract class ClassBodyCodegen extends MemberCodegen<KtPureClassOrObject
InstructionAdapter iv = codegen.v;
Type[] myArgTypes = signature.getAsmMethod().getArgumentTypes();
Type[] toArgTypes = defaultImplsMethod.getArgumentTypes();
boolean isErasedInlineClass =
InlineClassesUtilsKt.isInlineClass(descriptor) && kind == OwnerKind.ERASED_INLINE_CLASS;
int myArgI = 0;
int argVar = 0;
Type receiverType = typeMapper.mapType(descriptor);
KotlinType interfaceKotlinType = ((ClassDescriptor) inheritedFun.getContainingDeclaration()).getDefaultType();
StackValue.local(argVar, receiverType, descriptor.getDefaultType())
StackValue.local(argVar, receiverType.getType(), receiverType.getKotlinType())
.put(OBJECT_TYPE, interfaceKotlinType, iv);
if (isErasedInlineClass) myArgI++;
argVar += receiverType.getSize();
argVar += receiverType.getType().getSize();
int toArgI = 1;

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