Compare commits

...

5427 Commits

Author SHA1 Message Date
Ilya Gorbunov
ec5e96011c Use newly added shorter alternatives from kotlin.io.path API 2020-11-20 17:40:05 +03:00
Ilya Gorbunov
c2c45b7902 Introduce pathString/absolute/absolutePathString
Rename invariantSeparatorsPath to invariantSeparatorsPathString
to have more consistent names of methods returning path strings.
2020-11-20 17:40:05 +03:00
Ilya Gorbunov
762a7de8fa Allow passing null parent directory to createTempFile/Directory
null signifies the default temp directory.
2020-11-20 17:40:05 +03:00
Ilya Gorbunov
131174185c Relax writeText/appendText parameter type to CharSequence 2020-11-20 17:40:05 +03:00
Alexander Udalov
362775b6b6 JVM IR: minor, improve exception message 2020-11-20 12:43:47 +01:00
Dmitry Petrov
b495fd542f JVM, JVM_IR: KT-42281 proper array->primitive coercion 2020-11-20 14:33:20 +03:00
Dmitry Petrov
e59c8e0a5c JVM_IR KT-42137 bridges are not generated for fake overrides 2020-11-20 14:33:20 +03:00
Roman Artemev
5d5473ef08 [IR BE] Drop unused context member 2020-11-20 12:04:18 +03:00
Roman Artemev
51cff97b78 [JS IR BE] Drop implicit declaration file 2020-11-20 12:03:05 +03:00
Jinseong Jeon
67604551c5 FIR: reuse visibility checker when determining immutable property reference 2020-11-20 10:48:13 +03:00
Jinseong Jeon
463d53ee5c FIR: handle reference to property with invisible setter 2020-11-20 10:48:13 +03:00
Ilya Gorbunov
b2b2629e79 Use new kotlin.io.path API in tests 2020-11-20 09:03:25 +03:00
Ilya Gorbunov
d38e145529 Use new kotlin.io.path API in generators 2020-11-20 09:03:13 +03:00
Ilya Gorbunov
dce3e57685 Use NIO Files for creating temp files: idea plugin 2020-11-20 06:09:37 +03:00
Ilya Gorbunov
090b562db7 Use NIO Files for creating temp files: scripting, daemon, main-kts 2020-11-20 06:09:37 +03:00
Ilya Gorbunov
c9bbdf6575 Use NIO Files for creating temp files: build tools 2020-11-20 06:09:36 +03:00
Nikolay Krasko
30bb7d19c0 Revert "Build: Temporary disable capturing inputs for tasks"
Now GE server is updated and should process scans with inputs faster.

This reverts commit e331e80b
2020-11-19 23:59:16 +03:00
Nikolay Krasko
e8af601cea Mute very flaky FirPsiCheckerTestGenerated.Regression.testJet53
A very probable failure that can be reproduced locally:

```
ERROR: While resolving call checkSubtype#<R|kotlin/collections/List<kotlin/Int>?|>(Collections#.emptyList#<R|kotlin/Int|>())
java.lang.RuntimeException: While resolving call checkSubtype#<R|kotlin/collections/List<kotlin/Int>?|>(Collections#.emptyList#<R|kotlin/Int|>())
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirExpressionsResolveTransformer.transformFunctionCall(FirExpressionsResolveTransformer.kt:282)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFunctionCall(FirBodyResolveTransformer.kt:114)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFunctionCall(FirBodyResolveTransformer.kt:30)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFunctionCall(FirTransformer.kt:957)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFunctionCall(FirTransformer.kt:140)
	at org.jetbrains.kotlin.fir.expressions.FirFunctionCall.accept(FirFunctionCall.kt:31)
	at org.jetbrains.kotlin.fir.FirElement$DefaultImpls.transform(FirElement.kt:29)
	at org.jetbrains.kotlin.fir.FirPureAbstractElement.transform(FirPureAbstractElement.kt:11)
	at org.jetbrains.kotlin.fir.visitors.FirTransformerUtilKt.transformSingle(FirTransformerUtil.kt:12)
	at org.jetbrains.kotlin.fir.declarations.impl.FirPropertyImpl.transformInitializer(FirPropertyImpl.kt:104)
	at org.jetbrains.kotlin.fir.declarations.impl.FirPropertyImpl.transformInitializer(FirPropertyImpl.kt:34)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer.transformChildrenWithoutAccessors(FirDeclarationsResolveTransformer.kt:278)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer.access$transformChildrenWithoutAccessors(FirDeclarationsResolveTransformer.kt:42)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirDeclarationsResolveTransformer.transformProperty(FirDeclarationsResolveTransformer.kt:132)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformProperty(FirBodyResolveTransformer.kt:254)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer.access$transformProperty$s1271549241(FirImplicitBodyResolve.kt:116)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer$transformProperty$1.invoke(FirImplicitBodyResolve.kt:143)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer$transformProperty$1.invoke(FirImplicitBodyResolve.kt:116)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer.computeCachedTransformationResult(FirImplicitBodyResolve.kt:169)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer.transformProperty(FirImplicitBodyResolve.kt:142)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirImplicitAwareBodyResolveTransformer.transformProperty(FirImplicitBodyResolve.kt:116)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitProperty(FirTransformer.kt:753)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitProperty(FirTransformer.kt:140)
	at org.jetbrains.kotlin.fir.declarations.FirProperty.accept(FirProperty.kt:53)
	at org.jetbrains.kotlin.fir.FirElement$DefaultImpls.transform(FirElement.kt:29)
	at org.jetbrains.kotlin.fir.FirPureAbstractElement.transform(FirPureAbstractElement.kt:11)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.visitNoTransform(FirBodyResolveTransformer.kt:358)
	at org.jetbrains.kotlin.idea.fir.low.level.api.trasformers.FirDesignatedImplicitTypesTransformerForIDE.transformDeclarationContent(FirDesignatedImplicitTypesTransformerForIDE.kt:42)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFile(FirBodyResolveTransformer.kt:66)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFile(FirBodyResolveTransformer.kt:30)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFile(FirTransformer.kt:801)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFile(FirTransformer.kt:140)
	at org.jetbrains.kotlin.fir.declarations.FirFile.accept(FirFile.kt:32)
	at org.jetbrains.kotlin.fir.FirElement$DefaultImpls.transform(FirElement.kt:29)
	at org.jetbrains.kotlin.fir.FirPureAbstractElement.transform(FirPureAbstractElement.kt:11)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.visitNoTransform(FirBodyResolveTransformer.kt:358)
	at org.jetbrains.kotlin.idea.fir.low.level.api.trasformers.FirDesignatedImplicitTypesTransformerForIDE.transformDeclarationContent(FirDesignatedImplicitTypesTransformerForIDE.kt:42)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFile(FirBodyResolveTransformer.kt:66)
	at org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.FirBodyResolveTransformer.transformFile(FirBodyResolveTransformer.kt:30)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFile(FirTransformer.kt:801)
	at org.jetbrains.kotlin.fir.visitors.FirTransformer.visitFile(FirTransformer.kt:140)
	at org.jetbrains.kotlin.fir.declarations.FirFile.accept(FirFile.kt:32)
	at org.jetbrains.kotlin.fir.FirElement$DefaultImpls.transform(FirElement.kt:29)
	at org.jetbrains.kotlin.fir.FirPureAbstractElement.transform(FirPureAbstractElement.kt:11)
	at org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver$runLazyResolvePhase$$inlined$runPhaseWithCustomResolve$3.run(utils.kt:82)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:188)
	at org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver.runLazyResolvePhase(FirLazyDeclarationResolver.kt:246)
	at org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver.runLazyResolveWithoutLock(FirLazyDeclarationResolver.kt:127)
	at org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver.lazyResolveDeclaration(FirLazyDeclarationResolver.kt:63)
	at org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver.lazyResolveDeclaration$default(FirLazyDeclarationResolver.kt:39)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.createDeclarationStructure(FileStructure.kt:131)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.createStructureElement(FileStructure.kt:171)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.access$createStructureElement(FileStructure.kt:29)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure$getStructureElementForDeclaration$structureElement$1.apply(FileStructure.kt:48)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure$getStructureElementForDeclaration$structureElement$1.apply(FileStructure.kt:29)
	at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1853)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.getStructureElementForDeclaration(FileStructure.kt:46)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.getStructureElementFor(FileStructure.kt:42)
	at org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.FileStructure.getAllDiagnosticsForFile(FileStructure.kt:71)
	at org.jetbrains.kotlin.idea.fir.low.level.api.diagnostics.DiagnosticsCollector.collectDiagnosticsForFile(DiagnosticsCollector.kt:27)
	at org.jetbrains.kotlin.idea.fir.low.level.api.FirModuleResolveStateImpl.collectDiagnosticsForFile$idea_fir_low_level_api(FirModuleResolveStateImpl.kt:63)
	at org.jetbrains.kotlin.idea.fir.low.level.api.api.LowLevelFirApiFacade.collectDiagnosticsForFile(LowLevelFirApiFacade.kt:93)
	at org.jetbrains.kotlin.idea.frontend.api.fir.components.KtFirDiagnosticProvider.collectDiagnosticsForFile(KtFirDiagnosticProvider.kt:26)
	at org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSession.collectDiagnosticsForFile(KtAnalysisSession.kt:63)
	at org.jetbrains.kotlin.idea.fir.highlighter.KotlinHighLevelDiagnosticHighlightingPass.doCollectInformation(KotlinHighLevelDiagnosticHighlightingPass.kt:36)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:52)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:442)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:435)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:434)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:410)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:168)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:168)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:408)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:171)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:163)
```
2020-11-19 23:58:02 +03:00
Steven Schäfer
7bfe2c0bbc JVM IR: Update test expectation for testSamAdapterAndInlineOnce
...and remove redundant bytecode text tests.
2020-11-19 19:46:49 +01:00
Steven Schäfer
8574cb4466 JVM IR: Don't generate line numbers and null checks in SAM wrapper constructors 2020-11-19 19:46:49 +01:00
Steven Schäfer
68e2d0d245 JVM IR: Generate synthetic final implementation methods in SAM wrappers 2020-11-19 19:46:49 +01:00
Steven Schäfer
a475fa2a21 JVM IR: Use raw types in SAM wrappers 2020-11-19 19:46:49 +01:00
Steven Schäfer
999151abac JVM IR: Generate SAM wrapper fields as synthetic final 2020-11-19 19:46:49 +01:00
Steven Schäfer
ec1d42e92b JVM IR: Generate SAM wrapper classes as non-synthetic 2020-11-19 19:46:49 +01:00
Steven Schäfer
36711a768b JVM IR: Use inline SAM wrappers inside of inline lambdas 2020-11-19 19:46:49 +01:00
Alexander Udalov
f2b8c67962 Fix JvmTarget6OnJvm11 tests after 7b5544ebd3 2020-11-19 18:49:55 +01:00
Ilmir Usmanov
c22071566e IC mangling: Use old mangling scheme when LV is 1.3
Add integration test to check, that nothing is broken with LV 1.3.
2020-11-19 17:39:34 +01:00
Ilmir Usmanov
7ee35af721 IC mangling: Use correct mangling scheme when
checking for duplicate signatures.
2020-11-19 17:39:33 +01:00
Ilmir Usmanov
7761d30365 Minor. Add test to check fallback 2020-11-19 17:39:33 +01:00
Ilmir Usmanov
7a18ab9094 IC mangling: Generate version requirements to properties as well
Generate the requirements at JVM only.
2020-11-19 17:39:32 +01:00
Ilmir Usmanov
0d79ed1077 Minor. Update test data 2020-11-19 17:39:32 +01:00
Ilmir Usmanov
9070d6d581 IC mangling: Use old mangling scheme in stdlib 2020-11-19 17:39:31 +01:00
Ilmir Usmanov
89d45bf909 IC mangling: Use old mangling scheme in FIR tests
instead of ignoring them.
This affects all unsigned tests.
2020-11-19 17:39:31 +01:00
Ilmir Usmanov
2cd9016016 IC mangling: Replace compiler hack with configuration flag 2020-11-19 17:39:30 +01:00
Ilmir Usmanov
bc1b6fef1f IC mangling: Generalize mangling algorithm between two backends 2020-11-19 17:39:29 +01:00
Ilmir Usmanov
b33774e5f2 IC mangling: Use empty list as a separator in the new mangling scheme 2020-11-19 17:39:28 +01:00
Ilmir Usmanov
20e7a77b78 IC mangling: Write version 1.4.30 requirement to functions with new mangling 2020-11-19 17:39:28 +01:00
Ilmir Usmanov
2829d37cf5 IC mangling: Use old mangling scheme for stdlib
This way, new stdlib can still be usable in 1.4.20
2020-11-19 17:39:27 +01:00
Ilmir Usmanov
488d4ab018 IC mangling: Use '_' instead of 'x' as a placeholder before hashing 2020-11-19 17:39:27 +01:00
Ilmir Usmanov
f7164404c9 IC mangling: Ignore FIR tests 2020-11-19 17:39:26 +01:00
Ilmir Usmanov
23184bae05 IC mangling: JVM_IR: Fallback to old mangling rules
if classfile does not contain functions mangled in the new way.
2020-11-19 17:39:26 +01:00
Ilmir Usmanov
546eea1982 IC mangling: Old JVM BE: Fallback to old mangling rules
if classfile does not contain functions mangled in the new way.
2020-11-19 17:39:25 +01:00
Ilmir Usmanov
c62093f54c IC mangling: Change mangling rules
1. Use 'x' for each parameter, which is not an inline class, every
possible clash is handled by signature rather than name. This change
makes more API changes binary-compatible. So, the changes are in line
with the vision of inline classes are value classes, like primitives.

2. Take return type into account when mangling a function if the return
type is inline class. Otherwise, boxing bridge will not be generated,
which leads to CCE at runtime.
2020-11-19 17:39:24 +01:00
Alexander Udalov
d21a01ef59 IR: improve "no such .. argument slot" exception message
Include the symbol signature, if it's available.
2020-11-19 16:34:03 +01:00
Kirill Shmakov
8ede19811d Make mpp tests gutters aware of different platforms run
Behaviour is similar to the test suite gutters:
- simple triangle when there is no history
- triangle + red circle if some runs failed
- triangle + green circle if all runs passed

^KMM-100 Fixed.
2020-11-19 17:20:06 +03:00
Dmitriy Dolovov
0d50ccc42d [Commonizer] Fix: Lost nullability in commonized type aliases 2020-11-19 16:47:24 +03:00
Dmitry Petrov
e17158d961 JVM_IR KT-42758 don't use 'this' for object self-reference by name 2020-11-19 16:34:04 +03:00
Dmitry Petrov
118a7d4e34 JVM_IR KT-43242 generate switch subject as primitive 'int' 2020-11-19 16:34:04 +03:00
Andrei Klunnyi
05ddbeab0a KT-42561 [Gradle Runner]: run task is created for extra modules
Approach to take classpath from 'project.sourceSets' failed because it
was applied to extra modules - those without java like plugins
(extending project model with 'sourceSets').

This commit specifies criterion of gradle-project selection - the one to
create run task for.
    
^KT-42561 fixed
2020-11-19 12:47:39 +00:00
LepilkinaElena
b0c74c841e Remove extra copyOf calls during filtering in collectRealOverrides (#3916) 2020-11-19 09:53:25 +03:00
Alexander Udalov
7b5544ebd3 Use -source/target 1.6 for Java sources in codegen tests
In cases when the test has the JVM_TARGET directive, use that one for
Java compilation as well.

Otherwise, for box tests, the corresponding test in `JvmTarget6OnJvm6`
(module `:compiler:tests-different-jdk`) will fail. However, it affects
all codegen tests, so fix a bunch of them which use Java 8+ features to
explicitly compile with JVM target 1.8. In particular, this obsoletes
the SKIP_JDK6 directive in those tests because "JVM_TARGET: 1.8" also
skips it for JDK 6.

The check for IS_SOURCE_6_STILL_SUPPORTED is needed in order to still be
able to run tests in the project while only having a single JDK > 11
installed, and having all of the env vars JDK_16, JDK_17, JDK_18
pointing to that JDK.
2020-11-18 18:43:43 +01:00
Mads Ager
7b4e0b2f5d [JVM_IR] Deal with lowering ordering issues for JvmStatic function references.
Do not destructively update the @JvmStatic function, instead
create a copy on first access, and replace the original with
the copy in the jvm static lowering. This ensures that the original
function is seen in other lowerings independently of file lowering
order.
2020-11-18 17:13:00 +01:00
Dmitry Petrov
3d2f5f4bc1 KT-42018 explicitly cast inline class values in safe-as 2020-11-18 18:51:15 +03:00
Kristoffer Andersen
edd3b457d4 [JVM+IR] Migrate/improve receiver mangling test suite 2020-11-18 15:18:10 +01:00
Kristoffer Andersen
5967e8295e [IR] Align captured receiver variable naming with old BE 2020-11-18 15:18:10 +01:00
Vladimir Dolzhenko
7732fc38e0 Add more IDE performance tests vega chart specs 2020-11-18 14:31:56 +01:00
Mikhail Glukhikh
bcf6980f67 [FIR2IR] Fix CCE in FirTypeRef.canBeNull 2020-11-18 16:26:13 +03:00
Mikhail Glukhikh
91738b7f88 [FIR] Fix broken IDE test data 2020-11-18 16:05:50 +03:00
Dmitry Petrov
ca41f733b6 KT-41841 no delegate to private $default fun in multifile facade 2020-11-18 15:04:39 +03:00
Jinseong Jeon
9a99af53ba FIR JVM: correct signature conversion for array
#KT-43339 Fixed
2020-11-18 13:06:51 +03:00
Jinseong Jeon
77ce5ea15d FIR Java: handle primitive void return type for synthetic setter 2020-11-18 13:06:50 +03:00
Jinseong Jeon
5c61079d75 FIR: reproduce KT-43339 (Throwable.stackTrace) 2020-11-18 13:06:49 +03:00
Jinseong Jeon
4cb32cd38a FIR2IR: add implicit NOT_NULL cast for @FlexibleNullability type 2020-11-18 13:06:48 +03:00
Mikhail Glukhikh
b658e99f91 FIR Java: simplify flexible nullability manipulations 2020-11-18 13:06:47 +03:00
Jinseong Jeon
fc7f589caa FIR Java: record Java types with flexible nullability 2020-11-18 13:06:46 +03:00
Jinseong Jeon
1f48092ec1 FIR Java: convert more annotations to @EnhancedNullability 2020-11-18 13:06:45 +03:00
Alexander Gorshenev
01ef41ab17 No need to explicitly deprecate -Xdisable-fake-override-validator
A warning is produced automagically
2020-11-18 12:46:40 +03:00
Alexander Gorshenev
f42b902bc8 Made -Xfake-override-validator off by default
Deprected -Xdisable-fake-override-validator
2020-11-18 12:46:40 +03:00
Steven Schäfer
4e03b1e05f JVM: Allow the JvmSynthetic annotation on file classes (KT-41884) 2020-11-17 22:06:19 +01:00
Dmitriy Dolovov
66bc142f92 [Commonizer] Empty sources/javadocs Jars 2020-11-17 19:02:18 +03:00
Dmitry Petrov
a27c6b77cf KT-43370 ACC_DEPRECATED on property accessors implemented by delegation 2020-11-17 18:16:37 +03:00
Dmitriy Novozhilov
986bdd1099 Build: replace usages of kotlin.build.useIR with kotlinBuildProperties.useIR 2020-11-17 18:14:09 +03:00
Dmitriy Novozhilov
c625a83ab5 Build: replace usages of idea.fir.plugin with kotlinBuildProperties.useFirIdeaPlugin 2020-11-17 18:14:08 +03:00
Dmitriy Novozhilov
1a3727a17c Build: advance kotlin-build-gradle-plugin version in build files 2020-11-17 18:14:08 +03:00
Dmitriy Novozhilov
f531612aa4 Build: update kotlin-build-gradle-plugin version 2020-11-17 18:14:08 +03:00
Dmitriy Novozhilov
bab08c29be Build: add several FIR flags to kotlin-build-gradle-plugin 2020-11-17 18:14:08 +03:00
Alexander Udalov
8160f579d3 Build: add useIR/useIRForLibraries to kotlin-build-gradle-plugin 2020-11-17 18:14:07 +03:00
Nikolay Krasko
e331e80b5d Build: Temporary disable capturing inputs for tasks
We are suffering from the increasing build scan queue. Try to help
the server to overcome it.
2020-11-17 15:08:44 +03:00
Ivan Gavrilovic
33a0ec9b4f KGP: Clean up configurations setup
KAPT classpath now uses extendsFrom in order to
resolve all configurations as a single graph.

Also, use Configuration.extendsFrom instead of
DependencyHandler.add that is being deprecated
in Gradle 6.7.
2020-11-17 10:44:15 +03:00
Ivan Gavrilovic
519aeeb644 KT-40140: Task configuration avoidance for Android projects
When adding Java sources to Kotlin task, avoid
force-configuring source-generating tasks in AGP.

Fixes https://youtrack.jetbrains.com/issue/KT-40140.

Test: ConfigurationAvoidanceIT.testAndroidUnrelatedTaskNotConfigured
2020-11-17 10:43:48 +03:00
Yan Zhulanow
d376585821 IDE dependencies: Publish kotlin-coroutines-experimental-compat library 2020-11-17 10:29:21 +03:00
Vyacheslav Gerasimov
d7474bb2f7 Build: Use only @Exported & whitelisted classes for tools.jar api
This makes it stable between JDK vendors and versions
2020-11-17 01:21:00 +03:00
Alexander Likhachev
ac851523d8 [Gradle, MPP] Make KotlinCompileCommon task cc-compatible with warnings
Kotlin options are accessed via compilation. Compilation field is marked as transient and so not available after deserializing task from Gradle configuration cache.
Accessing 'isCompatibilityMetadataVariantEnabled' property via project in tasks 'onlyIf' causes Gradle to project instance serialization attempt that fails
(#KT-43141, #KT-43329) Fixed
2020-11-17 00:52:30 +03:00
Denis Zharkov
c6f46598ca Set TARGET_BACKEND to JVM for failing irrelevant tests 2020-11-16 22:20:44 +03:00
Martin Petrov
68fdeaf865 Produce deterministic jar files.
This resets all timestamps present in jars produced by kotlinc.

This is important for build systems like bazel that rely on
deterministic outputs.

Before:

```
$ kotlinc ~/test.kt -d /tmp/a.jar
$ kotlinc ~/test.kt -d /tmp/b.jar
9ab80cd40c9293a7a66adf1154d4e6e9aa92d5b0  /tmp/a.jar
1ba022697317f796bd123fb4dc95418a18bcb51a  /tmp/a.jar
6d2a2683470c24928f3fbd6768a4c57f55b0d196  /tmp/b.jar
$ unzip -l /tmp/a.jar
Archive:  /tmp/a.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
       75  09-25-2020 16:48   META-INF/MANIFEST.MF
      683  09-25-2020 16:48   TestKt.class
       28  09-25-2020 16:48   META-INF/main.kotlin_module
---------                     -------
      786                     3 files
```

After:

```
$ kotlinc ~/test.kt -d /tmp/a.jar
$ kotlinc ~/test.kt -d /tmp/b.jar
$ shasum /tmp/a.jar /tmp/b.jar
9ab80cd40c9293a7a66adf1154d4e6e9aa92d5b0  /tmp/a.jar
9ab80cd40c9293a7a66adf1154d4e6e9aa92d5b0  /tmp/b.jar
$ unzip -l /tmp/a.jar
Archive:  /tmp/a.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
       75  12-31-1969 19:00   META-INF/MANIFEST.MF
      590  12-31-1969 19:00   TestKt.class
       36  12-31-1969 19:00   META-INF/main.kotlin_module
---------                     -------
      701                     3 files
```

See https://github.com/JetBrains/kotlin/pull/3226 for a similar change.
2020-11-16 19:25:20 +01:00
Alexander Udalov
a3830b2611 JVM IR: copy corresponding property+annotations for DefaultImpls methods
Instead of using methodSignatureMapper which was an obsolete hack to
make accessor names "getFoo" instead of "<get-foo>".

In particular, this keeps the `@Deprecated` annotation on the
corresponding property, which results in ACC_DEPRECATED in codegen.

 #KT-43326 Fixed
2020-11-16 19:15:49 +01:00
Alexander Udalov
5212ae6bbd JVM IR: keep property annotations for inline class replacements
In particular, `@Deprecated` is not lost anymore and accessors of
deprecated property are generated with ACC_DEPRECATED just as in the old
backend.

 #KT-43327 Fixed
2020-11-16 19:15:49 +01:00
Alexander Udalov
4ca60a2d7d Fix warnings and some inspections in buildSrc 2020-11-16 19:15:43 +01:00
Denis Zharkov
22109e97d6 FIR: Unmute passing FirPsiCheckerTestGenerated.testJet53 2020-11-16 15:50:39 +03:00
Denis Zharkov
14305d1eba FIR: Simplify callable references resolution
Also that fixes some bugs
2020-11-16 15:50:39 +03:00
Denis Zharkov
387fd895a6 FIR: Drop unused FirComposedSuperTypeRef 2020-11-16 15:50:39 +03:00
Denis Zharkov
ad35723f56 FIR: Simplify super-qualified calls resolution 2020-11-16 15:50:39 +03:00
Denis Zharkov
d4c7d4fc7c FIR: Fix callable references resolution with stub receivers
Use stubReceiver as a receiver for fake calls

See issues KT-43358 KT-43359 KT-43378
2020-11-16 15:50:39 +03:00
Denis Zharkov
f97cc0b62d FIR: Rework receivers processing in resolution
- Put extensionReceiver to candidate even if it's explicit (for sake of clarity)
- Split CheckReceiver (dispatch part should only check nullability)
2020-11-16 15:50:39 +03:00
Denis Zharkov
e2099a0307 FIR: Fix false-positive successful resolution of call with lambda receiver
Do not try to integrate/postpone receiver expression to the base system
Receiver should be resolved independently anyway
2020-11-16 15:50:39 +03:00
Denis Zharkov
396e799e5d FIR: Fix resolution for type-alias based SAM 2020-11-16 15:50:39 +03:00
Denis Zharkov
4c9a4548f2 FIR: Fix overrides binding for Java inheritor
`overriddenMembers` contract requires original (non-enhanced) function
See other usages

Ignored tests have been working accidentally

^KT-43289 Open
2020-11-16 15:50:39 +03:00
Denis Zharkov
855af08f7c Regenerate tests 2020-11-16 15:50:39 +03:00
Mikhail Glukhikh
4f7b45dfcc Fir2IrTypeConverter: simplify captured type cache 2020-11-16 15:14:26 +03:00
Jinseong Jeon
cb77b76c0d FIR2IR: convert recursive captured type properly
#KT-43346 Fixed
2020-11-16 15:14:24 +03:00
Mikhail Glukhikh
8ecf056927 [FIR2IR] Enter scope a bit earlier in createIrPropertyAccessor 2020-11-16 14:44:43 +03:00
Mikhail Glukhikh
59c86bcdc4 [FIR2IR] Provide more information for errors inside convertToIrSetCall 2020-11-16 14:44:42 +03:00
Mikhail Glukhikh
9de244515e Upgrade coroutines: 1.3.7 -> 1.3.8 2020-11-16 14:29:58 +03:00
Dmitry Petrov
93f868fb96 KT-43196 member extension property can't be "primary" in inline class 2020-11-16 13:54:19 +03:00
Vladimir Dolzhenko
b6f958f856 Do not queue bg task under read action
Relates to #EA-218701
2020-11-16 09:25:08 +00:00
Dmitriy Dolovov
6e7b5a55b3 kotlinx-metadata: Don't write flags for absent property accessors 2020-11-13 22:54:34 +03:00
Dmitriy Novozhilov
a6cbae9719 [FIR] Rename FirErrors.SYNTAX_ERROR to SYNTAX 2020-11-13 16:19:30 +03:00
Dmitriy Novozhilov
2f5b231d50 [FIR] Add default renderers to FirDiagnosticFactories 2020-11-13 16:19:30 +03:00
Dmitriy Novozhilov
dc662efcf4 [FIR] Introduce FirDiagnosticRenderers 2020-11-13 16:19:29 +03:00
Dmitriy Novozhilov
ed0e5adce7 [FIR] Make FirAnalyzerFacade returns diagnostics grouped by fir file 2020-11-13 16:19:29 +03:00
Dmitriy Novozhilov
dabc259ae8 [FIR] Make diagnostics collectors returns List instead of Iterable 2020-11-13 16:19:29 +03:00
Dmitriy Novozhilov
20453bf0d8 [FIR] Get rid of FirSessionProvider.project property 2020-11-13 16:19:29 +03:00
Dmitriy Novozhilov
82a2ecfe14 [FIR] Cleanup creating sessions in CLI FIR compiler 2020-11-13 16:19:29 +03:00
Dmitriy Novozhilov
3aa8b09e31 [FIR] Add configurable language version settings to FirSessionFactories 2020-11-13 16:19:29 +03:00
Dmitry Petrov
5d76df6e1a KT-43045 mangle function name for fake override with default impl 2020-11-13 16:15:29 +03:00
Mads Ager
1ecf5943ab [JVM_IR] Determine correct type of empty varargs array.
When calling vararg methods with a generic vararg type without
passing explicit parameters, we have to allocate an empty array
of the right type. We failed to do so previously, as we did
not take the type arguments for the dispatch receiver into
account.
2020-11-13 12:13:53 +01:00
Georgy Bronnikov
ffc003c051 IR: copy IrProperty's attributes in deepCopyWithSymbols 2020-11-13 11:44:35 +03:00
Yan Zhulanow
7b98876475 Parcelize: Fix typo in diagnostic message (KT-43290) 2020-11-13 17:37:21 +09:00
Dmitriy Novozhilov
e3bfb9245c [FIR] Rename nested directory with testdata to innerClasses
This is needed to avoid clashing name of generated test class (`Nested`)
  with annotation @Nested from JUnit 5
2020-11-13 10:36:39 +03:00
Dmitriy Novozhilov
419f54259c [TEST] Change semantics of CHECK_TYPE directive and update testdata
Previously helpers from checkType.kt was in special package, and
  if directive was enabled then test runner (`AbstractDiagnosticTest`)
  injected additional imports to test files and removed them after test
  was completed.
It's very hard to support such behavior in new test infrastructure so
  there was a decision about changing `CHECK_TYPE`:
1. All helpers from `checkType.kt` now stays in default package
2. `CHECK_TYPE` only adds `checkType.kt` to set of analyzed files
      and don't modify their content

For test which are written in default package (most of tests actually)
  there are no changes. On the other hand if there is a test where dev
  want to use checkType functions in testfile with some package then he
  should explicitly import functions which he needed (`checkSubtype`,
  `checkType`, `_`)
2020-11-13 10:36:12 +03:00
Dmitry Petrov
653b26174b KT-43006 don't generate no-arg constructor with inline class parameters 2020-11-13 09:59:34 +03:00
Georgy Bronnikov
364773bf0f IR: fix IrClassSymbol.starProjectedType 2020-11-12 21:49:11 +03:00
Dmitriy Dolovov
f5329b6f1d [Commonizer] Don't publish sources and javadocs 2020-11-12 17:23:52 +03:00
Dmitriy Novozhilov
15cc979378 [FIR] Add enter contract node as exit for exceptional path to avoid compiler crashing
This fixes crashing test
 `FirDiagnosticsTestSpecGenerated.NotLinked.Contracts.Declarations.ContractBuilder.Common.Neg.test17`
2020-11-12 14:46:39 +03:00
Dmitriy Novozhilov
87380d1913 [FIR] Don't assume that exit lambda node is target for exceptional exit for inplace lambdas
#KT-39709 Fixed
#KT-43156 Fixed
2020-11-12 14:46:38 +03:00
Jinseong Jeon
440cf78884 FIR CFG: add more uncaught exception paths 2020-11-12 14:46:37 +03:00
Jinseong Jeon
7b06885348 FIR checker: reproduce KT-43156 2020-11-12 14:46:36 +03:00
Dmitriy Novozhilov
f4347a60c2 [FIR] Fix typo 2020-11-12 14:46:35 +03:00
Mikhail Glukhikh
3c48f2eb68 [FIR] Handle isProp/setProp synthetic pair properly in Java use-site scope 2020-11-12 13:37:38 +03:00
Mikhail Glukhikh
2725930460 [FIR] Code cleanup in JavaClassUseSiteMemberScope 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh
fb961f7070 [FIR] Copy also synthetic setter during fake override generation 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh
22fb620344 [FIR Java] Copy also synthetic setter during enhancement 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh
e0abf3a62c [FIR Java] More precise synthetic setter search in use-site scope
In this commit we detect both Java void & Kotlin Unit return types
2020-11-12 13:37:37 +03:00
Mikhail Glukhikh
c515af4373 Fir2IrDeclarationStorage: extract common getIrCallableSymbol 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh
b90391ced4 [FIR2IR] Implement getIrConstructorSymbol like getIrFunctionSymbol 2020-11-12 13:37:36 +03:00
Mikhail Glukhikh
0cc57fc90c Fir2IrDeclarationStorage: reorder functions slightly 2020-11-12 13:37:36 +03:00
Mikhail Glukhikh
90f135dc3e [FIR2IR] Use computeDeclarationOrigin in getIrPropertySymbol 2020-11-12 13:37:36 +03:00
Mikhail Glukhikh
6c1f5a4513 [FIR2IR] Cache functions/properties both by symbol & signature 2020-11-12 13:37:36 +03:00
Mikhail Glukhikh
92840b8ec5 FirTypeIntersectionScope: fix typo in name 2020-11-12 13:37:35 +03:00
Mikhail Glukhikh
5b947144d4 FirTypeIntersectionScope: don't create in no-supertypes situation 2020-11-12 13:37:35 +03:00
Mikhail Glukhikh
8ace0d9ad1 [FIR] Replace local types with Any in deserializer 2020-11-12 13:37:35 +03:00
Mikhail Glukhikh
744918fb47 [FIR] Cleanup ConeIntegerLiteralTypeImpl 2020-11-12 13:37:35 +03:00
Mikhail Glukhikh
0d03e5f235 [FIR] Simplify constructStarProjectedType 2020-11-12 13:37:34 +03:00
Mikhail Glukhikh
af52232058 [FIR2IR] Use proper lookup tags in data class member generator 2020-11-12 13:37:34 +03:00
Mikhail Glukhikh
7905bc8632 Forbid creation of local ConeClassLikeLookupTagImpl 2020-11-12 13:37:34 +03:00
Bingran
5dc7964137 Optimize the way of enabling "--warning-mode=fail"
Make sure project directory is cleaned up after testing
This change is a "follow-up" PR of
https://github.com/JetBrains/kotlin/pull/3804.
2020-11-12 11:13:56 +03:00
Dmitriy Dolovov
e5539b9a9e Gradle, Native: Log raw and transformed args in KotlinToolRunner, p.2 2020-11-12 10:40:33 +03:00
Ilya Gorbunov
4767696840 Qualify replacement expression with receiver to workaround KT-42874 2020-11-12 05:29:39 +03:00
Andrey Uskov
e0655b2f96 Unmute fixed android importing tests in platform 202 2020-11-12 00:24:50 +03:00
Andrey Uskov
a0d5af8dd1 Execute gutters calculation in read action in tests 2020-11-12 00:24:44 +03:00
Andrey Uskov
e5be9601e6 Disable indexation ExternalSystem tests 2020-11-12 00:24:43 +03:00
Andrey Uskov
9318d401f7 Fix test runtime dependencies in NativeImportingTests 2020-11-12 00:24:42 +03:00
Andrey Uskov
dea383460e Add dependency on platform-images in tests 2020-11-12 00:24:41 +03:00
Yan Zhulanow
5f7d7ff9c7 Parcelize: Activate checkers only when the plugin is enabled for module (KT-43291) 2020-11-12 05:38:27 +09:00
Ilya Kirillov
9d207c2cf5 FIR IDE: temporary mute some not passing tests 2020-11-11 21:02:34 +03:00
Ilya Kirillov
3e43efb93e FIR IDE: fix working with copied file in completion 2020-11-11 21:02:33 +03:00
Igor Yakovlev
0d59656532 FIR IDE: Add resolving KtParameter in FirLazyDeclarationResolver 2020-11-11 21:02:31 +03:00
Dmitriy Novozhilov
345a0d3f89 [FIR] Implement writeGenericType in FirJvmTypeMapper 2020-11-11 21:02:31 +03:00
Ilya Kirillov
9350f7aff9 FIR IDE: remove unused method in light classes with compilation error 2020-11-11 21:02:29 +03:00
Ilya Kirillov
b42bed7b3c FIR IDE: make some access to FIR elements under read locks, resolve under write locks 2020-11-11 21:02:28 +03:00
Ilya Kirillov
12ed92cd49 FIR IDE: allow getting parent declaration for Java one 2020-11-11 21:02:27 +03:00
Ilya Kirillov
cbd1ec35ce FIR IDE: lazy resolve property accessors 2020-11-11 21:02:26 +03:00
Ilya Kirillov
fbc6f1b10f FIR IDE: introduce SOURCE_MEMBER_GENERATED declaration kind 2020-11-11 21:02:24 +03:00
Ilya Kirillov
7dcda00e1d FIR IDE: do not fail on invalid code 2020-11-11 21:02:22 +03:00
Ilya Kirillov
c646cb3d7e FIR IDE: fix deadlock in getter symbol resolve 2020-11-11 21:02:21 +03:00
Ilya Kirillov
171157ff78 FIR IDE: allow reference resolving from EDT
It may be called from some other subsystems like Find usages.
Throwing PCE every time we try to resolve some reference from EDT
may result endless try to resolving
2020-11-11 21:02:19 +03:00
Igor Yakovlev
b742a475ff [FIR IDE] Initial FIR LightClass implementation 2020-11-11 21:02:18 +03:00
Igor Yakovlev
c881cf7af6 [FIR IDE] Add when branch for new symbols in FunctionCallHighlightingVisitor 2020-11-11 21:02:14 +03:00
Igor Yakovlev
b423da106f [FIR IDE] Add fir data into symbols to support FIR LC 2020-11-11 21:02:09 +03:00
Ilya Kirillov
3d93503894 FIR IDE: introduce analyze function for with by existing module resolve state 2020-11-11 21:02:07 +03:00
Igor Yakovlev
dbb54c87bc [FIR IDE] Add Fir lightclasses tests and fix FindUsages tests 2020-11-11 21:02:00 +03:00
Igor Yakovlev
3cefef03ff Move refactoring for ifTrue and ifFalse extensions 2020-11-11 21:01:58 +03:00
Ilya Kirillov
a42674ef0e FIR IDE: add hack to allow access symbols on edt 2020-11-11 21:01:57 +03:00
Igor Yakovlev
97f062cb2a [FIR IDE] Add FirJvmTypeMapper to Ide components factory 2020-11-11 21:01:56 +03:00
Igor Yakovlev
36ffde5ca8 [FIR] Implement isArrayOrNullableArray for ConeTypeContext 2020-11-11 21:01:55 +03:00
sebastian.sellmair
06cb64bb51 Allow open callable members in expect interfaces
#KT-42094 fixed
2020-11-11 17:41:59 +00:00
Dmitriy Dolovov
bf0156f7c6 Native, Gradle IT: Fix GeneralNativeIT.testNativeArgsWithSpaces() 2020-11-11 20:29:36 +03:00
Dmitriy Dolovov
0fe842c38f Gradle, Native: Log raw and transformed arguments in KotlinToolRunner 2020-11-11 20:29:31 +03:00
Dmitriy Dolovov
ee7f3b1bfe Native: Use NIO Files.createTemp*() in favor of File.createTemp*() extension functions 2020-11-11 20:29:25 +03:00
Dmitry Petrov
47e2656ca9 JVM_IR keep track of original overrides at collection stubs generation
KT-43068
2020-11-11 18:35:41 +03:00
Yan Zhulanow
65d8e5a615 Don't publish kotlin-dist-for-ide in publishIdeArtifacts as it's now published alone 2020-11-11 18:12:26 +03:00
Roman Artemev
01f3c06ec9 Add test for KT-40412 2020-11-11 17:00:25 +03:00
Alexander Udalov
116606ecd2 JVM IR: fix class kind of created java.lang.Deprecated symbol
If it isn't ANNOTATION_CLASS, the newly added code in
`FunctionCodegen.isDeprecatedHidden` (0e91d3fcb0) ends up transforming
IR annotation constructor calls to annotation descriptors, and an
assertion fails in `IrBasedDeclarationDescriptor.toAnnotationDescriptor`
which checks that the class has kind ANNOTATION_CLASS.

Specifically, this failed in the JVM IR bootstrap on
`CallResolutionInterceptorExtension.interceptCandidates` from module
'frontend'.
2020-11-11 12:53:32 +01:00
Svyatoslav Kuzmich
c1b73f5fee [Wasm] Diable Wasm IR tests on Windows TeamCity 2020-11-11 14:30:22 +03:00
Vyacheslav Gerasimov
3feff16a77 Cleanup 193 compatibility fixes 2020-11-11 14:28:54 +03:00
Vyacheslav Gerasimov
8620d26a8a Delete 193 bunch files 2020-11-11 14:28:53 +03:00
Alexander Gorshenev
ade46ef808 Update Kotlin/Native: 1.4.30-dev-17200 2020-11-11 14:27:45 +03:00
Sergey Igushkin
3666327c81 Fix JVM maven-publish caching by not capturing state in POM rewriting
In POM rewriting logic, ensure that non-serializable entities are
accessed from within project.provider { ... } and their evaluation
results are therefore properly serialized.

Issue #KT-43054 Fixed
2020-11-11 13:55:07 +03:00
Sam Wang
d1ba2f3d46 Restore KotlinExplicitMovementProvider in as41 and as42 2020-11-11 11:37:27 +01:00
Vladimir Dolzhenko
4f76c747ec Mark org.jetbrains.kotlin.mavenProjectImportHandler as dynamic 2020-11-11 10:29:16 +00:00
Vladimir Dolzhenko
b0f6b739d0 Declare missed org.jetbrains.kotlin.defaultErrorMessages EP 2020-11-11 10:29:16 +00:00
Vladimir Dolzhenko
51a1990e50 Drop missing gradle extensions from jvm-common.xml
Similar to 0cad41bb0c

Relates to ^KT-38518
2020-11-11 10:29:15 +00:00
Kirill Shmakov
0eea3a5e95 Bump AS version
To support newest Canary and fix module wizard issues.
^KT-43188 Fixed.
2020-11-11 12:10:36 +03:00
Mikhail Glukhikh
f2f00a4654 Fix BB test to work on JDK 6 2020-11-11 12:00:18 +03:00
Dmitriy Dolovov
078963eead Native, Gradle IT: Fix assertion message 2020-11-11 11:36:51 +03:00
Alexander Likhachev
fbd8de04b8 [Gradle, K/N] Configuration cache support for run with warns
#KT-42849 Fixed
2020-11-11 10:58:37 +03:00
Alexander Likhachev
2d2042ad12 [Gradle, K/N] Configuration cache support for compile & link with warns
#KT-43151 Fixed
2020-11-11 10:58:37 +03:00
Yaroslav Chernyshev
a3b951e505 [Gradle, Cocoapods] Refactor, log process outputs with info level
Also fixed broken `stdErr` processing for `xcodebuild` commands.

#KT-42938 Fixed
2020-11-11 10:47:11 +03:00
Dmitriy Novozhilov
67b262aa34 [FIR] Move tracking candidate applicability from CheckerSink to Candidate 2020-11-11 09:52:56 +03:00
Dmitriy Novozhilov
f1ac1f177b [FIR] Extract overload by lambda return type into separate component 2020-11-11 09:52:56 +03:00
Dmitriy Novozhilov
a97c107a2b [FIR] Replace callee reference before checking completion from inference session
This is needed because in some cases inference session checks candidate
  and candidates of all sub calls and for that it uses candidate from
  callee reference of call. So we should replace reference with specific
  candidate even if we didn't choose proper candidate yet

#KT-43129
2020-11-11 09:52:56 +03:00
Dmitriy Novozhilov
9f5aadd2f4 [FIR] Implement overload resolution by lambda return type
#KT-43129 Fixed
2020-11-11 09:52:55 +03:00
Dmitriy Novozhilov
025ec8e8b1 Add FQ_NAME postfix to OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION 2020-11-11 09:52:55 +03:00
Dmitriy Novozhilov
dfad21270f [FIR] Remove workaround for #KT-43129
Revert changes from 4612f26b and a936386e
2020-11-11 09:52:55 +03:00
Vyacheslav Gerasimov
1148d527ee Build: Upgradle gradle to 6.7 2020-11-11 02:39:23 +03:00
Kris
173954b3b3 Add samples for Random.nextX() functions 2020-11-11 01:37:37 +03:00
Kris
ebdd023633 Add samples for last() and lastOrNull() functions 2020-11-11 01:37:24 +03:00
Yan Zhulanow
e83a3c3f27 Parcelize: Use @Parcelize annotations from Android Extensions instead of the copied&deprecated ones (KT-42342, KT-43150)
Dex can't merge class files from both android-extensions-runtime and parcelize-runtime, so we have to keep only one copy of each class.
Instead of @Deprecated annotations, there are new diagnostics (without quick-fixes yet).
The goal is to allow simple usages (@Parcelize alone) but forbid kotlinx.android.synthetic.Parceler usage.
2020-11-11 04:25:07 +09:00
Ilmir Usmanov
fa42a6ba58 Use non-local return target instead of inline site in suspend function
return type coercion.
 #KT-43226 Fixed
2020-11-10 20:08:45 +01:00
Mikhail Glukhikh
d4f08018ce [FIR2IR] Extract special symbol provider to make JVM extension 2020-11-10 21:07:27 +03:00
Mikhail Glukhikh
bc47a30dd3 [FIR] Handle 'EnhancedNullability' more properly
This commit includes three changes:
1. 'EnhancedNullability' is no more set for declaration types
2. It is no more used for conversion types in translator
3. Translator inserts implicit not-null cast only when enhanced type is cast to not-null type.
2020-11-10 21:07:27 +03:00
Mikhail Glukhikh
e7a84fd1ee [FIR2IR] Preserve 'EnhancedNullability' type annotation in IR 2020-11-10 21:07:26 +03:00
Jinseong Jeon
f8dc56e2bb FIR render: fix typos on RenderMode 2020-11-10 21:07:26 +03:00
Mikhail Glukhikh
f8e03786c0 Mute not relevant JS/WASM back ends for new BB tests 2020-11-10 21:07:09 +03:00
Juan Chen
9486f58fb1 [FIR] fix subtyping for definitely notnull types.
The current implementation doesn't consider Foo a subtype of Captured<in
Foo>!!, since AbstractTypeCheckerContext::checkSubtypeForSpecialCases
does not handle DefinitelyNotNullType cases. This PR adds handling of
DefinitelyNotNullType by looking at its original type.

^KT-42824 Fixed
2020-11-10 21:07:09 +03:00
Juan Chen
eb804709da [FIR] fix subtyping for nullable captured types.
The issue is the type checker doesn't consider P? a subtype of
CapturedType<in P>?, whereas P a subtype of CapturedType<in P>?. In
AbstractTypeCheckerContext::checkSubtypeForSpecialCases, it checks if
P? is a subtype of the lower type of the captured type, which is
P, and returns false.

This fix uses nullable version of the lower type when the captured
type is marked nullable. To check if P? is a subtype of Captured<in
P>?, we check the LHS, P?, against the nullable lower type of RHS,
P?.

^KT-42825 Fixed
2020-11-10 21:07:09 +03:00
Alexander Udalov
d96223a2ff Fix compiler warnings in new wasm modules
Also don't output v8ExecutablePath in js.tests on each project
configuration.
2020-11-10 18:19:41 +01:00
Alexander Udalov
84d1393711 Minor, workaround compiler exception (KT-43286) 2020-11-10 18:06:17 +01:00
Sergey Shanshin
202459531d Add support of nullable serializers to UseSerializers annotation (#3898)
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/984
2020-11-10 19:42:02 +03:00
Ilya Gorbunov
66f5c98505 Deprecate createTempFile/createTempDir functions
Document their potential permission problems.
Suppress this deprecation in tests.
2020-11-10 18:25:48 +03:00
Georgy Bronnikov
31bfc7d4e3 Fix test data 2020-11-10 17:49:55 +03:00
Georgy Bronnikov
2c404a654b JVM_IR: avoid scope violation in BridgeLowering 2020-11-10 17:49:55 +03:00
Georgy Bronnikov
d246005891 JVM_IR: fix unbound type parameters in AddContinuationLowering 2020-11-10 17:49:55 +03:00
Georgy Bronnikov
9929047f5d JVM_IR: avoid scope violation in BridgeLowering 2020-11-10 17:49:55 +03:00
Dmitry Petrov
e10d8e51b6 JVM_IR more precise superclass stub filtering
Filter out abstract members of superclasses when generating collection
stubs.

KT-43207
2020-11-10 16:41:45 +03:00
Svyatoslav Kuzmich
7f26deb5e6 [Wasm] Enable for loops optimization 2020-11-10 16:09:22 +03:00
Denis Zharkov
233bb47b99 FIR: Fix SAM conversion for raw types with non-trivial TP upper bounds 2020-11-10 14:26:54 +03:00
Denis Zharkov
ce4a11144d FIR: Correctly handle nullable/flexible captured types 2020-11-10 14:26:54 +03:00
Denis Zharkov
ed07bbc734 FIR: Fix inner type resolution during body transformation 2020-11-10 14:26:54 +03:00
Denis Zharkov
a5545b96cb FIR: Fix ambiguity between current Companion and one from supertypes
Companion as qualifier should be found at static scope not a member one
2020-11-10 14:26:54 +03:00
sebastian.sellmair
96352b9c8c Add (and disable) metadata compilation for single backend source sets
KotlinProjectStructureMetadata is created by inspecting source sets
with metadata compilation. Single backend common source sets are
currently not supported for metadata compilation and therefore
did not register one. Foreseeing to support this case with KT-42468,
metadata compilation is now created and registered, but just disabled.
This change will include android variants in
KotlinProjectStructureMetadata even when not officially published.
With those variants, the IDE can infer visibility from some module's
"jvmAndAndroidMain" source set to another modules "jvmAndAndroidMain"

KotlinMetadataTargetConfigurator: rename getPublishedCommonSourceSets to getCommonSourceSetsForMetadataCompilation

KotlinMetadataTargetConfigurator: isMetadataCompilationSupported and add comment to getPublishedCommonSourceSets

Re-use androidPluginIds in KotlinPlugin

KotlinAndroidTarget: Create KotlinComponents for non-published variants and mark them with publishable=false

JvmAndAndroidIntermediateSourceSetTest: add KotlinProjectStructureMetadata jvmAndAndroidMain exists in jvm variants test

AbstractAndroidProjectHandler: Add java sources only in post processing

KotlinAndroidTarget: Inline creation of usageContexts

KotlinAndroidTarget.doCreateComponents: filter non-publishable variants when publishLibraryVariantsGroupedByFlavor is enabled

#KT-42383 fixed
2020-11-10 10:21:40 +00:00
Svyatoslav Kuzmich
03e63f1103 [Wasm] Enable maven-publish plugin in wasm stdlib 2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
ffe3487aa5 [Wasm] Don't generate unnecessary unreachable instructions
Helps with WAT readability
2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
b371b61cf5 [Wasm] Indent blocks of produced WAT
Makes it more readable
2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
4d59a58291 [Wasm] Add interop annotation @JsFun 2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
e51a76bc4e [Wasm] Basic CLI
-Xwasm option that will produce wasm instead of JS when used with -Xir-produce-js
Does not affect klib production
2020-11-10 13:08:04 +03:00
Vladimir Dolzhenko
80f316168e Updated IDE perf tests vega visualization to handle wide time ranges with aggregation 2020-11-10 10:58:17 +01:00
Kristoffer Andersen
297c33b452 [IR] Correct line number on suspend function with implicit unit return 2020-11-10 10:58:02 +01:00
Roman Artemev
c2fec38384 [JS IR BE] Unmute fixed tests 2020-11-10 11:06:11 +03:00
Roman Artemev
94acfa50bd [IR BE] Remap dispatch receiver for inner ctor too
- do not forget to add into mapping dispatch receiver
 - fix KT-40686 (at least part of it)
 - add test
2020-11-10 11:06:11 +03:00
Roman Artemev
1ced0138ff [JS IR BE] Drop redundant marker since function doesn't use descriptors anymore. 2020-11-10 11:06:11 +03:00
Dmitriy Novozhilov
e66daf90fd Advance bootstrap to 1.4.30-dev-2196 2020-11-10 11:02:48 +03:00
Dmitry Petrov
785466acee Minor: add '// JVM_TARGET: 1.8' 2020-11-10 06:48:07 +03:00
Alexander Udalov
106ee1d1ff JVM IR: restore ability to suppress codegen-reported diagnostics
In the old backend, BindingContextSuppressCache is used (which is now
created explicitly in GenerationState), which looks up `@Suppress`
annotations on elements right before reporting the diagnostic. In JVM
IR, we clear the binding context after psi2ir, so this approach doesn't
work. This change provides another implementation of KotlinSuppressCache
which eagerly precomputes all suppressions on all annotated elements in
all source files at the point of creation of GenerationState (when the
binding context is still full).

 #KT-43047 Fixed
2020-11-09 19:55:31 +01:00
Alexander Udalov
61548a0a36 Fix inspections and slightly "kotlinify" KotlinSuppressCache 2020-11-09 19:48:04 +01:00
Alexander Udalov
9d3c9a823d Improve rendering of failures in AbstractWriteFlagsTest
When expected and actual flag values are not equal, transform them to
presentable strings according to `Opcodes.ACC_*` field values.
2020-11-09 19:47:54 +01:00
Alexander Udalov
0e91d3fcb0 JVM IR: generate ACC_SYNTHETIC for deprecated-hidden declarations correctly
Extract the logic that computes ACC_SYNTHETIC flag for deprecated
declarations, and use `DeprecationResolver` as the old backend does in
`DescriptorAsmUtil.getCommonCallableFlags`. Creating IR-based
descriptors for each function to pass it there is a bit costly though,
so as a small optimization, use `allOverridden` to check if anything in
the method hierarchy is deprecated.

Also optimize `allOverridden` for the case of linear inheritance which
is far more common.

 #KT-43199 Fixed
2020-11-09 19:47:54 +01:00
Alexander Udalov
d9efc2d922 Fix warnings in compiler code and tests 2020-11-09 19:46:10 +01:00
Roman Golyshev
ebfbc2f601 KT-43205 Ignore annotations in CallableClsStubBuilder when needed
Kotlin compiler can add `@Deprecated` annotations to the fields of
private companion objects, and if those annotations are not supposed to
be shown in decompiled code and used, the field is marked with
`HAS_ANNOTATIONS=false` flag (see KT-25009)

However, it was not taken into account in stubs building process, which
led to the 'Stubs vs PSI mismatch' exceptions

^KT-43205 Fixed

Also, restore the order of nested typealiases and classes (see KT-41859)

We didn't want to bump the version of the stubs when we fixed this
issue; now we have an opportunity to restore the order back to
match the `MemberComparator`

Also, some refactoring is done to underscore that
`createPackageDeclarationsStubs` is suitable only for packages, not
for any declarations container
2020-11-09 15:49:50 +00:00
Svyatoslav Kuzmich
fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00
Svyatoslav Kuzmich
02a84fa6e1 [Wasm] Remove wasmBox tests
They are be covered by common codegen box tests.
2020-11-09 16:04:43 +03:00
Svyatoslav Kuzmich
bfd0f21e9d [Wasm] Major compiler and stdlib update 2020-11-09 16:04:43 +03:00
Svyatoslav Kuzmich
3be38d1796 [Wasm] Add Wasm IR
Intended to be used by Kotlin/Wasm compiler.

Includes:
 * IR tree: declarations, instructions, types.
 * Convertors: ir2text, ir2bin, bin2ir
 * Spec tests, to test convertors against reference Wabt tool
2020-11-09 16:04:42 +03:00
Svyatoslav Kuzmich
65cf991e84 [JS IR] Move JS-specific isInlineClass utils from common to JS compiler module 2020-11-09 16:04:42 +03:00
Vladimir Dolzhenko
e101e6762c Add uploading IDE performance benchmarks to ES 2020-11-09 14:03:58 +01:00
Alexander Gorshenev
ff7c38b2df Unmuted a test 2020-11-09 16:02:15 +03:00
Alexander Gorshenev
eea5a9102c Bump klib abi version to 1.4.2 to reflect absence of serialized fake overrides 2020-11-09 16:02:14 +03:00
Alexander Gorshenev
cb288d47ea Don't serialize fake overrides anymore 2020-11-09 16:02:14 +03:00
Alexander Gorshenev
5de7a10df0 Eliminated -Xdeserialize-fake-overrides 2020-11-09 16:02:14 +03:00
Dmitry Petrov
b9c6267a63 KT-43217 Encode @EnhancedNullability types in IdSignature 2020-11-09 15:20:46 +03:00
Stanislav Erokhin
f6df624c6b KT-43202 Fix isEap function: support RC version
Since 1.4.20 we changed rc suffix to RC.
Old variant (rc) kept just in case
#KT-43202 Fixed
2020-11-09 10:52:50 +03:00
Igor Chevdar
5e0f54a30b [IR] Fixed https://youtrack.jetbrains.com/issue/KT-43159 2020-11-09 11:37:37 +05:00
Pavel Kirpichenkov
0e8cf58a35 Minor: reformat 2020-11-08 15:33:30 +03:00
Pavel Kirpichenkov
b79b94fe75 [MPP] Allow smart casts for properties from dependsOn modules
Smartcasts for public properties from different module are not
stable because module declaring a property in general can be
compiled separately from the module using it. However, if client
module has dependsOn relation with declaring module their simultaneous
compilation is guaranteed which makes this smart cast safe.

Cache all transitive 'expected by' modules in module dependencies.
Extend test to check smart casts are allowed for properties from transitive
'expected by' dependencies and prohibited otherwise.

^KT-42754 Fixed
2020-11-08 15:33:30 +03:00
Pavel Kirpichenkov
778bbd76cb [MPP] Add test for KT-42754 2020-11-08 15:33:30 +03:00
Dmitriy Dolovov
9f0cec3443 Native, Gradle IT: Add verbosity to IT 2020-11-07 11:38:07 +03:00
Alexander Udalov
9adc1a6e9b JVM IR: generate 'main' wrappers as non-final
To replicate bytecode generated by the old backend, and thus simplify
ABI comparison.
2020-11-06 19:27:53 +01:00
Alexander Udalov
791be7c2dc JVM IR: improve ABI of properties in multifile facades
When copying top level declarations from multifile parts to facades,
also copy corresponding properties. This allows to keep their
annotations, which are later used in codegen (for example, to generate
ACC_DEPRECATED on property accessors), and allows to get rid of the hack
where the JVM name of the property accessor was computed prematurely via
methodSignatureMapper.

Also, don't copy `$annotations` methods for non-const properties to
facades because the old backend only generates them in parts (which
might be a separate problem, see KT-27644).

 #KT-40262 Fixed
2020-11-06 19:27:53 +01:00
Alexander Udalov
55974b4eda JVM IR: do not generate InlineOnly property accessors in multifile facade
#KT-37007 Fixed
2020-11-06 19:27:53 +01:00
Alexander Udalov
500b1cfbd3 JVM IR: fix flags of $default methods in multi-file facades
Do not change origin of multifile class bridges to something else
because, as it turns out, there are numerous origin-specific checks in
the codegen that start to behave differently for multifile bridges.
Instead of the method-targeted origin MULTIFILE_BRIDGE, use new class
origin JVM_MULTIFILE_CLASS to detect whether a declaration is a
multifile bridge.

 #KT-40198 Fixed
 #KT-43145 Fixed
2020-11-06 19:27:52 +01:00
Alexander Udalov
d326d6a693 Specify module name via moduleName option instead of freeCompilerArgs
This allows to get rid of warnings about duplicate module name in some
of the modules.
2020-11-06 19:27:32 +01:00
Alexander Udalov
bdb8a58b3b JVM IR: merge JvmBackendFacade into JvmIrCodegenFactory 2020-11-06 19:27:08 +01:00
Alexander Udalov
5c2c2591a1 Minor, rename file to keep git history 2020-11-06 19:27:07 +01:00
Alexander Udalov
624204c7b4 JVM IR: remove outdated code in JvmIrCodegenFactory 2020-11-06 19:27:07 +01:00
Alexander Udalov
b2d49e9615 Minor, fix whitespace in toString 2020-11-06 19:26:49 +01:00
Alexander Udalov
c1a292b01b Psi2ir: improve exception stack traces
- Do not wrap exceptions resulting from generating error expressions
  multiple times, as that could lead to stack traces where the identical
  code is wrapped many times and is printed in the exception message on
  each step, which was difficult to read
- Add element location (file name, line number & position) to the
  message, similarly to exceptions from codegen, when catching and
  rethrowing exceptions at the top level
2020-11-06 19:26:48 +01:00
Dmitriy Dolovov
3cb202f576 Gradle IT: Fix Gradle output checks in Kotlin/Native ITs 2020-11-06 19:24:31 +03:00
Alexander Likhachev
e3db96354d Add javadoc and sources artifacts to kotlin-gradle-build-metrics module
#KTI-382 Fixed
2020-11-06 16:23:32 +03:00
Alexander Gorshenev
5f2a963006 Better wording and comments for klib compatibility code 2020-11-06 16:19:43 +03:00
Alexander Gorshenev
891a4c4621 Dropped outdated klib version compatibility mechanisms 2020-11-06 16:19:43 +03:00
Alexander Gorshenev
8b2b36d61f Enabled klib abi version compatibility 2020-11-06 16:19:42 +03:00
Denis Zharkov
e434a1c892 FIR: Drop unused AbstractFirOverrideScope::create*Copy 2020-11-06 14:44:29 +03:00
Denis Zharkov
2e4c41c0d8 FIR: Drop PossiblyFirFakeOverrideSymbol 2020-11-06 14:44:28 +03:00
Denis Zharkov
7b48625b58 FIR: Remove FirCallableSymbol::overriddenSymbol 2020-11-06 14:44:27 +03:00
Denis Zharkov
78b374ec88 FIR: Do not set overriddenSymbol for KFunction::invoke
It has been probably set by mistake since overriddenSymbol is only used for
fake overrides
2020-11-06 11:32:39 +03:00
Denis Zharkov
a11b488c82 FIR: Add workaround for combination of intersection + delegated members
See org.jetbrains.kotlin.fir.Fir2IrTextTestGenerated.FirProblems#testDelegationAndInheritanceFromJava
2020-11-06 11:32:39 +03:00
Denis Zharkov
41f878e104 FIR: Adjust test data for type alias constructors
They are not SubstitutionOverrides anymore
2020-11-06 11:32:39 +03:00
Denis Zharkov
96c3436e73 FIR: Temporary adjust diagnostics test data
UPPER_BOUND_VIOLATED for type alias constructors is not supported properly
See KT-43142
2020-11-06 11:32:39 +03:00
Denis Zharkov
d58e66e79a FIR: Merge both synthetic type alias constructor kinds 2020-11-06 11:32:39 +03:00
Denis Zharkov
f9aab77ce5 FIR: Simplify ConstructorProcessing relevant to type aliases 2020-11-06 11:32:39 +03:00
Denis Zharkov
8a949b0dcf FIR: Use attribute instead of overriddenSymbol for synthetic type alias constructor 2020-11-06 11:32:39 +03:00
Denis Zharkov
4282e27d73 FIR: Get rid of usages of FirCallableSymbol::overriddenSymbol 2020-11-06 11:32:39 +03:00
Denis Zharkov
728c2a808f FIR: Do not propagate overriddenSymbol at FirObjectImportedCallableScope 2020-11-06 11:32:39 +03:00
Denis Zharkov
037ba4d973 FIR: Simplify VariableStorage::isStable 2020-11-06 11:32:39 +03:00
Denis Zharkov
317d981472 FIR: Do not use overriddenSymbol for imported from object 2020-11-06 11:32:39 +03:00
Denis Zharkov
65119adb6a FIR: Adjust test data. FakeOverride -> SubssitutionOverride 2020-11-06 11:32:39 +03:00
Denis Zharkov
3e37995004 FIR: Get rid of FirCallableSymbol::isFakeOverride and isIntersectionOverride 2020-11-06 11:32:39 +03:00
Alexey Tsvetkov
36387d97ad Add IC metrics reporting 2020-11-05 23:26:46 +03:00
Alexey Tsvetkov
5bde6457b1 Metrics reporting utils 2020-11-05 23:26:46 +03:00
Alexey Tsvetkov
97a09680d5 Remove CompositeICReporterAsync 2020-11-05 23:26:42 +03:00
Zalim Bashorov
2c1e4c1769 [IR] Use more specific type (IrSimpleFunction) for accessors in IrLocalDelegatedProperty 2020-11-05 22:25:05 +03:00
Sergey Igushkin
11bc1c0753 Revert "Fix configuration cache issue in AbstractKotlinTarget" 2020-11-05 21:02:47 +03:00
Roman Artemev
8ca9e792e9 [KLIB] Make sure that referenced local anonymous class is deserialzied.
In case if such class is used an type argument for field type make sure
that field initializer is being read.

Check type recursively.

- fix KT-41143
- update test
2020-11-05 20:28:11 +03:00
Dmitriy Dolovov
0dd329d3d4 Gradle IT: Intercept and log Gradle process output on import failures 2020-11-05 18:51:16 +03:00
Dmitriy Dolovov
4de1bf8d35 Gradle IT: Move GradleProcessOutputInterceptor to the test framework
This is necessary to make GradleProcessOutputInterceptor available for
other tests, e.g. Gradle IT.
2020-11-05 18:51:08 +03:00
Dmitriy Dolovov
fae3ba35e9 Gradle, Native: More verbose logging in KotlinToolRunner
Especially for tools executed in a separate JVM process:
JVM options, Java system properties, custom ENV variables.
2020-11-05 18:51:02 +03:00
Dmitriy Dolovov
734dff6282 [Commonizer] Use compact variants of collections to reduce memory footprint 2020-11-05 18:50:56 +03:00
Dmitriy Dolovov
30bf7b87fe Minor. Code formatted 2020-11-05 18:50:50 +03:00
Dmitriy Dolovov
f5bb60f7cd [Commonizer] Refactor CIR type representation
1. Drop CirClassifierId
2. Specialized classes for each kind of types (classes, TAs, type parameters, flexible types).
3. TypeCommonizer now returns commonized type. In case of TAs this could be a completely new type
   describing expect class or a new TA with the different underlying type.
2020-11-05 18:50:43 +03:00
Dmitriy Dolovov
2764550bbe [Commonizer] Relax conditions for TA lifting-up
Allow lifting up matching TAs with non-empty list of type parameters
and non-empty list of type arguments in the expanded type.
2020-11-05 18:50:37 +03:00
Dmitriy Dolovov
cb2e94df16 [Commonizer] Minor. Convert approximation keys back to data classes 2020-11-05 18:50:31 +03:00
nataliya.valtman
45ce0c6c11 avoid failing KotlinGradleIT.testInternalTest for Windows agent 2020-11-05 13:43:02 +03:00
Sergey Igushkin
c839282f9b Merge pull request #3878 from google/prr/hungnv/KT-43054-configurationCacheIssue
Fix configuration cache issue in AbstractKotlinTarget
2020-11-05 13:26:40 +03:00
Victor Petukhov
90ea64a0e5 Don't report warning about changing execution order for varargs if it's inside an annotation
^KT-43110 Fixed
2020-11-05 13:18:00 +03:00
Victor Petukhov
f052bc341c Don't report warning about implicitly inferred Nothing for call arguments if there is non-Nothing return type
^KT-43108 Fixed
2020-11-05 13:17:59 +03:00
Andrei Klunnyi
7859287337 [KT-40688] Inlay Hints: lambda hints removal on editing
Due to the platform API limitation lambda related hints are treated
separately to all others. Hints removal on editing is not an exclusion
and is now supported as well.
2020-11-05 10:10:19 +00:00
Jinseong Jeon
b3b09ea9b7 FIR: adjust spec testData after DFA changes:
* recording type statements for null assignments
* element-wise join by default
2020-11-04 16:35:42 +03:00
Jinseong Jeon
a5389b067b FIR DFA: use element-wise join everywhere 2020-11-04 16:35:42 +03:00
Jinseong Jeon
771c839d74 FIR DFA: element-wise join at merging points of try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon
bd173ebebc FIR DFA: isolate effects between blocks in try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon
1f1e1828a7 FIR CFG: reconfigure exception throwing paths in try expression 2020-11-04 16:35:42 +03:00
Jinseong Jeon
146036010c FIR DFA: add tests about smartcasts in/after try-catch-finally 2020-11-04 16:35:42 +03:00
Mads Ager
2c8c47399a [JVM_IR] Enable KotlinAgainstJava and remaining JavaAgainstKotlin test. 2020-11-04 14:16:37 +01:00
Yunir Salimzyanov
24345bb6b3 Prevent NPE while fetching muted tests from Teamcity server 2020-11-04 16:14:01 +03:00
MikeKulasinski-visa
bc2b396ecd kotlin.native.cocoapods.targets can be a custom list of architectures (#3861)
Co-authored-by: Mike Kulasinski <mike.kulasinski@payworks.com>
Co-authored-by: Ilya Matveev <ilya.matveev@jetbrains.com>
2020-11-04 18:21:12 +07:00
Mads Ager
0279068214 [JVM_IR] Follow old backend in bridge visibility and varargs marking.
The old backend makes bridges for protected and package-private
methods public. Also, for bridges for vararg methods, the vararg
marker is not on the bridge.

These differences seem minor but are visible via reflection, so
we might as well follow the old backend.
2020-11-04 12:03:06 +01:00
Ilmir Usmanov
326768e8b5 Minor. Update test data 2020-11-04 00:20:39 +01:00
Steven Schäfer
bd4e2a283c JVM IR: Don't generate null checks on value parameters of private operator functions
The null check on the extension receiver of private operator functions
is a special case and doesn't extend to value parameters.
2020-11-03 21:44:25 +01:00
Steven Schäfer
d4cb521433 JVM IR: Fix names for SAM callable references with inline class return types
This fixes the ABI issues in KT-42879.
2020-11-03 18:33:34 +01:00
Denis Zharkov
aa81041415 FIR: Fix DiagnosticsTestGenerated when FIR starts requesting light classes
Became necessary after fixing loading Java annotation from deserialization
2020-11-03 18:30:15 +03:00
Denis Zharkov
a936386e53 FIR: Add more complicated workaround for OverloadResolutionByLambdaReturnType
That helps for minOfOrNull/maxOfOrNull
2020-11-03 18:30:15 +03:00
Denis Zharkov
4612f26bfb FIR: Add workaround for OverloadResolutionByLambdaReturnType
Mostly, that should help for existing flatMap usages

^KT-43129 Submitted
2020-11-03 18:30:15 +03:00
Denis Zharkov
07ed89b02b Move OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION to compiler.common
So, it could be used in FIR
2020-11-03 18:30:15 +03:00
Denis Zharkov
a444618c27 FIR: Correctly handle Java annotations from deserialization
To obtain enhanced declarations, we should use type scope
2020-11-03 18:30:15 +03:00
Alexander Udalov
f2b0d057b9 JVM IR: minor optimizations in IrTypeMapper.classInternalName
Replace cubic complexity with square when computing internal name for
nested classes by using StringBuilder instead of concatenating strings,
and don't do getLocalClassType/classNameOverride checks on each step of
the recursion.
2020-11-03 15:40:16 +01:00
Alexander Udalov
b3e79d36df Fix compiler warnings and some inspections 2020-11-03 14:00:53 +01:00
Alexander Udalov
e5d5c20473 Minor, suppress deprecation warnings in parcelize plugin 2020-11-03 14:00:53 +01:00
LepilkinaElena
ee8db2f760 Escape resolving same library several times in K/N (#3880) 2020-11-03 15:57:48 +03:00
Ilmir Usmanov
1376fed1d4 Support non-public inline class constructors
#KT-28056 Fixed
2020-11-03 12:10:21 +01:00
Bingran
88bbeea7f6 Fix deprecated gradle api usage in artifact transform
Previously, when adding --warning-mode=fail to KaptIncrementalIT,
it would fail when testing with advance gradle version because
deprecated configurations in build files of test projects and
gradle api usage in artifact transform.

With this PR, we have two "StructureTransformAction'. The one with
latest gradle api is for use at most cases, the legacy one is for use
when gradle version is less or equal than 5.3 because the new gradle api
is introduced in 5.4.

This change also adds some test fixtures and updates deprecated
configurations to support testing artifact transform.

Test: KaptIncrementalIT
2020-11-03 13:50:16 +03:00
Igor Chevdar
94145f880c [IR] Inliner: supported recursion in default arguments 2020-11-03 11:39:00 +05:00
Ilmir Usmanov
5f8fabed61 Minor. Update test data 2020-11-03 02:20:44 +01:00
Ilya Chernikov
497b7ee266 [minor] fix accidental addition of FirScriptCodegenTestGenerated 2020-11-02 20:35:07 +01:00
Mark Punzalan
89836a2c9a Minor, test-data-only: Remove unused "IGNORE_BACKEND_FIR" directives in
asmLike test-data.
2020-11-02 19:37:14 +01:00
Alexander Udalov
c02e92a5e0 JVM IR: minor, use createJvmIrBuilder to simplify code 2020-11-02 19:33:24 +01:00
Alexander Udalov
dd33ed9297 Fix suspend function with inline class types in reflection
#KT-34024 Fixed
2020-11-02 19:33:23 +01:00
Alexander Likhachev
56f7e34e3e [Gradle, K/N] Revert change of AbstractKotlinNativeCompile supertype
It was changed in order to support build cache for K/N tasks but as we doesn't support cache for CInteropProcess task at the moment, there is no overlapping outputs issue
#KT-43080 Fixed
2020-11-02 20:42:46 +03:00
Vladimir Dolzhenko
369b1ef5df Fix compilation in perfTests 2020-11-02 16:44:04 +01:00
Vladimir Dolzhenko
2bffce2259 Revert Open build tool window on Gradle DSL errors
Proper fix is (to handle any exceptions within ProjectModelContributor EPs) is done in a platform

^EA-236697 Fixed
2020-11-02 15:29:54 +01:00
Vladimir Dolzhenko
1a57794e82 Clean ups in IDE performance tests output 2020-11-02 15:09:30 +01:00
Mads Ager
617279310e [JVM_IR] Rebase inline function and defaults args stepping test. 2020-11-02 13:14:12 +01:00
Ilmir Usmanov
7b315a8b52 JVM_IR: Do not box inline class in methods 2020-11-02 10:50:00 +01:00
Mikhael Bogdanov
e20093d762 Support @JvmStatic and @JvmOverload in annotation companion 2020-11-02 08:27:49 +01:00
Mikhael Bogdanov
7ec2d036ae Don't generate final modifier on static interface methods produced by @JvmStatic+@JvmOverloads from interface companion
#KT-35716 Fixed
2020-11-02 08:27:49 +01:00
Vladimir Dolzhenko
7d0e9654bd Clean ups in IDE performance tests output 2020-11-01 14:29:15 +01:00
Vladimir Dolzhenko
d36511c094 Clean ups in IDE performance tests output 2020-10-31 23:36:35 +01:00
Ilya Kirillov
5fae769a90 Wizard: use new compose icon
#KT-43033
2020-10-31 16:57:07 +03:00
Ilya Kirillov
8eefcbb1d4 Wizard: update compose templates
#KT-43032 fixed
2020-10-31 16:57:05 +03:00
Ilya Kirillov
21928d8f51 Wizard: do not allow creating compose projects with gradle groovy
#KT-42983 fixed
2020-10-31 16:57:05 +03:00
Vladimir Dolzhenko
4f6fa1059c Add missed task dependency for IDE performance tests output 2020-10-31 14:55:58 +01:00
Vladimir Dolzhenko
ceea57ab58 Add missed task dependency for IDE performance tests output 2020-10-31 12:17:04 +01:00
Vladimir Dolzhenko
3c0d43dc0d Rebuild IDE performance tests output
format changes: added warmUp tag, index, benchmark format version
perform post processing: geom mean calc, extract warm-up benchmark
2020-10-30 21:30:02 +01:00
Alexander Udalov
f87e46b599 Kx-serialization: generate wrapper type for reference array serializer 2020-10-30 17:47:29 +01:00
Alexander Udalov
42aef01d79 Kx-serialization: support SerialInfo annotations from dependencies in JVM IR
Also handle call sites correctly, by generating an instance of the Impl
class instead of trying to create the annotation.

 #KT-42976 Fixed
2020-10-30 17:47:29 +01:00
Alexander Udalov
51ded98c4b Kx-serialization: support SerialInfo for JVM IR
No tests added because this is going to be checked by the upcoming build
of kotlinx-serialization runtime with JVM IR.

 #KT-42976 In Progress
2020-10-30 17:45:25 +01:00
Dmitry Petrov
e4ba787034 JVM_IR KT-43066 Generate 'clone' in class implementing kotlin.Cloneable 2020-10-30 19:03:31 +03:00
Mikhail Glukhikh
7b4f781ea8 [FIR] Split primary constructor parameter scope into two different
In init block or property initializers,
for `val x` declared in primary constructor,
`x` reference is now resolved to property, not to parameter.
So we need two different scopes for primary constructor,
one for 'pure' parameters and another one for all parameters,
including val/var ones.

#KT-42844 Fixed
2020-10-30 18:44:55 +03:00
Shagen Ogandzhanian
2d0535a713 [JS_IR] Invoke companion init block while instantiating a class
KT-40740, squashed rr/shagen/KT-40740-static-init-js-ir
2020-10-30 16:19:13 +01:00
Hung Nguyen
6d29bb5814 Fix configuration cache issue in AbstractKotlinTarget
AbstractKotlinTarget#buildAdhocComponentsFromKotlinVariants passes a
non-serializable local object to a lambda, which will fail during
serialization when configuration caching is enabled.

To fix that, this commit passes only the relevant parts of the object
to the lambda.

Bug: https://youtrack.jetbrains.com/issue/KT-43054
Test: Manually verified on
      https://android.googlesource.com/platform/tools/metalava/+/refs/heads/master/
      where the issue was detected (I haven't been able to create a mininal
      reproducible project)
2020-10-30 13:44:49 +00:00
Ilya Chernikov
22117604f6 Move script simple type remapper to the common utilities 2020-10-30 12:57:43 +01:00
Ilya Chernikov
de340e9bc8 Implement support for synthetic script params in IR:
implicit receivers and provided properties
also support script imports
2020-10-30 12:57:43 +01:00
Ilya Chernikov
7572b50385 Expose script parameters from descriptor explicitly...
and universally as ValueParameterDescriptors;
update implementation accordingly
2020-10-30 12:57:43 +01:00
Ilya Chernikov
4cb0437145 [minor] fix reflection usage in scripting tests 2020-10-30 12:57:43 +01:00
Ilya Chernikov
94f2813a8a Add script main function generation to JVM IR backend 2020-10-30 12:57:42 +01:00
Ilya Chernikov
62b9d87bfc [minor] scripting tests improvements 2020-10-30 12:57:42 +01:00
Ilya Chernikov
af7102a586 Enable IR backend in script compiler 2020-10-30 12:57:42 +01:00
Ilya Chernikov
60246f2261 Ignore temporarily the kt22029.kts codegen test for JVM IR:
since it fails and I cannot fix it right now.
2020-10-30 12:57:42 +01:00
Ilya Chernikov
d7112a4500 Implement JVM IR support for scripts 2020-10-30 12:57:42 +01:00
Ilya Chernikov
01d73ba0fc Make IrScript a statement container first, update JS support
The IrScript is now the IrStatementContainer with significant
statements order, and the code is adapted accordingly
2020-10-30 12:57:42 +01:00
Andrei Klunnyi
55048f40ab Disable "Incomplete destructuring declaration"
^KT-43037 fixed
2020-10-30 09:33:18 +01:00
Dominik Wuttke
3acb468d48 Add a link to scope functions overview for takeIf and takeUnless
Co-authored-by: Dominik Wuttke <Dominik.wu@gmx.net>
2020-10-30 04:09:50 +03:00
Uzi Landsmann
f48f7c6dca Added samples for the kotlin.system package (measureTime* functions)
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com>
2020-10-30 03:35:15 +03:00
Uzi Landsmann
15381c4662 Added samples for the kotlin.streams package
Co-authored-by: Uzi Landsmann <uzi.landsmann@bisnode.com>
2020-10-30 02:23:31 +03:00
Yuya Urano
18672c99ca KT-20357: Add a sample for requireNotNull 2020-10-30 02:15:48 +03:00
Ciaran Treanor
2b03c10941 Correct small grammatical error in KDocs
Updated KDoc generator template to address all instances of
a grammatical error ("less" -> "fewer").
Also committed newly generate _Collections.kt, _Sequences.kt,
and _Strings.kt.
2020-10-30 01:47:06 +03:00
Ilmir Usmanov
28e148d35a Old JVM: support init blocks in inline classes
#KT-28055 Fixed
2020-10-29 20:38:03 +01:00
Ilmir Usmanov
999604541e JVM_IR: Support init blocks in inline classes
Put their content to constructor-impl, so they are called during
constructor call, but they are not called during boxing, because
box-impl calls <init> and not constructor-impl.

 #KT-28055 In progress
2020-10-29 20:38:01 +01:00
Mikhael Bogdanov
5804f73ebd JVM_IR. Deprecate public access to @JvmField/const fields in private companions
#KT-25009
2020-10-29 17:19:49 +01:00
Mikhael Bogdanov
57c9afc73a Deprecate public access to @JvmField/const fields in private companions
#KT-25009
2020-10-29 17:19:49 +01:00
Alexander Udalov
8be23df668 Remove unneeded dependency of util on deserialization & reflect
This is probably a result of a somewhat incorrectly merged
6c37574fce.
2020-10-29 17:03:11 +01:00
Alexander Udalov
0d1bb9acaf JVM IR: do not clear BindingContext in bytecode tool window 2020-10-29 17:02:58 +01:00
Dmitry Petrov
08b761ae7a PSI2IR don't copy annotations for properties implemented by delegation
KT-43012
2020-10-29 16:23:02 +03:00
Sergey Igushkin
53004f97b1 Store processed metadata artifacts in .gradle/ rather than build/
This allows the files to survive Gradle's `clean` task that deletes the
`build/` directory with all its contents, which leads to the IDE losing
dependencies until next re-import.

The `.gradle` directory is chosen because Gradle creates it in every
project and it is normally included in .gitignore (or otherwise ignored
in VCS).

Related to issue #KT-39568
2020-10-29 15:59:23 +03:00
Mads Ager
dca1f4631c [JVM_IR] Use line number 1 for multifile bridge methods.
This is necessary for the intellij debugger filters to hide
these bridges.

Fixes KT-41961.
2020-10-29 13:04:08 +01:00
Alexander Dudinsky
c8a8410fc5 Fix MultiModuleLineMarkerTest on Windows 2020-10-28 22:35:43 +03:00
Anton Yalyshev
d4d93b7091 Add change-notes for 1.4.20 2020-10-28 21:57:05 +03:00
Alexander Udalov
ad5b6da273 JVM IR: substitute generic type for inline class replacement function calls
The main change here is in `JvmInlineClassLowering.visitFunctionAccess`,
where we now store the substituted return type of the function as the
type of the call expression. Without it, the call could have a
meaningless type, e.g. some `T` which is inaccessible at that place, and
that could backfire in subsequent lowerings in codegen. For example, in
the `stringPlus.kt` test, it would prevent the code in
`FlattenStringConcatenationLowering.isStringPlusCall` from recognizing
and replacing the `String.plus` call, leading to a codegen exception.

Other changes are mostly cosmetics to make the code similar to
`visitFunctionReference`, and preventive optimizations for the case when
the substitution map is empty.
2020-10-28 16:46:28 +01:00
Mikhail Glukhikh
4a3a2ef72a [FIR2IR] Test data fix after rebase (regular + delegated supertype) 2020-10-28 18:09:13 +03:00
Mikhail Glukhikh
60141ccbaa [FIR] Fix Substitution scope key to avoid accidental matches 2020-10-28 18:09:12 +03:00
Mikhail Glukhikh
2dc6467b5d [FIR] Modify signatures also from ERASED_COLLECTION_PARAMETER_SIGNATURES
In this commit we change value parameter type of containsAll, removeAll,
retainAll from Java collections. Originally it's Collection<?>,
we change it to Collection<T>

#KT-42340 Fixed
2020-10-28 18:09:11 +03:00
Jake Wharton
3a693e112b Update ExperimentalPathApi annotation's SinceKotlin value to 1.4 2020-10-28 16:55:57 +03:00
Roman Golyshev
82984089f0 KT-42274 Update SOURCE_STUB_VERSION
This update should have been done in
4b7d34b537 commit, as it is stated in the
`KtTokens.MODIFIER_KEYWORDS_ARRAY` docs.

Shifting all modifiers by one have led resulted in incorrect modifiers
when stubs were read from the disk. Updating `SOURCE_STUB_VERSION` will
make IDEA recreate all stubs from scratch

^KT-42274 Fixed
2020-10-28 12:57:53 +00:00
Mikhail Glukhikh
80108444ec FIR2IR: cleanup implicit cast inserter 2020-10-28 15:44:46 +03:00
Jinseong Jeon
2424f2438c FIR2IR: towards comprehensive visits in implicit cast inserter 2020-10-28 15:44:45 +03:00
Jinseong Jeon
5f6d2c5362 FIR2IR: utilize argument conversions 2020-10-28 15:44:44 +03:00
Jinseong Jeon
f1fd3d6b5d FIR2IR: avoid using constant -1 2020-10-28 15:44:42 +03:00
Jinseong Jeon
707e94bab5 FIR2IR: add test about coercion-to-Unit for nested when 2020-10-28 15:44:41 +03:00
Jinseong Jeon
318f4b5f02 FIR2IR: refactor implicit cast insertion, part 3: implicit not_null 2020-10-28 15:44:40 +03:00
Jinseong Jeon
8708bdec0d FIR2IR: refactor implicit cast insertion, part 2: coerce-to-Unit 2020-10-28 15:44:39 +03:00
Jinseong Jeon
8f8ee88957 FIR2IR: refactor implicit cast insertion, part 1: implicit cast 2020-10-28 15:44:38 +03:00
Jinseong Jeon
e9a7b64ca0 FIR2IR: use AnnotationGenerator to convert file annotations 2020-10-28 15:44:37 +03:00
Mikhail Glukhikh
ef6b643b9c [FIR2IR] Don't set WHILE_LOOP origin for blocks 2020-10-28 15:44:36 +03:00
Yan Zhulanow
eb9b5da82b Kapt: Never mark static methods 'default' (KT-42915) 2020-10-28 21:03:26 +09:00
Toshiaki Kameyama
09e1bed5c9 Redundant 'inner' modifier: fix false positive/negative with constructor call
#KT-40879 Fixed
#KT-41223 Fixed
#KT-41311 Fixed
#KT-41680 Fixed
2020-10-28 18:16:57 +07:00
nataliya.valtman
e9669bf5cb fix unstable IncrementalFileToPathConverterTest tests 2020-10-28 12:33:03 +03:00
Denis Zharkov
2589de6c49 FIR: Refine delegated members introduced to use-site scope
- Do not add hashCode/equals/toString
- Do not add privates and ones that are already declared
2020-10-28 11:43:25 +03:00
Denis Zharkov
2105a041a5 FIR: Optimize usages of containingClass and its implementation 2020-10-28 11:43:25 +03:00
Denis Zharkov
923bb3b674 FIR2IR: Mute failing bb test
^KT-42946 Open
2020-10-28 11:43:25 +03:00
Denis Zharkov
2bdb21793f FIR: Adjust test data 2020-10-28 11:43:25 +03:00
Denis Zharkov
b6a312483a FIR: Fix fir2symbol inconsistencies for imported properties
Do not copy delegateFieldSymbol because otherwise the old symbol will be rebound
to the new instance of a property
2020-10-28 11:43:25 +03:00
Denis Zharkov
09b7237ae5 FIR: Introduce importedFromObjectClassId 2020-10-28 11:43:25 +03:00
Denis Zharkov
4d9ef4d414 FIR: Get rid of CallableId::classId usages
Use dispatchReceiverType or containingClassAttr instead
2020-10-28 11:43:25 +03:00
Denis Zharkov
9996c983c9 FIR: Initialize dispatchReceiverType and containingClassAttr for callable members 2020-10-28 11:43:25 +03:00
Denis Zharkov
ecb89a66be FIR: Copy attributes when copying declaration
Otherwise they share FirDeclarationAttributes instance that might lead
to problems when modifying only one of them
2020-10-28 11:43:25 +03:00
Denis Zharkov
52c6aebec2 FIR: Use copy-builders at FirObjectImportedCallableScope 2020-10-28 11:43:25 +03:00
Denis Zharkov
995b1aa1eb FIR: Add FirCallableMemberDeclaration::dispatchReceiverType 2020-10-28 11:43:25 +03:00
Ilya Gorbunov
0fa2cc15de Cleanup more test files and directories after tests
#KT-19192
2020-10-28 07:36:22 +03:00
Ilya Gorbunov
fe098ec821 Revise functions in PathReadWrite
- Adjust implementations to avoid excessive vararg copies
- Remove options from forEachLine, it doesn't make much sense and
isn't consistent with the other read* functions.
- Revise inlineness of functions in PathReadWrite
- Compact implementations of those that are remained inline.
- Clarify docs of functions for reading the entire file

#KT-19192
2020-10-28 07:36:19 +03:00
Ilya Gorbunov
a43cc0d1f9 Implement additional Path extensions
#KT-19192
2020-10-28 07:36:16 +03:00
Ilya Gorbunov
038f1cbd1e Add glob filtering when listing directory entries
#KT-19192
2020-10-28 07:36:14 +03:00
Ilya Gorbunov
e7c888a2e6 Avoid introducing Path.printWriter
#KT-19192
2020-10-28 07:36:11 +03:00
Ilya Gorbunov
9f659d74df Introduce dedicated experimental annotation for Path extensions
#KT-19192
2020-10-28 07:36:08 +03:00
Ilya Gorbunov
997cd35e06 Move Path extensions to the new package kotlin.io.path
This avoids the conflict with the existing top-level functions in
kotlin.io package.

#KT-19192
2020-10-28 07:36:06 +03:00
Ilya Gorbunov
7d58a5e2f2 Simplify Path.copyTo implementation
Delegate most checks to the platform Files.copy.
This changes the exception type thrown in one case,
so document when it happens. Also 'copyTo' no longer
creates target parent directory if it doesn't exist.

#KT-19192
2020-10-28 07:36:02 +03:00
Ilya Gorbunov
f6d2400208 Workaround bugs in Path.relativize
Also add actual paths to the relativeTo error message.

#KT-19192
2020-10-28 07:36:00 +03:00
AJ
b3a87356bd Add java.nio.Path extensions to stdlib-jdk7: part 2
- Add notExists
- Rename isFile to isRegularFile
- Remove forEachBlock
- Rename listFiles
- Add relativeTo extensions
- Remove extra overloads
- Update doc comments
- Address review comments

#KT-19192
2020-10-28 07:35:57 +03:00
AJ
03cc0bf6aa Add java.nio.Path extensions to stdlib-jdk7
This PR adds most extensions on `java.io.File` in `kotlin.io` to `java.nio.Path`. This includes extensions from `FileReadWrite.kt`, `Utils.kt`, and `FileTreeWalk.kt`.

I attempted to keep the implementations, documentation, and tests as similar as possible to the existing implementations.

I am happy to add, remove, or move to separate PRs any of the functions of this PR.

### `File` extensions that were not added to `Path`

##### `createTempDir`, `createTempFile`

These functions have no `File` parameters, so can't be overloaded. Equivalents exist as `Files.createTempFile()` and `Files.createTempDirectory()`.

##### `startsWith`, `endsWith`, `normalize`, `resolve`, `resolveSibling`

These exist as member functions on `Path`

##### `relativeTo`, `relativeToOrNull`, `relativeToOrSelf`, `toRelativeString`, `toRelativeStringOrNull`

This functionality exists as the `Path.relativize` member function, which is equivalent to `relativeTo`, but with the receiver and parameter flipped. `foo.relativeTo(bar)` is equivalent to `bar.relativize(foo)`. We could potentially add a `relativizeOrNull` extension to make that pattern simpler.

##### `isRooted`

`Path` has a `root` method, so `isRooted` is equivalent to `root != null`

### New extensions

All of the simple boolean attribute checks from `java.nio.Files` were added as extensions on `Path`. These extensions are used commonly enough that it seems worth supporting them. This functionality for `File` is implemented as member methods.

The following `Path` extensions were added:

- `exists`
- `isDirectory`
- `isExecutable`
- `isFile`
- `isHidden`
- `isReadable`
- `isSameFile`
- `isSymbolicLink`
- `isWritable`

Some of these extensions take options that are forwarded to their `Files` method, so all of the extensions were implemented as functions rather than properties for consistency.

Additionally, `Path.listFiles` was added to match the `File.listFiles` method. One motivation for its addition was that it's used several times in the implementation of other file extensions. The way to list directory contents with `java.nio` is via `Files.newDirectoryStream()`, which returns an iterable object that must be closed to avoid leaking resources. It's difficult to use correctly with functions like `map` and `filter`, so this extension was added as a simpler, less error-prone alternative.

### Other changes

I added overloads of several of the read-write that take `OpenOptions` to expose the greater control that `java.nio` introduces. For example, you can use `printWriter(APPEND)` to create a `PrintWriter` that doesn't delete the contents of an existing file.

All the new extensions throw exceptions (such as `NoSuchFileException`) from `java.nio` rather than the copies from `kotlin.io`. The `kotlin.io` copies take `File` objects as parameters, and so aren't compatible with `Path`s.

### Address review comments

- Move varargs parameters to the last position
- Remove PathTreeWalk

#KT-19192
2020-10-28 07:35:54 +03:00
Yan Zhulanow
008da87160 Minor: Update Android Extensions deprecation message in relevant test 2020-10-28 00:43:20 +09:00
Yan Zhulanow
9faf91f55d Fix Parcelize settings serialization (KT-42958) 2020-10-28 00:43:20 +09:00
Yaroslav Chernyshev
3386b93009 [Gradle, Cocoapods] Added useLibraries() to allow static library pods
#KT-42531 fixed
2020-10-27 17:57:53 +03:00
Mikhael Bogdanov
21521aa397 Deprecate protected constructors call from public inline function
#KT-21177
2020-10-27 14:51:08 +01:00
Dmitry Gridin
a72cdeabb4 fix testData
^KT-40861
2020-10-27 18:58:48 +07:00
Ilya Goncharov
e6edb62911 [Gradle, JS] Fix for IDEA import with dukat binaries
^KT-42954 fixed
2020-10-27 14:21:34 +03:00
Mikhail Zarechenskiy
bb2e9e2d56 Extract new method from the publicly used interface for compatibility
Note that we can't just use ``@JvmDefault` annotation as the main change
 is in the `core` module which targets Java 6

 #KT-42259 Fixed
2020-10-27 14:14:39 +03:00
Alexander Dudinsky
0e7e657657 Migrate MultiModuleLineMarkerTest to the new CodeMetaInfo test infrastructure 2020-10-27 12:31:45 +03:00
Alexander Dudinsky
94bf38a7b5 Added support for various platforms for CodeMetaInfo tests. ^KT-41996
The tests need to be able to parse and render CodeMetaInfo for different
 platforms. For example, we must draw a run gutter a MAC application on
 OSX, but for a Win application, the gutter should not be drawn at the
 same time. This commit allows to do such checks. In order to indicate
 on which platform it should be rendered, it is necessary to specify the
 platform for a specific CodeMetaInfo in the test data in the format
 {OSX,Unix,Win}, if the block with platforms is missing, this means
 that it should be rendered on each platform.

<!LINE_MARKER{OSX}(...)!> - should only be on OSX
<!LINE_MARKER(...)!> - should be on any platform
2020-10-27 12:31:18 +03:00
Alexander Dudinsky
84d24e5b76 Migrate MultiplatformAnalysisTest to new test runner 2020-10-27 12:23:50 +03:00
Alexander Dudinsky
ac98bc9853 New highlighting/line markers/diagnostics test infrastructure
The current test framework has a number of shortcomings, such as
different markups for different kinds, those formats can not be
mixed in one test file, lacks composability, re-use of it is complicated
This commit contains the first version of the new test runner
to which tests will be migrated in the future.
2020-10-27 12:23:50 +03:00
Yan Zhulanow
994cb6f28e Update deprecation message for the Android Extensions plugin 2020-10-27 18:08:39 +09:00
Toshiaki Kameyama
5e9333773c Remove explicit type arguments: don't report when type argument has annotations
#KT-40985 Fixed
2020-10-27 15:44:44 +07:00
nataliya.valtman
e1a380ec95 KT-34862 use relative path for incremental build cache 2020-10-27 10:45:06 +03:00
Mikhail Glukhikh
09043fb98d [FIR] JvmMappedScope: add mutable methods or not depending on a class 2020-10-27 10:27:06 +03:00
Mikhail Glukhikh
5c3269f489 [FIR] JvmMappedScope: don't add Java methods if Kotlin ones are here 2020-10-27 10:26:55 +03:00
Toshiaki Kameyama
ce407471ec Convert to secondary constructor: suggest on class name
#KT-40861 Fixed
2020-10-27 14:05:28 +07:00
Ivan Gavrilovic
2c5c15f503 Clean-up outputs on non-incremental run
Always clean all outputs on non-incremental run of the
Kotlin compile task.
#KT-38692 Fixed
2020-10-27 09:44:06 +03:00
Abduqodiri Qurbonzoda
2fd7d64db0 Promote CancellationException to stable #KT-41837 2020-10-27 05:06:50 +03:00
Mikhail Glukhikh
caafe21e84 [FIR] Add CheckLowPriorityStage to callable reference resolve 2020-10-26 20:07:37 +03:00
Ilmir Usmanov
a775fa195b Unbox inline class parameter of lambda if underlying type is Any or Any?
The inline class is boxed when we pass it as lambda argument, now we
unbox it. If the underlying type is not Any or Any?, bridge method does
the unboxing.

 #KT-32450 Fixed
 #KT-39923 Fixed
 #KT-32228 Fixed
 #KT-40282 Fixed
2020-10-26 17:34:37 +01:00
Toshiaki Kameyama
752f6d8f72 Elvis -> if intention: don't introduce new variable when RHS type is Nothing 2020-10-26 20:57:16 +07:00
Toshiaki Kameyama
f9f8fd055b Convert receiver to parameter: place value argument list after type argument list
#KT-41499 Fixed
2020-10-26 20:47:35 +07:00
Dmitry Petrov
b1629cc5f4 JVM KT-22465 don't generate accessor to private setter in other class 2020-10-26 14:56:07 +03:00
Roman Artemev
4d63ecd83c [JS IR] Do not copy prototype references of FO from super class
Reduce bundle size from issue from 4.9M to 3.4M

 - fix KT-41227
 - add simple test
2020-10-26 14:30:54 +03:00
Matthew Gharrity
99a6bdeec7 Fix KotlinCoreEnvironment projectCount disposable
The disposable which decrements ourProjectCount was a non-capturing
lambda, meaning it had a single identity and could only be registered
in the Disposer tree once. Therefore the application environment
would never be disposed if ourProjectCount ever went above 1.
2020-10-26 12:23:10 +01:00
Mikhail Glukhikh
e9b51b42f9 [FIR] Add test for both KT-10240 and KT-19446 2020-10-26 14:09:36 +03:00
Alexander Udalov
382a0bd298 JVM IR: clear BindingContext after psi2ir
This helps to reduce peak memory in lowerings/codegen by a lot.

A more robust approach would be to have a separate BindingContext for
each file, and clear each of them after running psi2ir on it. This would
also lower peak memory usage in psi2ir.

Provide a fallback workaround compiler argument
-Xir-do-not-clear-binding-context just in case BindingContext is in fact
used somewhere and it's not caught by tests.
2020-10-26 10:34:43 +01:00
Alexander Udalov
bc76f1fec3 Refactor test utilties to reuse GenerationState construction 2020-10-26 10:34:43 +01:00
Alexander Udalov
dd813777b9 Refactor Main-Class computation in CLI for JVM with .jar outputs
Compute FQ name of the main class right after running the analysis and
before invoking codegen. This is needed because MainFunctionDetector
depends on BindingContext, and JVM IR needs to clear BindingContext as
soon as it's not necessary to reduce peak memory usage, thus breaking
any usages of data from it after the codegen.

Also refactor and use the extracted, but not properly reused previously,
copy of findMainClass in findMainClass.kt.

Note that this replaces NPE in KT-42868 with an UOE.
2020-10-26 10:34:43 +01:00
Vladimir Dolzhenko
0a18be62e5 Add prefix for inner test classes in ide perf tests to avoid metric name clashes 2020-10-25 22:49:30 +01:00
Alexander Udalov
08b8939b80 IR: make IrSymbol.isPublicApi an extension 2020-10-23 20:56:08 +02:00
Alexander Udalov
4bd08e5e0c IR: clear callToSubstitutedDescriptorMap for each file to avoid leaking memory
This map is populated during psi2ir and is only used in
insertImplicitCasts, after which it makes sense to clear it, otherwise
it strongly references a lot of descriptors for calls in other files
which would never be used.
2020-10-23 20:50:08 +02:00
Alexander Udalov
7ac981d4d3 Psi2ir: refactor ModuleGenerator.generateModuleFragment
Move `postprocess` into `generateSingleFile` and do those steps on each
file instead. This will allow to create
`GeneratorContext.callToSubstitutedDescriptorMap` for each file and
clear it after its only call site (InsertImplicitCasts) has used it.
Also simplify code a bit.
2020-10-23 20:50:08 +02:00
Victor Petukhov
7b53d668ab Fix test after 4f06162446 2020-10-23 18:33:23 +03:00
Yan Zhulanow
c07f25fa44 Revert "FoldInitializerAndIfToElvisInspection: don't add explicit type if var is used as non-nullable"
This reverts commit bb7d4c22
2020-10-24 00:22:41 +09:00
Yan Zhulanow
87574dddd9 Revert "ReplaceWith: suggest for "invoke" extension"
This reverts commit be194c34
2020-10-24 00:22:41 +09:00
Yan Zhulanow
04457e92d0 Revert ""Put/Join arguments/parameters" intention: don't suggest on nested argument list"
This reverts commit 4a328981
2020-10-24 00:22:41 +09:00
Yan Zhulanow
3321ce6325 Revert ""Code Cleanup": don't remove deprecated imports when file has @file:Suppress("DEPRECATION") annotation"
This reverts commit cf5a6274
2020-10-24 00:22:41 +09:00
Yan Zhulanow
839c30d04b Revert "Additional minor fixes for KT-33594: avoid using hard-coded annotation name, simplify hasAnnotationToSuppressDeprecation()"
This reverts commit 2a841550
2020-10-24 00:22:40 +09:00
Yan Zhulanow
9320637efe Revert "Redundant companion reference: do not report 'values/valueOf' function in enum"
This reverts commit 55d55446
2020-10-24 00:22:40 +09:00
Yan Zhulanow
383190f25e Revert "Replace with ordinary assignment: do not suggest when operator is augmented assignment operator function"
This reverts commit 73e319ca
2020-10-24 00:22:40 +09:00
Yan Zhulanow
7fccd0153b Revert "Refactoring: Remove hard-coded augmented assignment check with a Name check"
This reverts commit 016e78e4
2020-10-24 00:22:40 +09:00
Yan Zhulanow
0ae21a157f Revert ""Change to return with label" quick fix: apply for type mismatch"
This reverts commit f76e9886
2020-10-24 00:22:39 +09:00
Yan Zhulanow
601198634d Revert "Minor: Extract lambda return expression handling"
This reverts commit 55038e19
2020-10-24 00:22:39 +09:00
Yan Zhulanow
b18de1e3ff Revert "Provide quickfix for specifying type of variable initialized with null"
This reverts commit cdf7f46c
2020-10-24 00:22:39 +09:00
Yan Zhulanow
4327bc4ac3 Revert "KT-23394: Add a test with a property"
This reverts commit f2dc132d
2020-10-24 00:22:38 +09:00
Yan Zhulanow
fe64fcf8a3 Revert "Minor: update order in IntentionTestGenerated"
This reverts commit 6515d53b
2020-10-24 00:22:38 +09:00
Yan Zhulanow
c4a48598c0 Revert ""Add parameter to function" for TYPE_MISMATCH: fix it works correctly for extension function"
This reverts commit 03e725d5
2020-10-24 00:22:38 +09:00
Yan Zhulanow
16dbf7ba74 Revert "Convert to range check: don't report it if recursive call will be created"
This reverts commit 73184884
2020-10-24 00:22:38 +09:00
Yan Zhulanow
d735637f1e Revert "RemoveBracesIntention: add new line for long expression"
This reverts commit f4b9c477
2020-10-24 00:22:37 +09:00
Yan Zhulanow
f615ed2f26 Revert ""Use destructuring declaration": fix it works correctly if variable name is shadowed"
This reverts commit d61158a1
2020-10-24 00:22:37 +09:00
Yan Zhulanow
ab70cc35ea Revert "Add quick fix for 'JAVA_CLASS_ON_COMPANION'"
This reverts commit 15a615d6
2020-10-24 00:22:37 +09:00
Yan Zhulanow
6cc4d70b07 Revert "Minor: Remove hard-coded 'Companion' name"
This reverts commit 871ad2b9
2020-10-24 00:22:37 +09:00
Yan Zhulanow
19f518c037 Revert "IfThenToSafeAccessInspection: fix it works correctly for variable/operator call"
This reverts commit 5095caee
2020-10-24 00:22:36 +09:00
Yan Zhulanow
19896f9616 Revert "Minor: Use second pattern argument instead of explicit callee.text"
This reverts commit 55e36fa1
2020-10-24 00:22:36 +09:00
Yan Zhulanow
519f92599c Revert "Minor: Import DebuggerUtils"
This reverts commit 58f606e1
2020-10-24 00:22:36 +09:00
Igor Chevdar
9b2aa0951b [box-tests] Turned on tests on typeof for K/N 2020-10-23 18:27:10 +05:00
Igor Chevdar
9d1cb6a2c0 Turned off TypeOfChecker for K/N 2020-10-23 18:27:10 +05:00
Victor Petukhov
4f06162446 Get a callable reference expression to report an error on it properly, taking into account possible wrapping
^KT-42620 Fixed
2020-10-23 15:12:08 +03:00
Ilya Muradyan
cb020fb9f4 Change repository adding logic
Now if the repo being added already exists, it is moved to the
end of the list, effectively lowering its priority.

Original issue: https://github.com/Kotlin/kotlin-jupyter/issues/107
2020-10-23 13:31:38 +03:00
Ilya Goncharov
7062bf5737 [JS_IR] Additional check on loop label to not persist name for labeled loop
^KT-42262 fixed
2020-10-23 13:16:03 +03:00
Igor Chevdar
1a9e516dc0 [ir-plugin] Referenced binary operators with the new API 2020-10-23 14:58:33 +05:00
Igor Chevdar
23d12a717e [box-tests] Added a test 2020-10-23 14:22:48 +05:00
Igor Chevdar
27aed0ccbc [IR] Inliner: erase non-reified parameters for casts
Fixes https://youtrack.jetbrains.com/issue/KT-31072
2020-10-23 14:22:09 +05:00
Kristoffer Andersen
27fb46712a [JVM+IR] Unify new debugger tests expectations
This commit unifies the expectation format between the stepping and
LVT tests in the new debugging test harness.

Furthermore, it introduces a compression of runs of locations without
linenumbers. These default to showing as bytecode offsets from
previous line number, which overspecifies the tests: the bytecodes
chosen should not be constrained by a debugging step test.
2020-10-23 11:19:58 +02:00
pyos
e19ecdfb3d [Tests] Suspend Codegen Tests Improvements
This commit enables the execution of suspend box tests in a separate
test. It's a QoL improvement in the existing bb tests but, motivating
these changes, enables the new debugger stepping tests to step
coroutine code.
2020-10-23 11:19:58 +02:00
Kristoffer Andersen
3291f8455b [JVM+IR] Update straight-forward LVT tests 2020-10-23 11:19:58 +02:00
Kristoffer Andersen
2c9bf95227 [JVM+IR] New LVT debugging test harness improvements
This is the first step in a push to improve the test coverage of the
IR debugging experience. This commit improves on the sketch of local
variable table tests built on the new debugger stepping
infrastructure. As improvements on the existing
checkLocalVariableTableTest they:
 - don't overspecify codegen strategy: no hard requirements on slots.
 - test the observed lifespans of locals by stepping through code.

Ultimately this should enable us to bring over all existing tests for
improved coverage of both old and new JVM backends.

WIP list:
 - Gracefully handle absent LVT: treat as empty Add type of local and
 - type of value stored there to expectations Print values in local
 - slots if primitive or java.lang.String Enable specifying
 - expectations per backend Gracefully handle absent box methods
 - Gracefully handle null values in slots of reference type
 - Port a first LVT test
2020-10-23 11:19:58 +02:00
Ilya Goncharov
4479bf0933 [JS_IR] Enum constructor copy parameters with mapping by index
Previously mapping was by name, and there was clash in case of user
parameters named 'name' or 'ordinal'

^KT-39186 fixed
2020-10-23 11:42:43 +03:00
Vladimir Dolzhenko
2790bc1105 Split perf test json reports in a separate files/docs 2020-10-23 09:11:05 +02:00
Vladimir Dolzhenko
d7a783e077 Add prefix for inner test classes 2020-10-23 09:11:05 +02:00
Yan Zhulanow
58f606e1f5 Minor: Import DebuggerUtils 2020-10-23 15:46:54 +09:00
Yan Zhulanow
55e36fa1ab Minor: Use second pattern argument instead of explicit callee.text 2020-10-23 15:46:54 +09:00
Toshiaki Kameyama
5095caee50 IfThenToSafeAccessInspection: fix it works correctly for variable/operator call
#KT-30513 Fixed
#KT-17071 Fixed
2020-10-23 15:46:54 +09:00
Yan Zhulanow
871ad2b909 Minor: Remove hard-coded 'Companion' name 2020-10-23 15:46:53 +09:00
Toshiaki Kameyama
15a615d63b Add quick fix for 'JAVA_CLASS_ON_COMPANION'
#KT-29264 Fixed
2020-10-23 15:46:53 +09:00
Toshiaki Kameyama
d61158a176 "Use destructuring declaration": fix it works correctly if variable name is shadowed
#KT-30601 Fixed
#KT-20570 Fixed
2020-10-23 15:46:53 +09:00
Toshiaki Kameyama
f4b9c4777f RemoveBracesIntention: add new line for long expression
#KT-30523 Fixed
2020-10-23 15:46:52 +09:00
Toshiaki Kameyama
731848849e Convert to range check: don't report it if recursive call will be created
#KT-39182 Fixed
2020-10-23 15:46:52 +09:00
Toshiaki Kameyama
03e725d5da "Add parameter to function" for TYPE_MISMATCH: fix it works correctly for extension function
#KT-39557
2020-10-23 15:46:52 +09:00
Yan Zhulanow
6515d53b94 Minor: update order in IntentionTestGenerated 2020-10-23 15:46:52 +09:00
Yan Zhulanow
f2dc132d5d KT-23394: Add a test with a property 2020-10-23 15:46:51 +09:00
Toshiaki Kameyama
cdf7f46ce1 Provide quickfix for specifying type of variable initialized with null
#KT-23394 Fixed
2020-10-23 15:46:51 +09:00
Yan Zhulanow
55038e19ec Minor: Extract lambda return expression handling 2020-10-23 15:46:51 +09:00
Toshiaki Kameyama
f76e98868c "Change to return with label" quick fix: apply for type mismatch
#KT-32280 Fixed
2020-10-23 15:46:51 +09:00
Yan Zhulanow
016e78e483 Refactoring: Remove hard-coded augmented assignment check with a Name check 2020-10-23 15:46:50 +09:00
Toshiaki Kameyama
73e319ca7a Replace with ordinary assignment: do not suggest when operator is augmented assignment operator function
#KT-34715 Fixed
2020-10-23 15:46:50 +09:00
Toshiaki Kameyama
55d55446c8 Redundant companion reference: do not report 'values/valueOf' function in enum
#KT-34285 Fixed
2020-10-23 15:46:50 +09:00
Yan Zhulanow
2a841550d4 Additional minor fixes for KT-33594: avoid using hard-coded annotation name, simplify hasAnnotationToSuppressDeprecation() 2020-10-23 15:46:50 +09:00
Toshiaki Kameyama
cf5a6274e2 "Code Cleanup": don't remove deprecated imports when file has @file:Suppress("DEPRECATION") annotation
#KT-33594 Fixed
2020-10-23 15:46:49 +09:00
Toshiaki Kameyama
4a328981c6 "Put/Join arguments/parameters" intention: don't suggest on nested argument list
#KT-31020 Fixed
2020-10-23 15:46:49 +09:00
Toshiaki Kameyama
be194c3460 ReplaceWith: suggest for "invoke" extension
#KT-8597 Fixed
2020-10-23 15:46:49 +09:00
Toshiaki Kameyama
bb7d4c224f FoldInitializerAndIfToElvisInspection: don't add explicit type if var is used as non-nullable
#KT-38349 Fixed
2020-10-23 15:46:48 +09:00
Yan Zhulanow
3e632d074e Enable Parcelize IDE plugin in Android Studio 4.2 (KT-42859)
It turned out that all extensions related to the Parcelize IDE plugin are disabled in Android Studio 4.2. The missing inclusion seemingly happened because of a rebase mistake. This commit returns the missing inclusion back.
2020-10-23 15:46:48 +09:00
Mikhail Glukhikh
47a4bd1701 [FIR Java] Look into type arguments during dependent type parameter search 2020-10-23 08:12:17 +03:00
Mikhail Glukhikh
7f3d0af4f7 [FIR Java] Soften rules for matching types for may-be-special-builtins
This commit is workaround for cases like
MyJavaMap<KK : Bound, V> : java.util.Map<K, V>.
After signature changing and substitution we have
MyJavaMap.get(Object) declared and MyJavaMap.get(KK) from supertype,
which can't be otherwise matched as overriding one another.
2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
81529a835b Drop FirAbstractOverrideChecker.isEqualTypes 2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
abc2866902 [FIR] Fold flexible types after substitution if possible 2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
acb03cb28c [FIR2IR] Expand type during super qualifier search 2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
c50aa5f2ec [FIR TEST] Bad test data changes due to Java signature transformation
Both changes are related to getOrDefault. We should either make Java
version low priority or remove it at all.
2020-10-23 08:12:16 +03:00
Mikhail Glukhikh
d3e85dbce0 [FIR] Implement replacing Object with type parameters for specials builtins
#KT-42601 Fixed
2020-10-23 08:12:15 +03:00
Mikhail Glukhikh
d40248cb53 [FIR] Extract computeJvmDescriptorReplacingKotlinToJava 2020-10-23 08:12:15 +03:00
Mikhail Glukhikh
f866eff93e Extract special generic signatures to compiler.common.jvm to reuse in FIR 2020-10-23 08:12:15 +03:00
Mikhail Glukhikh
0e7acd6e8b [FIR Java] Add better type parameter erasure for override matching
Around KT-42601
2020-10-23 08:12:15 +03:00
Mikhail Glukhikh
17de486c23 [FIR Java] Drop nasty code providing type parameter erasure 2020-10-23 08:12:14 +03:00
Alexander Likhachev
999627952a [Gradle, K/N] Add proper assumptions for Mac only integration tests 2020-10-23 05:41:08 +03:00
Alexander Likhachev
ac7b7abcc0 [Gradle, JS] Fix K/JS project build with configuration cache (part 3)
Now configuration cache enabled builds with JS tasks does not fails but prints warning and skips execution on subsequent builds.
Relates to KT-42494
2020-10-23 05:41:07 +03:00
Igor Yakovlev
97d39c102a Fix BWC for Search utils 2020-10-22 19:32:18 +03:00
Andrei Klunnyi
71023cd596 [KT-40688] Inlay Hints: inlay hints are duplicated on code editing
Code editing changes inlay hints offset.
InlayModel.getAfterLineEndElementsInRange(int, int) call didn't return
previously existed hint by its "outdated" offset. From now on hints are
taken by logical line.
2020-10-22 18:22:51 +02:00
Georgy Bronnikov
b7a07fdf03 Review fix: unify irTemporary variants 2020-10-22 18:31:23 +03:00
Georgy Bronnikov
8e331c8afe IR: relax type cast for WrappedVariableDescriptor.containingDeclaration 2020-10-22 18:26:47 +03:00
Georgy Bronnikov
b588839752 EnumConstructorCall.fromSymbolDescriptor 2020-10-22 18:26:46 +03:00
Georgy Bronnikov
887dd10764 IR: remove descriptor usage 2020-10-22 18:26:46 +03:00
Georgy Bronnikov
e5cf7a1be7 Remove descriptor usage from Scope.kt 2020-10-22 18:26:46 +03:00
Leonid Startsev
8d999a2c13 Disable kx.ser plugin inside descriptors serialization in the IDE
Since IDE does not perform any serialization of descriptors, and
metadata written to the 'serializationDescriptorSerializer'
deleted only on call to DescriptorSerializer,
enabling this extension in the IDE effectively causes memory leaks.

 #KT-39624 Fixed

Pass SerializationDescriptorSerializerPlugin to other extensions directly

instead of using static val in companion.
2020-10-22 17:14:06 +03:00
Leonid Startsev
4ec90b18bc Rework DescriptorSerializerPlugin to be a part of Project's extensions
instead of statically registering it.

Static registering can cause subtle errors when plugin implementation
(e.g. SerializationDescriptorPluginForKotlinxSerialization) is registered
from multiple classloaders: in multi-module with daemon compilation scenario

 #KT-41857 Fixed
2020-10-22 17:04:35 +03:00
Mikhail Glukhikh
ef907e0c46 Fix FIR IDE test broken by Jinseong commit 2020-10-22 16:53:12 +03:00
Mikhail Glukhikh
ad12cc296b [FIR] Expand type before adding equality constraint 2020-10-22 15:38:30 +03:00
Alexander Gorshenev
7815529eed [Private fake overrides] Tests for private fake overrides construction 2020-10-22 13:23:29 +03:00
Alexander Gorshenev
294e7dd902 [Private fake overrides] Renamed FakeOverrideBuilder object to FakeOverrideBuilderForLowering 2020-10-22 13:23:29 +03:00
Alexander Gorshenev
81c06b24f7 [Private fake overrides] Private fake overrides linkage 2020-10-22 13:23:28 +03:00
Alexander Gorshenev
223d1dd5e6 [Private fake overrides] Private fake override construction 2020-10-22 13:23:28 +03:00
Alexander Gorshenev
c90556a883 [Private fake overrides] FakeOverrideDeclarationTable for private fake override construction 2020-10-22 13:23:28 +03:00
Alexander Gorshenev
623f9a54c6 [Private fake overrides] Tweak DeclarationTable to be open 2020-10-22 13:23:27 +03:00
Alexander Gorshenev
c7ea8b1ab6 [Private fake overrides] Prepare IdSignature for private fake override construction 2020-10-22 13:23:27 +03:00
Mikhail Glukhikh
91089f5f7a IrValidator: add more details to duplicate message for type parameter 2020-10-22 13:05:01 +03:00
Mikhail Glukhikh
44bb12480b [FIR2IR] Forbid private fake overrides in generator 2020-10-22 13:05:00 +03:00
Mikhail Glukhikh
3663bc6be3 FirClassSubstitutionScope: eliminate second constructor to simplify code 2020-10-22 13:05:00 +03:00
Mikhail Glukhikh
80f8b5b234 IrValidator: mention file in exception message 2020-10-22 13:05:00 +03:00
Mikhail Glukhikh
23e7468e57 [FIR2IR] Cache Java field-based properties more correctly #KT-42805 Fixed
Before this commit, we cached such IR properties by FIR property
which was created by Java field each time when we referenced it.
This led to signature clashes. Now we cache such IR properties
directly by associated FIR field.
2020-10-22 13:05:00 +03:00
Mikhail Glukhikh
3576cbf0d8 [FIR] Add test for KT-42805 2020-10-22 13:04:59 +03:00
Mikhail Glukhikh
f2c651ec9c [FIR2IR] Don't generate Any delegated members for data class
#KT-42771 Fixed
2020-10-22 13:04:59 +03:00
Mikhail Glukhikh
44459e8ac7 FIR mangler: fix alias-based type handling #KT-42770 Fixed 2020-10-22 13:04:58 +03:00
Victor Petukhov
6251568e17 Fix test after 84129098cb 2020-10-22 12:17:26 +03:00
Mikhail Glukhikh
289efd47b2 [FIR2IR] Cleanup code around implicit casts 2020-10-22 11:03:48 +03:00
Juan Chen
620a5d404d [FIR2IR] Keep redundant cast on 'this' for local anonymous function
#KT-42517 Fixed
2020-10-22 10:51:23 +03:00
Jinseong Jeon
f4531b0f34 FIR: set missed source in various FirElements
This could be caught by debuggability tests, such as stepping tests,
which are not enabled for FIR yet.
Instead, for now, full pipeline tests will raise index out-of-bound
errors due to the undefined offsets, which stem from null source.
2020-10-22 10:51:21 +03:00
Jinseong Jeon
46cc01602e FIR2IR: add implicit NOT_NULL cast if needed 2020-10-22 10:51:20 +03:00
Sergey Bogolepov
eeda48e63e Allow prefix and relative path in resolvable properties.
It allows us to move more logic to konan.properties from ClangArgs.
E.g., something like `-$absoluteTargetSysRoot/usr/include/c++/4.9.4`
2020-10-22 12:45:49 +07:00
Victor Petukhov
84129098cb Add equality constraints without subtyping
^KT-42195 Fixed
^KT-41741 Fixed
2020-10-21 21:23:13 +03:00
Dmitry Petrov
b1b87becc8 PSI2IR more JVM-like exhaustive when behavior KT-36840 2020-10-21 20:07:11 +03:00
Ilya Goncharov
7edeccbdc7 Move labeling into NameTables with labeling loops which contain escaped break
^KT-42262 fixed
2020-10-21 16:59:24 +03:00
Ilya Goncharov
400a15e3d6 Add lowering on switch in loop
^KT-42262 fixed
2020-10-21 16:59:24 +03:00
Ilya Goncharov
14d9aa1660 Add test on break in when without label
^KT-42262 fixed
2020-10-21 16:59:24 +03:00
pyos
a4b67f007f JVM_IR: treat suspend-converted references as lambdas for inlining
Again, this is consistent with adapted function references, since
they're pretty much the same anyway.
2020-10-21 15:21:01 +02:00
pyos
12bec7cca2 JVM_IR: when convering references to lambdas, bind the receiver
instead of storing it into a captured temporary.

This makes the resulting lambdas equivalend to adapted function
references produced by PSI2IR or FIR2IR.

 #KT-42492 Fixed
2020-10-21 15:21:01 +02:00
pyos
95fb597da0 PSI2IR / FIR2IR: bind FunctionN as receiver when suspend-converting
This is more consistent with adapted references & allows skipping a
temporary variable.
2020-10-21 15:21:01 +02:00
pyos
ccf921510d PSI2IR / FIR2IR: do not create temporaries for adapted references
Arguments to function references behave the same as arguments to
function calls and should be evaluated once regardless, so the temporary
is unnecessary.
2020-10-21 15:21:01 +02:00
Alexander Udalov
369056ca5d Minor, add explicit type argument to workaround KT-42175 2020-10-21 15:19:25 +02:00
Kirill Shmakov
29aaf70d21 Launch common tests on local JVM via run gutter
For projects with android target and without jvm one. #KT-42463
2020-10-21 15:40:13 +03:00
Jinseong Jeon
1c1e8f7beb FIR CFG: revise edge kind between local func node and fun enter node
so that local function enter node can be visited by FIR CFA

#KT-42814 Fixed
2020-10-21 14:01:31 +03:00
Pavel Punegov
ce8d983b2a Fix test after the fix for KT-17691 2020-10-21 13:58:53 +03:00
Dmitry Petrov
0b34526321 JVM_IR remove lambda hack required for odd JVM+OI behavior in KT-35849 2020-10-21 13:47:01 +03:00
Mads Ager
ad88c60fd8 [JVM_IR] Copy offsets from the original function to invokeSuspend.
Otherwise, implicit returns in void returning suspend functions
will not have the line number of the end brace.

Fixes KT-41962 and KT-40464.
2020-10-21 12:38:45 +02:00
Dmitriy Novozhilov
800bfe2cdb [TEST] Update testdata broken in c2d3a252 2020-10-21 12:49:45 +03:00
Dmitriy Novozhilov
c2d3a252a8 Mute very strange failing of FIR find usages test 2020-10-21 11:53:42 +03:00
Dmitriy Novozhilov
0484ab8cca Don't unwrap captured types in IDE descriptors renderers
#KT-42263 Fixed
2020-10-21 11:53:42 +03:00
Dmitriy Novozhilov
3068d79d2b [FIR-IDE] Add lock for status resolve 2020-10-21 11:53:11 +03:00
Dmitriy Novozhilov
6550bd09b1 [FIR] Ensure class resolve phase in status resolve 2020-10-21 11:53:10 +03:00
Dmitriy Novozhilov
699dd54be9 [FIR] Don't inherit some declaration modifiers (like tailrec) 2020-10-21 11:53:10 +03:00
Dmitriy Novozhilov
bf1a00c73a [FIR] Rework resolution of declaration statuses
There is introduced algorithm of resolution with jumps: before
  resolution of some class we resolve all status of members of its
  supertypes, so we can properly determine inherited visibility
  and modifiers
2020-10-21 11:53:10 +03:00
Mikhail Glukhikh
0b8116dff0 [FIR] Change some phase requirements: STATUS -> DECLARATIONS
NB: Also not quite sure this is better. IMO this shows more clearly that
we require results of declarations resolve and not some strange 'STATUS'
2020-10-21 11:53:10 +03:00
Mikhail Glukhikh
275260720d Add replacePhase in FirTypeResolveTransformer.transformEnumEntry 2020-10-21 11:53:10 +03:00
Mikhail Glukhikh
c171dafd91 FIR serializer: always normalize visibility
Without this commit we fail on package-private or so in serializer
2020-10-21 11:53:10 +03:00
Dmitriy Novozhilov
1ff5da5f41 [FIR] Add forgotten fake override type calculation 2020-10-21 11:53:10 +03:00
pyos
5c55f67923 JVM_IR: generate shorter names for classes in delegate initializers
#KT-41493 Fixed
2020-10-20 21:14:44 +02:00
LepilkinaElena
b786cf7559 [IR] Made signature nullable (#3860) 2020-10-20 21:13:40 +03:00
Alexander Udalov
6a9c72e77c IR: use one traversal instead of two for DeclarationContainerLoweringPass 2020-10-20 20:03:17 +02:00
Alexander Udalov
b5695188f9 IR: remove FunctionLoweringPass, refactor usages to FileLoweringPass
FunctionLoweringPass didn't add much value over FileLoweringPass, but
had a hidden footgun (like ClassLoweringPass) in that if your lowering
pass invoked a visitor/transformer on the function body and you forgot
to override visitFunction to stop visiting nested functions,
runOnFilePostfix would work with the complexity of the squared number of
nesting levels. It looks like this was happening with K/N's
DataClassOperatorsLowering (I haven't measured though).
2020-10-20 20:03:14 +02:00
Alexander Udalov
c110031935 IR: refactor DeclarationTransformer
Do not create extra DeclarationTransformer and FileLoweringPass
instances, instead inline all transformations to
DeclarationTransformer.lower.
2020-10-20 20:02:45 +02:00
Alexander Udalov
2be7afc7f9 IR: minor, give names to anonymous lowering visitors
To improve stacktraces and make the code a bit more readable.
2020-10-20 19:15:50 +02:00
Dmitry Petrov
3979cde738 Add box and PSI2IR tests for special cases listed in KT-35849 2020-10-20 19:31:40 +03:00
Ilya Goncharov
efee322830 [Gradle, JS] Update Dukat on 0.5.8-rc.3 2020-10-20 16:12:38 +03:00
Victor Turansky
4d4aabab8d [JS BE] Make properties configurable when implementing an interface by delegation
#KT-42364 Fixed
2020-10-20 15:49:29 +03:00
Sergey Bogolepov
2ad13847d1 [KT-40670] Allow to override konan.properties from CLI 2020-10-20 17:00:00 +07:00
Konstantin Tskhovrebov
ea34a588f3 Update KMM project wizard. 2020-10-20 12:03:17 +03:00
Dmitry Petrov
47c784f023 JVM_IR fix Java wildcard types translation
Types such as 'Collection<? extends CharSequence>' are treated as
'(kotlin.collections.MutableCollection<out kotlin.CharSequence!>
  ..kotlin.collections.Collection<kotlin.CharSequence!>?)'
by the front-end.
When generating generic signatures, JVM BE takes lower bound (which is
'kotlin.collections.MutableCollection<out kotlin.CharSequence!>').
Emulate this behavior in TypeTranslator.
2020-10-19 20:52:53 +03:00
zhelenskiy
19ed04e3fe Bad capitalization fixed 2020-10-19 16:16:56 +03:00
zhelenskiy
ba08cbbb20 Other typos fixed 2020-10-19 16:16:56 +03:00
zhelenskiy
6e0aa007da Typos fixed 2020-10-19 16:16:56 +03:00
Ilya Goncharov
0367dec035 [Gradle, JS] Dukat change default mode onto source
- Binary only for legacy

^KT-42339 fixed
2020-10-19 16:14:27 +03:00
Konstantin Tskhovrebov
0ce6d694b7 Fix tests for as42. 2020-10-19 15:58:38 +03:00
Alexander Udalov
48cd86b717 Add JVM target bytecode version 15
#KT-41916 Fixed
2020-10-19 14:47:21 +02:00
Ilmir Usmanov
819d64a2ef Box inline class returned from suspend lambda non-locally in JVM_IR
#KT-41194 Fixed
2020-10-19 14:28:39 +02:00
Ilmir Usmanov
70a4ed3ebc Box inline class returned from suspend lambda non-locally
All inline classes should be boxed coming in and out of lambdas,
however, if the inline class was returned non-locally, it was not boxed.
This change fixes the issue in Old JVM BE.
 #KT-41194 In progress
2020-10-19 14:28:36 +02:00
anastasiia.spaseeva
c1765a5306 Add changelog for 1.4.20-M2 2020-10-19 13:15:49 +03:00
Georgy Bronnikov
b70a173595 Formatting changes 2020-10-19 12:21:13 +03:00
Georgy Bronnikov
44893e09c1 IR: remove unneeded ObsoleteDescriptorBasedAPI uses from backend.common 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
a0a6a4b0f1 JVM_IR: make ObsoleteDescriptorBasedApi use explicit in all of backend.jvm 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
305da8ee10 IR: IrFunctionReference.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
14b3beefb3 IR: IrDelegatingConstructorCall.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
b28c85f5ea IR: IrCall.fromSymbolDescriptor 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
ab3ef3a7e9 IR: remove descriptor usage 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
065edac64b IR: remove unused functions 2020-10-19 12:21:12 +03:00
Georgy Bronnikov
726282c1ee IR: remove a descriptor usage 2020-10-19 12:21:11 +03:00
Dmitriy Dolovov
c69402c800 [Commonizer] Fix computing underlyingType and expandedType in CirTypeAlias 2020-10-19 11:21:53 +03:00
LepilkinaElena
cc4d93ac71 [IR] Eliminated expensive calculating of fqNames (#3815) 2020-10-16 21:07:04 +03:00
Ilya Kirillov
4f5b2b8e22 Uncomment accidentally commented code in debugger tests 2020-10-16 20:54:50 +03:00
Mads Ager
318d11dcec [JVM_IR] Remove muting of fwBackingField.
It has been rebased and is not using this .out file at all
for JVM_IR. So in terms of testing this is a noop.
2020-10-16 19:21:08 +03:00
Mads Ager
0505bd958a [JVM] Fix the nop removal optimization.
Never remove a nop if that would cause a line number to move
across a local lifetime boundary.

This fixes KT-42725.
2020-10-16 19:21:08 +03:00
pyos
69127445a3 JVM_IR: refine the condition for caching method nodes
Don't cache non-inline `suspend fun`s if there is no `$$forInline`;
do cache `invokeSuspend` if there *is* `invokeSuspend$$forInline`.
2020-10-16 18:05:04 +02:00
Alexander.Likhachev
d6e0d2a55b [Gradle, JS] Fix K/JS project build with configuration cache (part 2)
It is still does not support configuration cache but these changes allows build to pass with warnings
#KT-42494 Fixed
2020-10-16 16:15:05 +03:00
Roman Artemev
d7db643422 Add box test for KT-33992 2020-10-16 16:02:02 +03:00
Roman Artemev
023a62395a Add box test for KT-36897 2020-10-16 16:02:01 +03:00
Dmitriy Novozhilov
5e406e8803 [FIR-IDE] Unmute passing test 2020-10-16 15:24:58 +03:00
Dmitriy Novozhilov
9f5191f2a1 [FIR-IDE] Regenerate tests 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
8cb08139e1 [FIR-IDE] Add example flag for enabling fir ide to gradle.properties 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
0e47d32587 [FIR] Properly set type of constants for java declarations 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
5f641a2552 [FIR] Add wrapping scopes with forced calculator in checkers and fir2ir 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
e75f218f87 [FIR] Rename FirDeclarationOrigin.FakeOverride to SubstitutionOverride 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
739ebf772c [FIR] Add configuring FakeOverrideTypeCalculator into ConeKotlinType.scope 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
fc23cf76d4 [FIR] Force calculation of return type of fake overrides in return type calculator 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov
f9faa5be64 [FIR] Don't force calculation of return type in substitution scope 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
06981fc0af [FIR] Move functions for fake override creating to separate objects 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
1c2fdf7e3f [FIR] Remove scope session from FirClassSubstitutionScope constructor 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
9e863c90fc [FIR] Remove redundant default values for functions in FirClassSubstitutionScope 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
e07f63d26c [FIR] Move declaration attributes to declaration builders 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
0b51fd03e2 [FIR] Add failing test for incorrect type calculation of implicit types 2020-10-16 15:24:56 +03:00
Dmitriy Novozhilov
23f1cc6b07 [FIR] Get rid of ReturnTypeCalculator in ScopeSession 2020-10-16 15:24:55 +03:00
Dmitriy Novozhilov
fae1b70605 [FIR] Fix type of this reference in copy funciton of data class 2020-10-16 15:24:55 +03:00
Leonid Startsev
0616f948c7 Use actual form of decodeSerializableElement function in 'decodeSequentially'
code path in deserialize.

Old 3-argument form is deprecated and should be removed.
2020-10-16 15:24:12 +03:00
Ilya Kirillov
1bb2eefcaa Fix find usages test testdata adding FIR_COMPARISON directive 2020-10-16 14:54:16 +03:00
Ilya Goncharov
1bc52c195c [Gradle, JS] Uninternal _target in js extension 2020-10-16 14:51:35 +03:00
Alexander.Likhachev
0b6959ee3d [Gradle, K/N] Deprecate K/N compile classpath prop in favor of libraries 2020-10-16 13:48:07 +03:00
Alexander.Likhachev
f4da283ffb [Gradle, K/N] Move build cache tests into appropriate class 2020-10-16 13:48:07 +03:00
Alexander.Likhachev
a0f4898009 [Gradle, K/N] Make compile and link tasks cacheable
Currently build cache isn't supported for frameworks as symlinks in build output is used. Symlinks are transformed into regular files by Gradle build cache and that breaks incremental build. Cinterop process task is not cacheable at the moment as it depends on OS-environment
#KT-39564 Fixed
2020-10-16 13:48:07 +03:00
pyos
a9b53adc50 JVM_IR: make primitive == object slightly less lazy.
Discarding the value used to leave an unused-but-never-destroyed
temporary variable. It's best to not separate calls to `enterTemp`
and `leaveTemp`.

Not sure what kind of test to add though, since this is minor -- if the
result of the comparison is discarded, then the entire statement is more
or less pointless.

 #KT-42251 Fixed
2020-10-16 12:25:55 +02:00
Alexander Udalov
4c09906235 Build: add kotlin.build.useIRForLibraries to enable JVM IR for libraries separately
The next step for JVM IR adoption in our project is going to be enabling
`kotlin.build.useIR`, but keeping `kotlin.build.useIRForLibraries`
disabled until we fix all remaining ABI incompatibility issues for
library code.
2020-10-16 12:13:05 +02:00
Alexander Udalov
29d8730964 Build: when using JVM IR, produce stable binaries
This is needed to allow non-JVM-IR modules depend on the modules
compiled by JVM IR. This also allows us to enable JVM IR in our build by
default now, without introducing errors to all external usages of our
compiler and other artifacts that we publish.
2020-10-16 12:13:05 +02:00
Pavel Kirpichenkov
04a4f9cde6 Minor: cover negative cases with test +m
Add case without reported diagnostic on public companion.
Only report diagnostic if @JvmStatic annotation has source in code.

KT-25114
2020-10-16 11:11:59 +03:00
Pavel Kirpichenkov
9669ab1468 Report warning on @JvmStatic in private companion objects
Deprecation cycle to prohibit in 1.5.
^KT-25114 In Progress
2020-10-16 11:11:59 +03:00
Pavel Kirpichenkov
d769ca06ab Add test for KT-25114 2020-10-16 11:11:58 +03:00
Victor Petukhov
c6da2a1138 Reuse built functional types for postponed arguments by expected types and paths from a top level type variable
^KT-42221 Fixed
2020-10-16 10:46:22 +03:00
Dmitry Petrov
ee5edf4caa JVM_IR fix 'remove' in inline class implementing MutableCollection 2020-10-16 00:02:12 +03:00
Alexander Udalov
95edcea9a9 Build: fix kotlinx-metadata-jvm publication
Co-authored-by: Vyacheslav Gerasimov <vyacheslav.gerasimov@jetbrains.com>
2020-10-15 21:13:50 +02:00
Ilya Kirillov
8dd80fe3c9 Wizard: fix maven testdata 2020-10-15 21:47:42 +03:00
Ilya Kirillov
394245ba4c Wizard: do not run compose tests for Groovy dsl 2020-10-15 21:47:39 +03:00
Ilya Kirillov
ec1528e742 Wizard: use custom Kotlin version for compose project 2020-10-15 21:47:38 +03:00
Ilya Kirillov
b0bb03d761 Wizard: return junit back to android target 2020-10-15 21:47:36 +03:00
Ilya Kirillov
42914b4046 Wizard: add resolutionStrategy for mpp library template 2020-10-15 21:47:32 +03:00
Ilya Kirillov
f5d638eb8f Wizard: do not create empty local.properties file 2020-10-15 21:47:30 +03:00
Ilya Kirillov
aeff3c2682 Wizard: regenerate tests 2020-10-15 21:47:28 +03:00
Ilya Kirillov
b7017c233e Wizard: use different Kotlin version for compose templates 2020-10-15 21:47:25 +03:00
Ilya Kirillov
1cc007fcbf Wizard: introduce Compose MPP template 2020-10-15 21:47:23 +03:00
Ilya Kirillov
7422690ea1 Wizard: fix InvalidModuleDependencyError error message 2020-10-15 21:47:19 +03:00
Ilya Kirillov
2a5679e0c6 Wizard: make project templates list scrollable 2020-10-15 21:47:16 +03:00
Ilya Kirillov
db069c3264 Wizard: add compose desktop template 2020-10-15 21:47:08 +03:00
Ilya Kirillov
d547cb9ee6 Wizard: introduce mobile mpp module template & allow module templates for mpp modules 2020-10-15 21:47:04 +03:00
Ilya Kirillov
ac6b9e4aa0 Wizard: add android extensions plugin only by flag 2020-10-15 21:47:02 +03:00
Ilya Kirillov
ed924a1c99 Wizard: change custom maven repositories rendering 2020-10-15 21:47:00 +03:00
Ilya Kirillov
31dac65a39 Wizard: remove extra line break in build files 2020-10-15 21:46:57 +03:00
Ilya Kirillov
9948c265df Wizard: add setting to hide version & groupId in gradle 2020-10-15 21:46:56 +03:00
Ilya Kirillov
d3e99bd7a7 Wizard: simplify custom maven repository syntax for Gradle 2020-10-15 21:46:55 +03:00
Ilya Kirillov
3ef12e32ee Wizard: update libraries versions 2020-10-15 21:46:51 +03:00
Ilya Kirillov
fa8951c19e Wizard: move common repositories to the allprojects section 2020-10-15 21:46:49 +03:00
Ilya Kirillov
e824199169 Wizard: remove resolutionStrategy from settings.gradle 2020-10-15 21:46:48 +03:00
Ilya Kirillov
8b89eb5dc8 Wizard: clean activity_main.xml & AndroidManifest.xml files 2020-10-15 21:46:41 +03:00
Ilya Kirillov
733cd8891a Wizard: simplify android configuration 2020-10-15 21:46:40 +03:00
dependabot[bot]
4858b72a8d Bump junit from 4.11 to 4.13.1 in /libraries
Bumps [junit](https://github.com/junit-team/junit4) from 4.11 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.11.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.11...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:38:43 +02:00
dependabot[bot]
f69928d2b1 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:38:23 +02:00
dependabot[bot]
845d6ae063 Bump junit in /libraries/tools/kotlin-maven-plugin/src/it/simple
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:38:06 +02:00
dependabot[bot]
b778298486 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:37:56 +02:00
dependabot[bot]
f3c26af0c7 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:37:40 +02:00
dependabot[bot]
c2ed625f25 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:37:24 +02:00
dependabot[bot]
e9255c8f17 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:37:10 +02:00
dependabot[bot]
41123be3a2 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:36:55 +02:00
dependabot[bot]
3f27bb374a Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:36:41 +02:00
dependabot[bot]
fb7736377c Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:36:25 +02:00
dependabot[bot]
df202c9b3f Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:36:12 +02:00
dependabot[bot]
7fe9966e02 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:35:56 +02:00
dependabot[bot]
046ed1e08c Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:35:41 +02:00
dependabot[bot]
0396ed29cc Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:35:27 +02:00
dependabot[bot]
2a9e6df9b1 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:35:12 +02:00
dependabot[bot]
1bf2a6b013 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:34:54 +02:00
dependabot[bot]
797c02e1cb Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:34:39 +02:00
dependabot[bot]
916f9766ad Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:34:05 +02:00
dependabot[bot]
c012b16430 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:33:55 +02:00
dependabot[bot]
74ad4eb00e Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:33:35 +02:00
dependabot[bot]
e888f54ae8 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:33:14 +02:00
Alexander Udalov
0eea089cc1 Merge pull request #3821 from JetBrains/dependabot/maven/libraries/tools/kotlin-maven-plugin-test/src/it/test-helloworld/junit-junit-4.13.1
Bump junit from 4.9 to 4.13.1 in /libraries/tools/kotlin-maven-plugin-test/src/it/test-helloworld
2020-10-15 20:33:06 +02:00
dependabot[bot]
209d5fd6c9 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-15 20:32:53 +02:00
Mikhael Bogdanov
c8e84f82eb Proper check NON_JVM_DEFAULT_OVERRIDES_JAVA_DEFAULT in new jvm-default modes
#KT-42699 Fixed
2020-10-15 16:26:00 +02:00
Mikhael Bogdanov
b6dc99b98e Skip java defaults in EXPLICIT_OVERRIDE_REQUIRED_IN_MIXED_MODE check
#KT-42674 Fixed
2020-10-15 16:26:00 +02:00
sebastian.sellmair
a60febbdfb KotlinMPPGradleProjectResolver: Ensure that artifactsMap is populated when Android plugin applied
#KT-42381 fixed
2020-10-15 13:23:21 +00:00
Victor Turansky
b42795a9ea Bump 'com.gradle.plugin-publish' from 0.11.0 to 0.12.0 (#3853) 2020-10-15 15:46:34 +03:00
Juan Chen
09acea5548 [FIR]: Set proper classId to enum entries
FirVisibilityChecker::isVisible checked if a private declaration can be
accessed at a use site by matching class ids of the private
declaration's owner with the use site's containing class
declarations. When the private declaration is defined in an enum
entry and used in the same entry, its owner class id has the enum
entry name, but the use site is in an FirAnonymousObject, which has
"anonymous" as the class id. This causes visibility check to fail.

This PR fixes owner class ids of declarations defined in enum entries
to be the same as normal anonymous objects.
2020-10-15 14:46:22 +03:00
Jinseong Jeon
ed188204b4 FIR checker: make property init analyzer path-sensitive
In particular, exception throwing path after finally block is
distinguished via path label.

KT-42350 Fixed
2020-10-15 14:22:39 +03:00
Jinseong Jeon
6fc3f7e776 FIR CFG: label edges from try-enter through finally block to exit target 2020-10-15 14:22:39 +03:00
Jinseong Jeon
43852ad7ab FIR CFG: add edges from try/catch to finally 2020-10-15 14:22:39 +03:00
Jinseong Jeon
ea2f773e54 FIR checker: reproduce KT-42350 2020-10-15 14:22:38 +03:00
Alexander Udalov
da69e3db7c kotlinx-metadata-jvm: report error on using metadata version < 1.4 in writers
The main reason for this change is that the current API for class
version requirements (`KmClass.versionRequirements`) makes it impossible
to support pre-1.4 metadata where this was stored incorrectly for nested
classes: with the "version requirement table" in the outer class, and
indexes into that table in nested classes. See KT-41011.

Other than this aspect, metadata of classes is basically the same in
pre-1.4 and 1.4, which means that if some kotlinx-metadata-jvm users
really need to serialize metadata of an earlier version and they don't
care about the version requirements issue, they can just use these new
bytes but write the earlier version (e.g. 1.1) to the class file.
Everything will work the same, except for the possible version
requirements issue mentioned above.

Note that metadata version 1.4 is still supported for
`KotlinModuleMetadata.Writer` though.

 #KT-41011 Fixed
2020-10-15 13:10:01 +02:00
Alexander Udalov
5d7d9beb0d kotlinx-metadata-jvm: remove bytecodeVersion from write methods
Bytecode version has never been used meaningfully in Kotlin, and will be
removed in a future release, so there's no point in using it. See
KT-41758.
2020-10-15 13:10:01 +02:00
Alexander Udalov
90d66b0ba5 kotlinx-metadata: reformat, cleanup, fix inspections 2020-10-15 13:10:01 +02:00
Roman Artemev
c89c31cd29 [KLIB] Fix package name (js -> common) 2020-10-15 13:55:06 +03:00
Roman Artemev
07a1124b99 [KLIB] Support error code in metadata 2020-10-15 13:55:06 +03:00
Roman Artemev
f4830c88b9 [JS IR] Make error code tests modular 2020-10-15 13:55:06 +03:00
Roman Artemev
0f7032051b [JS IR] Fix klib generation (proper order of flags) 2020-10-15 13:55:06 +03:00
Roman Artemev
a4945878aa [KLIB] Pass containsErrorCode flag from library/IC cache into deserializer
- Make deserializer track whether error node are allowed.
2020-10-15 13:55:05 +03:00
Roman Artemev
28c6d17ab4 [KLIB] Mark klib that contains error with special flag 2020-10-15 13:55:05 +03:00
Roman Artemev
98e5510871 [KLIB] Support IrError* nodes in serialization 2020-10-15 13:55:05 +03:00
Roman Artemev
934141f8af [KLIB] Support IrError* nodes in klib proto
- add proto messages
 - regenerate java-proto
 - support in reader to make code compiled
2020-10-15 13:55:05 +03:00
Roman Artemev
8ce497c7ef [IR] Add wrapped descriptor for error declaration 2020-10-15 13:55:05 +03:00
Mikhail Zarechenskiy
eacc94a89d Do not hide synthetic properties except isEmpty from Java
In order to hide synthetic property isEmpty from JDK 15, there was
 added additional logic in 5cc12b49fc but
 it also lead to the fact that now it's impossible to call synthetic
 property `declaringClass` on `Enum` as it's in the same list as method
 isEmpty(). Note that it's questionable behavior, probably we should
 also hide `declaringClass` as well but for now we turn it back to
 preserve compatibility

 #KT-42467 Fixed
2020-10-15 12:26:17 +03:00
Yaroslav Chernyshev
4227e2dc40 [Cocoapods] Fix task and directory naming to avoid subspecs collision
Logics of generating name for dependencies downloaded from git or url
admits producing tasks with forbidden symbols inside name for subspecs.
This fix introduces replacing of forbidden symbols for such purposes.

#KT-42550 Fixed
2020-10-15 09:59:33 +03:00
Jinseong Jeon
b8817d5884 FIR2IR: clean up dead code regarding overriding utils 2020-10-15 08:47:46 +03:00
Jinseong Jeon
5f64d6ec76 FIR2IR: add support for callable reference to Java field
#KT-42656 Fixed
2020-10-15 08:47:46 +03:00
Jinseong Jeon
65545a10c4 FIR: reproduce KT-42656 2020-10-15 08:47:46 +03:00
Derek Bodin
96834d6f4c Update example for default buildList to not use capacity KT-41136 (#3688) 2020-10-15 01:56:57 +03:00
Vladimir Dolzhenko
d9b3f91d73 Support hasError in ide perf tests vega charts 2020-10-15 00:09:48 +02:00
Vladimir Dolzhenko
051d914996 Align ide perf tests vega charts with json reports camelCase propNames
fix handling test errors
2020-10-14 21:31:03 +02:00
Ilya Kirillov
98efdaa523 FIR IDE: fix KtTypeRendererTest 2020-10-14 22:11:12 +03:00
Ilya Kirillov
5cda4b5ab3 fix test generator compilation 2020-10-14 22:11:12 +03:00
Ilya Kirillov
29151665e1 FIR IDE: add fir ide plugin tests task 2020-10-14 22:11:11 +03:00
Ilya Kirillov
bd68b937e5 FIR: ignore testdata directory in testPsiConsistency test 2020-10-14 22:11:10 +03:00
Ilya Kirillov
5c798d4e13 FIR IDE: fix test data in fir-ide module 2020-10-14 22:11:10 +03:00
Ilya Kirillov
6086b54a06 FIR IDE: do preliminary highlighting in completion tests considering exceptions 2020-10-14 22:11:09 +03:00
Ilya Kirillov
b9cf9d8bc5 FIR IDE: add missing test dependency 2020-10-14 22:11:09 +03:00
Ilya Kirillov
2f093e76b0 FIR IDE: render resolve phase for lazy resolve tests 2020-10-14 22:11:08 +03:00
Ilya Kirillov
9c53c66bb5 FIR IDE: actualize testdata for idea-frontend-fir module 2020-10-14 22:11:08 +03:00
Ilya Kirillov
a585d20639 FIR IDE: fix bodies calculator for property acessors 2020-10-14 22:11:07 +03:00
Ilya Kirillov
ab4faa52f0 FIR IDE: add missing IdeSessionComponents for FirIdeBuiltinsAndCloneableSession 2020-10-14 22:11:06 +03:00
Ilya Kirillov
a22514cf8e FIR IDE: separate lazy phase into 3 phases, add contracts phase 2020-10-14 22:11:06 +03:00
Ilya Kirillov
c418140bef FIR IDE: fix test dependencies 2020-10-14 22:11:05 +03:00
Ilya Kirillov
dc467f7d6c FIR: add test which checks that we do not access lazy bodies & lazy expressions till contract phase 2020-10-14 22:11:04 +03:00
Ilya Kirillov
7611135a4a FIR: add raw fir building delegate expression test 2020-10-14 22:11:04 +03:00
Ilya Kirillov
971e551bae FIR IDE: implement lazy delegate initializers 2020-10-14 22:11:00 +03:00
Ilya Kirillov
3f9735dd5d FIR: use enum in RawFirBuilder to indicate its mode: normals, stubs, or lazy bodies 2020-10-14 22:11:00 +03:00
Ilya Kirillov
81d4371685 FIR IDE: generate lazy initializers for properties 2020-10-14 22:10:59 +03:00
Ilya Kirillov
7c1170722f FIR: add FirLazyExpression node 2020-10-14 22:10:58 +03:00
Ilya Kirillov
71b5b6df7c FIR IDE: add tests for lazy resolving single declaration in file 2020-10-14 22:10:58 +03:00
Ilya Kirillov
f4199a0729 FIR: add ability to render declaration phase in FirRenderer 2020-10-14 22:10:57 +03:00
Ilya Kirillov
bbf450703f FIR: introduce stub bodies raw fir test case 2020-10-14 22:10:56 +03:00
Ilya Kirillov
d2d330c3be FIR IDE: implement lazy functions, constructors & accessors bodies building for raw fir
test
2020-10-14 22:10:56 +03:00
Ilya Kirillov
4fae9cbdb0 FIR: introduce FirLazyBlock node 2020-10-14 22:10:55 +03:00
Ilya Kirillov
864800902b FIR IDE: introduce WeakFirByPsiRef 2020-10-14 22:10:55 +03:00
Mads Ager
17748b4499 [JVM_IR] Fix off-by-one line number error in CoroutineCodegen.
Fixes KT-41957.
2020-10-14 20:57:42 +02:00
pyos
13def12731 IR: remove unnecessary calls to deepCopyWithSymbols
to make it harder to hide incorrect uses.
2020-10-14 20:25:20 +02:00
Alexander Udalov
45a0850d95 Fix KotlinType.isNullabilityFlexible for types based on type parameters
In the compiler, this function was used in psi2ir (and it affected
nullability annotations in the resulting JVM class files), in "useless
elvis with null on the right side" diagnostic checker, and in light
classes.

 #KT-42650 Fixed
2020-10-14 19:32:51 +02:00
Alexander Udalov
fbf56c054b JVM IR: fix names of $annotations methods for internal properties
#KT-40384 Fixed
2020-10-14 19:32:51 +02:00
Alexander Udalov
3f73be391f JVM IR: fix names of $annotations methods with inline classes in signature
#KT-40385 Fixed
2020-10-14 19:31:58 +02:00
Alexander Udalov
1df3bafbaf Minor, fix and unmute fieldNameClash.kt test
#KT-31927
2020-10-14 16:53:58 +02:00
Alexander.Likhachev
ec877843fc [Gradle, K/N] Increase Xmx for MPP tests with native 2020-10-14 17:13:32 +03:00
Mikhail Glukhikh
babc7845af FirSyntheticPropertiesScope: support case with derived getter
#KT-42496 Fixed
2020-10-14 16:33:44 +03:00
Mikhail Glukhikh
2f9b7495fc [FIR2IR] Make safe call result always nullable 2020-10-14 16:33:37 +03:00
Dmitry Petrov
d623f4d1d6 Add test for KT-40190 2020-10-14 16:05:15 +03:00
Alexander.Likhachev
d3f98923dc [Gradle, JS] Fix K/JS project build with configuration cache enabled
KT-42494 Fixed
2020-10-14 15:10:34 +03:00
Alexander.Likhachev
82a66bc659 [Gradle, K/N] Remove wasm from VariantAwareDependenciesIT 2020-10-14 15:10:34 +03:00
Alexander.Likhachev
e505c6473d [Gradle, K/N] Remove check for export API from libraries producing test 2020-10-14 15:10:34 +03:00
Alexander.Likhachev
72ad581fe4 [Gradle, K/N] Change prefix of apple-specific tests to native-*
The commit does nothing but renaming of directories
2020-10-14 15:10:34 +03:00
Alexander.Likhachev
3ab99c1f96 [Gradle, K/N] Reduce number of targets in MPP tests 2020-10-14 15:10:34 +03:00
Alexander.Likhachev
3dda02459d [Gradle, K/N] Add more cases for cinterop test 2020-10-14 15:10:34 +03:00
Alexander.Likhachev
be7cc32c10 [Gradle, K/N] Add export API test for frameworks 2020-10-14 15:10:34 +03:00
Alexander.Likhachev
7c2339bcad [Gradle, K/N] Move compiler version change to separate test 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
f0aa4a59e3 [Gradle, K/N] Tests cleanup 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
4b68678a36 [Gradle, K/N] Add release binaries to generate binaries tests 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
08ee702d19 Update Kotlin/Native: 1.4.30-dev-16766 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
5dd1e75793 [Gradle, K/N] Configure memory properties for tests in single place 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
780b85e3ec [Gradle, K/N] Simplify testNativeTests test by reducing number of targets 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
882f442848 [Gradle, K/N] Simplify native cinterop test 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
7523b401c3 [Gradle, K/N] Remove wasm32 from mpp tests compile tasks 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
79ba6df7b8 [Gradle, K/N] Remove "kotlinx.html" maven repository from tests 2020-10-14 15:10:33 +03:00
Alexander.Likhachev
03ee0f60ea [Gradle, K/N] Add workaround for iOS simulator warning report check 2020-10-14 15:10:32 +03:00
Alexander.Likhachev
00cbfa9eb4 [Gradle, K/N] Simplify native binaries DSL test 2020-10-14 15:10:32 +03:00
Alexander.Likhachev
4f8503dc30 [Gradle, K/N] Reduce number of targets in tests 2020-10-14 15:10:32 +03:00
Alexander.Likhachev
8aa9ef5049 [Gradle, K/N] Enable compiler daemon in tests 2020-10-14 15:10:32 +03:00
Alexander.Likhachev
923e7f7de5 [Gradle, K/N] Create new framework producing test 2020-10-14 15:10:32 +03:00
Ilya Matveev
76e03842ae [Gradle, K/N] Refactor native-specific Gradle tests 2020-10-14 15:10:32 +03:00
Ilya Matveev
71fe60f4a2 [Gradle, K/N] Rename native native-specific test projects
Some native-specific tests was moved from NewMultiplatformIT
but test projects used by them still have the "new-mpp" prefix.
This patch replaces this prefix with "native".
2020-10-14 15:10:32 +03:00
Ilya Matveev
174e390d2c [Gradle, K/N] Add separate tasks for native-specific Gradle tests
Native-specific tests are removed from default test tasks.
2020-10-14 15:10:32 +03:00
Ilya Matveev
d971817c32 [Gradle, K/N] Move native-specific tests to a separate class from MPP
This patch just copies the tests without any refactoring.
2020-10-14 15:10:31 +03:00
Jinseong Jeon
4d28463f1a FIR CLI: initialize module and dependencies
#KT-42624 Fixed
2020-10-14 14:56:37 +03:00
Yaroslav Chernyshev
01ba1cded7 [Cocoapods] Minor. Fix CocoaPodsIT, test data update 2020-10-14 12:21:58 +03:00
Alexander Dudinsky
36dd883768 Update testData of testKt28385 for 202 version 2020-10-14 12:15:07 +03:00
Roman Artemev
9ef7273641 Unmute stdlib tests after bootstrap advance. 2020-10-14 12:06:02 +03:00
Dmitriy Dolovov
3d8b614778 [Commonizer] Allow debugging through "runCommonizer" Gradle task 2020-10-14 09:33:12 +03:00
Dmitriy Dolovov
f49f5cb3d5 [Commonizer] Fix classpath for "runCommonizer" Gradle task 2020-10-14 09:33:06 +03:00
Ilya Kirillov
f27bf04911 Perf test: remove info markers in testdata before test 2020-10-14 02:04:10 +03:00
Pavel Punegov
4b3455dfa1 Set backend for the test 2020-10-13 22:02:16 +03:00
nataliya.valtman
58ed1bbb64 Can't use configure action from Immutable state
#KT-42413 Fixed
2020-10-13 21:02:00 +03:00
Dmitriy Novozhilov
9147aa76b5 Advance bootstrap to 1.4.30-dev-1423 2020-10-13 20:50:10 +03:00
Dmitry Petrov
052f345a17 JVM_IR no generic signatures for abstract stubs KT-42609 2020-10-13 19:20:29 +03:00
Dmitry Petrov
c8bf74c7d5 Bytecode listing test fails if JVM and JVM_IR have same testData 2020-10-13 19:20:29 +03:00
Nikolay Krasko
51e2b9d33d Enable signing using gpg in KotlinBuildPublishingPlugin (KTI-355)
Add skip for generated Sign task because otherwise added
 signatory is forcing task activation.

```Execution failed for task ':kotlin-allopen:signMainPublication'.
org.gradle.api.InvalidUserDataException: Cannot perform signing task
':kotlin-allopen:signMainPublication' because it has no configured
signatory```

 #KTI-355 Fixed
2020-10-13 18:29:32 +03:00
Alexander Udalov
1b39a235d8 JVM IR: sort multifile part names in metadata 2020-10-13 16:40:53 +02:00
Alexander Udalov
b257b03152 JVM IR: do not generate JvmName on multifile parts
#KT-36970 Fixed
2020-10-13 16:40:52 +02:00
Alexander Udalov
0eccb9661f JVM IR: simplify staticDefaultFunctionPhase
Also fix quadratic complexity similar to the previous commit.
2020-10-13 16:11:17 +02:00
Alexander Udalov
1859d4d340 JVM IR: avoid quadratic complexity in InheritedDefaultMethodsOnClassesLowering
Visiting all children and not stopping on classes made
`ClassLoweringPass.runOnFilePostfix` perform with the complexity of the
square of the amount of class nesting levels.
2020-10-13 16:11:17 +02:00
Vladimir Dolzhenko
5ca4c2ce1a Use camelCase propNames in ide perf tests json stats; report hasError 2020-10-13 15:17:45 +02:00
Jinseong Jeon
bc6693fa6e FIR2IR: element-wise SAM conversion for vararg 2020-10-13 15:40:06 +03:00
Nikolay Krasko
5d394528f6 Fix double publication of javadoc in kotlin-osgi-bundle (KTI-356)
There's a common place with generating empty javadoc:
635ffcd53b/libraries/pom.xml (L187)

 #KTI-356 Fixed
2020-10-13 15:16:14 +03:00
Dmitry Savvinov
e06ae01c0c Restore nullability after type refinement along with annotations
See the issue for details

^KT-42546 Fixed
2020-10-13 13:48:43 +03:00
Ilya Kirillov
ee794f8664 FIR IDE: add check canceled between diagnostics 2020-10-13 12:03:06 +03:00
Pavel Kirpichenkov
9dd3d8fb14 [NI] Fix extension function check after commonization
`isExtensionFunction` property is false for suspend functions
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
c53011dd04 [FIR] mute builder inference test
^KT-42591 Open
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
39a87435ee [FIR/NI] Refactor type variable gathering from lambda types
Motivation:
- drop getArguments from type context as a duplicate of getArgumentList
- reduce the number of collection allocations in getAllDeeplyRelatedTypeVariables

Additional minor improvements, test data fixes
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
ef44077cb7 [FIR] Restore variable fixation direction in call completion
Several tests are affected by the usage of fixation direction calculator in FIR.
Restored to mimimize test data changes.

It is unnecessary in FE10 because a type variable with unknown type
is inferred into an error type, but affects test data in FIR where
Nothing/Any is selected by direction (as a temporary measure).

CR candidate in spec test is Unresolved in FIR because top-level CRs are resolved as call arguments.
Resolution ambiguity is also present in FE10 when CR is wrapped into an id call.
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
712a2ce1ab [FIR] Improved lambda completion: initial implementation
Repeat the logic of KotlinConstraintSystemCompleter in ConstraintSystemCompleter.
Implement additional context operations required for updated lambda completion algorithm.
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
5eae6f2f4e [FIR] Move PostponedArgumentInputTypesResolver to resolution.common 2020-10-13 11:00:20 +03:00
Pavel Kirpichenkov
3822a32fce [FIR] Prepare commonization of PostponedArgumentInputTypesResolver 2020-10-13 11:00:20 +03:00
Victor Petukhov
0685beb765 NI: do substitution type variables during updating trace for lambda (these type variables can appear after the builder inference)
^KT-42450 Fixed
2020-10-13 10:21:55 +03:00
dependabot[bot]
1ca5bef7e6 Bump junit
Bumps [junit](https://github.com/junit-team/junit4) from 4.9 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.9...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 22:18:57 +00:00
Alexander Udalov
e399b4cd12 JVM IR: minor, sort ElementType fields as in the old backend
In the old backend, targets are generated in the order of their
declaration in the ElementType enum, see AnnotationCodegen.java:306
(EnumSet guarantees such iteration ordering).

This has no effect other than reducing non-essential differences when
comparing ABI of JVM vs JVM_IR.
2020-10-12 21:38:09 +02:00
Alexander Udalov
1daeebcdd3 Minor, add regression test
#KT-42562
2020-10-12 21:37:37 +02:00
pyos
2ff011af17 JVM_IR: add an assertion and a comment about property references
I once again forgot why we don't cache property reference classes and
had to refer to the internal chat.
2020-10-12 21:14:00 +02:00
pyos
1663619606 JVM_IR: add local delegated property metadata to non-synthetic classes
Otherwise kotlin-reflect won't find it (and it won't even be serialized
anyway).

 #KT-42562 Fixed
2020-10-12 21:14:00 +02:00
pyos
2974004de4 JVM_IR: make PropertyReferenceLowering less quadratic
ClassLoweringPass creates a visitor and calls lower() on each class,
which then creates another visitor that does not override `visitClass`
to ignore the nested classes. This is generally not a good idea.
2020-10-12 21:14:00 +02:00
Ilmir Usmanov
d7b9920eba Treat field initializer as class initializer
when checking for allowance of other field initialization in lambda
with EXACTLY_ONCE contract.
 #KT-40948 Fixed
2020-10-12 20:16:21 +02:00
Ilmir Usmanov
3b5706972e Extract effect from lambda argument if it is in parentheses
Otherwise, contracts on the parameter have no effect.
 #KT-42044 Fixed
 #KT-26229 Fixed
2020-10-12 20:16:19 +02:00
Dmitry Petrov
df64bb3eb7 JVM_IR emulate JVM hack for generic signatures in KT-18189
KT-40307

See also KT-42609
2020-10-12 21:14:48 +03:00
Steven Schäfer
f20a695c0e Minor: Rebase testGenericConstructorCallWithTypeArguments 2020-10-12 17:34:34 +02:00
Victor Petukhov
c89461e654 JSpecify: add gradle task to download JSpecify test suite 2020-10-12 17:33:35 +03:00
Victor Petukhov
d0cd7a4008 JSpecify: exclude test running from the common test task 2020-10-12 17:33:35 +03:00
Victor Petukhov
9dab052266 JSpecify: implement tests generator and test runner with checking compliance of kotlin diagnostics and jspecify marks 2020-10-12 17:33:35 +03:00
Victor Petukhov
f39e2d4a2d JSpecify: convert java use sites for existing tests to kotlin ones 2020-10-12 17:24:35 +03:00
Victor Petukhov
ce44f7d4d3 JSpecify: implement kotlin use sites to java ones converter 2020-10-12 17:24:31 +03:00
Victor Petukhov
520e35baaf JSpecify: rework tests – replace kotlin use sites to java ones with future j2k conversion 2020-10-12 17:24:29 +03:00
Victor Petukhov
8974128be4 JSpecify: remove annotations unsupported yet 2020-10-12 17:24:27 +03:00
Victor Petukhov
fb8bba4dfb Include kotlin reflect test runtime dependency for tests-java8 module to make jps tests running work 2020-10-12 17:24:26 +03:00
Vladimir Dolzhenko
677f5ca4e3 Don't keep ref to ABSENT_KOTLIN_INJECTION in companion object
As it prevents from dynamic reloading of plugin

^KT-39958 Fixed
2020-10-12 13:09:18 +00:00
Vladimir Dolzhenko
7c2112d014 Prepare for KT dynamic plugin: make EP dynamic
Relates to ^KT-38518
2020-10-12 13:09:17 +00:00
Vladimir Dolzhenko
0e7e24c498 Add more diagnostics to address invalid module
Relates to ^KT-42274
2020-10-12 13:03:22 +00:00
Roman Artemev
fa7104213c Temporary disable test until bootstrap is updated 2020-10-12 15:22:44 +03:00
Roman Artemev
f824bb6987 [JS BE] Merge Legacy and IR BE exceptions-related test data
- regenerate tests
 - add consistency test
2020-10-12 15:22:44 +03:00
Roman Artemev
c16b11a124 [JS IR BE] Fix throwable stuff to make exceptions similar to JVM 2020-10-12 15:22:43 +03:00
Roman Artemev
ff093d363a [JS IR BE] Fix Throwable ancestor transformation
Make sure that `message` and `cause` are properly configured

 - synchronize IR BE and Legacy behaviour
 - fix corresponding IR lowering
 - fix JS IR core runtime
 - add test
 - fix KT-39964
2020-10-12 15:22:43 +03:00
Roman Artemev
383146f836 [JS IR BE] Add compiler instrinsic to express undefined value in BE 2020-10-12 15:22:43 +03:00
Dmitriy Novozhilov
f794ced888 [FIR] Fix incorrect cluster creating in CFG dumps 2020-10-12 11:55:05 +03:00
Dmitriy Dolovov
3495ec198d Minor. Small clean-up in KLIB decompiler 2020-10-12 10:24:18 +03:00
Vladimir Dolzhenko
3eeaa07e0c Sync up plugin.xml AS42 with 202
Relates to #KT-42274
2020-10-12 06:49:43 +00:00
Mads Ager
f941733f13 [JVM_IR] Rebase init blocks stepping test that is working as intended. 2020-10-12 08:36:17 +02:00
Vladimir Dolzhenko
a9bc63dece Drop redundant legacy_name from ide perf tests json stats 2020-10-10 23:57:39 +02:00
Alexander Udalov
a4fb2a445f Minor, add spaces to diagnostic message 2020-10-09 22:11:37 +02:00
Alexander Udalov
ac39e4d89c Minor, add regression test
#KT-42554
2020-10-09 22:11:37 +02:00
pyos
6f9f437f15 IR: refuse to copy classes in InitializersLowering 2020-10-09 22:11:00 +02:00
pyos
e6c0575d3a JVM_IR: do not deep-copy suspend lambdas in initializers
This loses reflection metadata (and also sometimes fails). Which was
missing anyway - this is also fixed now.

 #KT-42554 Fixed
2020-10-09 22:11:00 +02:00
Mark Punzalan
8bc7370b92 ForLoopsLowering: Add PLUSEQ origin to increment to use IINC
instructions if possible.
2020-10-09 21:34:56 +02:00
Mark Punzalan
14137cb013 ForLoopsLowering: Remove additionalNotEmptyCondition as it is no
longer used in UntilHandler.
2020-10-09 21:34:56 +02:00
Mark Punzalan
ccbf7cc2ee ForLoopsLowering: Use last-exclusive for-loops for optimized until
progressions instead of decrementing "last".

#KT-41352 Fixed
2020-10-09 21:34:56 +02:00
Mark Punzalan
1adb130509 ForLoopsLowering: Move isLastInclusive to HeaderInfo. 2020-10-09 21:34:56 +02:00
Mark Punzalan
a093efde11 Add blackbox test for KT-42533. 2020-10-09 21:34:56 +02:00
Ilmir Usmanov
375d92cf67 Merge two consequent records in LVT
Otherwise, atomicfu will be unable to transform atomic variable usages.
2020-10-09 18:36:37 +02:00
Dmitry Petrov
91b8e32d43 Add ABI tests for classes extending Number and CharSequence 2020-10-09 16:36:35 +03:00
Dmitry Petrov
6dd2d8bbdb JVM_IR drop 'SpecialMethodWithDefaultInfo#needsArgumentBoxing' 2020-10-09 16:06:09 +03:00
Dmitry Petrov
a412596d8e JVM_IR emulate old back-end behavior in special bridges + inline classes
KT-42491 KT-42539
2020-10-09 16:06:08 +03:00
Dmitry Petrov
92fa13cbab Workaround for a possible compiler bug in object literals 2020-10-09 16:06:08 +03:00
Dmitry Gridin
23beaa5883 [formatter] add tests for line indent after properties
^KT-42560
2020-10-09 20:03:48 +07:00
Dmitry Gridin
434139d986 Revert "Add indent before accessor for extension property (KT-33131)"
This reverts commit ab34f8c7

^KT-42560 Fixed
2020-10-09 19:44:50 +07:00
Ilya Kirillov
852d705c71 FIR: optimize converting string expressions in raw FIR builder
Do get ASTNode for every string template entry as it is expensive operation
2020-10-09 15:00:56 +03:00
Ilya Kirillov
5937ffae4d FIR: optimize checking if placeholder projection for raw FIR builder 2020-10-09 15:00:55 +03:00
Ilya Kirillov
bbc641b390 FIR: do not get statement text for every statement in raw FIR builder
PsiElement.getText This is rather expensive operation
2020-10-09 15:00:55 +03:00
Ilya Goncharov
b1768d805f [Gradle, JS] Rename dukatMode to externalsOutputFormat
^KT-42339 fixed
2020-10-09 13:58:34 +03:00
Ilya Goncharov
3ad6d58153 [Gradle, JS] Execute dukat on import in both mode
^KT-42339 fixed

[Gradle, JS] Fix tests for dukat

^KT-42339 fixed

[Gradle, JS] Add tests on binaries-both mode

^KT-42339 fixed

[Gradle, JS] Remove snapshot versions

^KT-42339 fixed

[Gradle, JS] Fix file dependency resolution into imported package

^KT-42339 fixed
2020-10-09 13:58:34 +03:00
Ilya Goncharov
0a86beeb64 [Gradle, JS] Add descriptors to dependencies in configurations phase
- Add file collection dependencies to gradle node module building

^KT-42339 fixed
2020-10-09 13:58:34 +03:00
Ilya Goncharov
af65365d6a [Gradle, JS] Move gradle post processing after executing of dukat
^KT-42339 fixed

[Gradle, JS] Use 2 integrated tasks for dukat in both mode

^KT-42339 fixed

[Gradle, JS] Dukat into jar

^KT-42339 fixed
2020-10-09 13:58:33 +03:00
Ilya Goncharov
4eea52e4e7 [Gradle, JS] Add TaskAction on overriden method for integrated task
^KT-42339 fixed

[Gradle, JS] Temporarily used next version of dukat

^KT-42339 fixed
2020-10-09 13:58:33 +03:00
Ilya Goncharov
b37414ae0b [Gradle, JS] Add test on compilation with dukat binaries
^KT-42339 fixed
2020-10-09 13:58:33 +03:00
Ilya Goncharov
c1fe8defd2 [Gradle, JS] Dukat descriptors
^KT-42339 fixed
2020-10-09 13:58:33 +03:00
Ilya Goncharov
500fceb438 [Gradle, JS] Add binary dukat mode
^KT-42339 fixed

[Gradle, JS] Prepare sources and binary modes for dukat

^KT-42339 fixed
2020-10-09 13:58:33 +03:00
Dmitry Savvinov
f50851a982 Fix testdata after migrating to NewKotlinTypeCheckerImpl in OverrideResolver
- In kt10409 both 'pipe'-declarations contain error type.
NewKotlinTypeChecker in OverrideResolver considers error types as equal,
thus they are matched as bound declarations, thus 'IterablePipeline'
isn't considered to contain abstract member, thus no suggestion to add
abstract modifier.
Because initially test was covering purely technical issue of working
with error types, instead of removing it completely the additional
abstract member has been added

- in kt10808 we don't add explicit type anymore because
'noTypeInference' is false, because both expected type and actual type
are error-types, and KotlinIntroduceVariableHandler explicitly uses type
checker with 'errorTypesEqualToAnything=false'.
Also, this change might be ultimately seen as small improvement, because
if one extracts something with error type, they would certainly prefer
it to have a proper type as soon as errors are resolved (i.e. additional
code/imports written), rather than having a useless Any-type.
2020-10-09 13:44:06 +03:00
Dmitry Savvinov
f02593074f Drop isEqualTypeConstructor in favour of areEqualTypeConstructors 2020-10-09 13:44:06 +03:00
Dmitry Savvinov
fc4b488d43 Use NewKotlinTypeChecker in OverridingUtil
This allows to use deep type refinement in OverridingUtil, fixing issues
with expect/actuals in composite types
2020-10-09 13:44:06 +03:00
Dmitry Savvinov
01d6181050 Add test on overriding declaration with a composite type with expect declaration 2020-10-09 13:44:06 +03:00
Dmitry Savvinov
f8b9011667 Minor: unify error reporting for fun/properties overriding 2020-10-09 13:44:05 +03:00
Dmitry Savvinov
ac63d8b3bf Unify code for checking return type on override for fun/property
This fixes issues with the refinement of property' return type because
for functions' return type we already perform refinement properly
2020-10-09 13:44:05 +03:00
Dmitry Savvinov
736ecf3e9f Add test case on overriding property of expect-type
Current behaviour is undesired, the fix is in the next commit
2020-10-09 13:44:05 +03:00
Dmitry Savvinov
ac107f362e Refine types of type parameters before checking their equality in OverridingUtil 2020-10-09 13:44:05 +03:00
Dmitry Savvinov
80f4061a3d Add test on override with expect in return type 2020-10-09 13:44:04 +03:00
Vladimir Dolzhenko
f8b8f94040 Adjust vega IDE performance test charts 2020-10-09 11:03:26 +02:00
Mikhail Glukhikh
a6efaf440a FIR supertypes: replace class phase even if it hasn't unresolved supers 2020-10-09 09:45:46 +03:00
Mikhail Glukhikh
94302614cd [FIR] Add forgotten resolving status of enum entries (by Dmitry) 2020-10-09 09:45:45 +03:00
Dmitriy Novozhilov
5fbe715871 [FIR] Add forgotten replacing resolve phase during type resolve 2020-10-09 09:45:45 +03:00
Mikhail Glukhikh
1f5797e929 Don't resolve annotation arguments in FirTypeResolveTransformer 2020-10-09 09:45:45 +03:00
Mikhail Glukhikh
6f89385aec Transform forgotten property annotations in FirTypeResolveTransformer 2020-10-09 09:45:44 +03:00
Mikhail Glukhikh
e5463be6ba Don't transform parameter default values in FirTypeResolveTransformer 2020-10-09 09:45:44 +03:00
Mikhail Glukhikh
bdec245424 Don't transform enum entry initializer in FirTypeResolveTransformer 2020-10-09 09:45:44 +03:00
Mikhail Glukhikh
880eb6da6c Don't transform delegated constructor args in FirTypeResolveTransformer 2020-10-09 09:45:43 +03:00
Alexander Udalov
949952e766 kotlinx-metadata: minor, remove incorrect ReplaceWith from IS_PRIMARY deprecation 2020-10-08 17:44:35 +02:00
Mads Ager
afd710292a [JVM_IR] Fix mangling of default argument stubs for internal methods.
The MethodSignatureMapper expected to be able to look at the body
of the default argument stub. That is of course not possible when
it is from an external dependency.

Instead, we go through the attribute owner to get to the method
the stub is a default argument adapter for.
2020-10-08 17:43:24 +02:00
Jinseong Jeon
8c88670185 FIR: copy constructor for typealias'ed inner/nested class 2020-10-08 16:33:13 +03:00
Svyatoslav Kuzmich
5e5712afbb [JS IR] Make JsExport not fail on companion objects (KT-37829) 2020-10-08 14:07:50 +03:00
Victor Petukhov
9f716ba37c Jspecify: Rename DefaultNotNull to DefaultNonNull 2020-10-08 14:00:10 +03:00
Victor Petukhov
c3bada44cf Jspecify: Rename NullnessUnknown to NullnessUnspecified 2020-10-08 14:00:10 +03:00
Victor Petukhov
2685c7efce Jspecify: Rename codeanalysis annotations to jspecify ones 2020-10-08 14:00:10 +03:00
Denis Zharkov
59bd7364ab Enhance bounds for type parameters after loops disconnection
Otherwise behavior might change because enhancement may force computation
for other type parameters in cases like:
class A<X extends Y, Y extends X> {}

See the test:
org.jetbrains.kotlin.checkers.DiagnosticsTestGenerated.Tests.J_k#testRecursiveRawUpperBound3
2020-10-08 14:00:10 +03:00
Denis Zharkov
6661814e40 Do not enhance star projections for bounds of raw types
We have an invariant that their lower bound is always
SomeType<Any?> and their upper bound is SomeType<*>.
Ehancing the latter to SomeType<out Any> making
lower bound not being a subtype of upper bound that breaks contract
for flexible types (fails with exception)
2020-10-08 14:00:10 +03:00
Denis Zharkov
16b4a2c465 Do not enhance type parameter bounds if they contain a raw type
Otherwise enhancement algorithm starts forcing lazy mutually recursive
computations that leads to RECURSION_IN_SUPERTYPES in complex cases
2020-10-08 14:00:09 +03:00
Denis Zharkov
c1b34a83e9 Fix enhancement behavior in case of error-typed upper bounds 2020-10-08 14:00:09 +03:00
Denis Zharkov
2964d52640 Add test case for codeanalysis annotation 2020-10-08 14:00:09 +03:00
Denis Zharkov
dfb1cb8642 Minor. Rename UnknownNullness -> NullnessUnknown 2020-10-08 14:00:09 +03:00
Denis Zharkov
0b958c8ac5 Fix annotation name in test data to DefaultNullnessUnknown 2020-10-08 14:00:09 +03:00
Denis Zharkov
f3a490ee16 Support compiler flag -Xcodeanalysis-annotations 2020-10-08 14:00:09 +03:00
Denis Zharkov
c734bac676 Minor. Reformat JavaNullabilityChecker.kt 2020-10-08 14:00:08 +03:00
Denis Zharkov
ce2b7bded6 Minor. Reformat AbstractForeignAnnotationsTest.kt 2020-10-08 14:00:08 +03:00
Denis Zharkov
90a9ca6cb3 Minor. Rename flag in JvmAnalysisFlags: jsr305 -> javaTypeEnhancementState 2020-10-08 14:00:08 +03:00
Denis Zharkov
93d9301847 Minor. Extract JavaTypeEnhancementStateParser::parseJsr305State 2020-10-08 14:00:08 +03:00
Denis Zharkov
e7208f0c05 Rename Jsr305Parser -> JavaTypeEnhancementStateParser 2020-10-08 14:00:08 +03:00
Denis Zharkov
6c37574fce Rename Jsr305State -> JavaTypeEnhancementState
Also, rename some of the properties
It's needed to store status for codeanalysis annotation in that class
2020-10-08 14:00:08 +03:00
Denis Zharkov
2f04a1505d Support enhancement for unbounded wildcards from codeanalysis annotations 2020-10-08 14:00:07 +03:00
Denis Zharkov
392ef9aa2b Support type arguments enhancement from type parameters bounds
Currently, only works for codeanalysis annotations because
type parameters bounds are enhanced only for them
2020-10-08 14:00:07 +03:00
Denis Zharkov
e9e05c53e1 Support enhancement for type parameter based types
Load them as non-flexible when a relevant type parameter has non-flexible upper bound
(Currently, it only works for case of codeanalysis annotations)
2020-10-08 14:00:07 +03:00
Denis Zharkov
fa2578c795 Prepare type enhancement for codeanalysis annotations
- Rename NullabilityQualifierWithApplicability -> JavaDefaultQualifiers
- Use JavaDefaultQualifiers instead of JavaTypeQualifiers for default qualifiers

This change is intended to make code more clear and to allow add some additional
parameters specific for default qualifiers needed for codeanalysis annotations
2020-10-08 14:00:07 +03:00
Denis Zharkov
e27501497b Support codeanalysis annotations on type parameters bounds 2020-10-08 14:00:06 +03:00
Denis Zharkov
82d39dd86a Add basic support for default codeanalysis annotations 2020-10-08 14:00:06 +03:00
Denis Zharkov
517cc84f4d Add initial support for codeanalysis annotations 2020-10-08 14:00:06 +03:00
Vladimir Dolzhenko
165a147dd8 Improved IDE performance tests vega specs 2020-10-08 12:26:45 +02:00
Roman Golyshev
0682084ca3 [FIR Completion] Generate part of performance tests for FIR completion 2020-10-08 11:10:50 +03:00
Mikhail Glukhikh
beac3757bc [IR text test] Minor: add forgotten .fir.txt file 2020-10-08 10:33:58 +03:00
Vladimir Dolzhenko
46535bbd9d Add IDE performance tests vega specs 2020-10-08 00:07:17 +02:00
Dmitriy Dolovov
280fcb5c4b IDE: IndexNotReadyException while creating new Kotlin file in Dumb mode
^KT-42518
2020-10-07 22:36:52 +03:00
Alexander Udalov
2f003bdcb5 Minor, add regression test
#KT-42527
2020-10-07 21:31:43 +02:00
pyos
af98720720 JVM_IR: move MoveOrCopyCompanionObjectFields down a bit
More specifically, it should be done *just before*
JvmPropertiesLowering, as walking the IR tree between them will result
in visiting the moved backing fields twice (once via the companion's
parent, once via the IrProperty).

Ideally, this group of 3 lowerings should be merged into 1 as they are
completely inseparable, but this is slightly harder to do properly.

 #KT-42527 Fixed
2020-10-07 21:31:19 +02:00
pyos
dd1682510f JVM_IR: generate accessors for inherited abstract members too
#KT-41468 Fixed
2020-10-07 21:23:18 +02:00
Alexander Udalov
68157f09fa Minor, add temporary workaround for KT-42492 2020-10-07 19:33:40 +02:00
Roman Golyshev
7833698038 [FIR IDE] Fix idea-fir-performance-tests module references 2020-10-07 19:45:03 +03:00
Ilya Kirillov
efef18c2ca FIR IDE: mute not passing highlighting test 2020-10-07 19:45:02 +03:00
Ilya Kirillov
96422ea3fe FIR IDE: introduce highlighting performance test 2020-10-07 19:45:01 +03:00
Denis Zharkov
5cc12b49fc Hide java.lang.CharSequence::isEmpty from Kotlin built-in class
Also, prohibit using it as a synthetic property

^KT-42467 In progress
2020-10-07 17:48:19 +03:00
Denis Zharkov
90044f9672 Use correct naming for additional built-in member lists 2020-10-07 17:48:19 +03:00
pyos
98088f739d PSI2IR: do not generate when subjects multiple times
`in x` is represented as `<subject expression> in x` in psi, so
generating the entire call and then replacing the argument with a read
of a temporary results in redundant regenerations of the subject.

 #KT-42054 Fixed
 #KT-42455 Fixed
2020-10-07 17:22:25 +03:00
Alexander Udalov
e280416fe2 Minor, add regression test 2020-10-07 14:31:01 +02:00
pyos
8ef0fdf021 JVM_IR: remove two outdated comments 2020-10-07 14:30:36 +02:00
pyos
f7441813a9 JVM_IR: move SuspendLambdaLowering to a separate file 2020-10-07 14:30:36 +02:00
pyos
a6c62d3339 JVM_IR: do not inherit delegated property trackers
This is no longer needed now that lambdas are generated before
`$$delegatedProperties`.
2020-10-07 14:30:36 +02:00
pyos
05c856f1f7 JVM_IR: move SuspendLambdaLowering next to FunctionReferenceLowering
#KT-42253 Fixed
 #KT-39434 Fixed
2020-10-07 14:30:36 +02:00
pyos
44e0bfe90b JVM_IR: split AddContinuationLowering
One half handles suspend lambdas, the other - named functions.
2020-10-07 14:30:36 +02:00
pyos
4f171a9eb5 JVM_IR: move FunctionReference lowering before PropertyReference
so that `$$delegatedProperties` are generated in the lambdas' classes.
2020-10-07 14:30:36 +02:00
pyos
1190457759 JVM_IR: fix copying of receivers when unboxing inline class parameters
If an extension receiver is copied into a normal parameter, this may
later cause default argument masks to be shifted.
2020-10-07 13:21:50 +02:00
pyos
adcbfc7b4c IR: add an emptiness check to all unsigned until loops
Unlike signed integers, a larger unsigned type does not mean a lower
minimum value, so `x - 1` can overflow even if `x` is casted to a larger
type.

 #KT-42186 Fixed
2020-10-07 12:53:00 +02:00
pyos
4a03006162 Generate min/max constants as non-const in ranges tests
in order to make them appear as unknown values to codegen.
2020-10-07 12:53:00 +02:00
Pavel Punegov
260f66183c Don't ignore the test on JS backend as it doesn't fail any more. 2020-10-07 12:22:49 +03:00
Pavel Punegov
93b2ea2feb Regenerate tests 2020-10-07 12:18:12 +03:00
Pavel Punegov
a439860e12 Replace IGNORE_BACKENDs to TARGET_BACKEND for the Java test 2020-10-07 12:18:09 +03:00
Pavel Punegov
4d8ca074bc Ignore test for the full reflection in Native 2020-10-07 12:18:09 +03:00
Pavel Punegov
33d28b44fa Unmute typeOf tests in Native backend 2020-10-07 12:18:09 +03:00
Igor Yakovlev
d92aa94c6d [Usages] Provide BWC change for 1.4.20 and mark it as deprecated
Fixed #KT-42406
2020-10-07 12:09:59 +03:00
Vladimir Dolzhenko
23d33f51a2 Open build tool window on Gradle DSL errors
^EA-236697 Fixed
2020-10-07 10:46:52 +02:00
KotlinIsland
0e29f6f48b DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE: is -> are 2020-10-07 10:41:43 +02:00
Dmitry Gridin
9a0c3c47c8 [inspections] fix false positive "Redundant Unit" inspection in lambda with dynamic return type
^KT-40700 Fixed
2020-10-07 08:38:28 +00:00
Yaroslav Chernyshev
26d03295cf [Cocoapods] Remove hierarchical PodInstall dependsOn to Podspecs
#KT-41844 Fixed
2020-10-07 11:05:25 +03:00
Mikhail Glukhikh
e49f881e7f [FIR2IR] Add more clear exception about absent setter (see KT-42496) 2020-10-07 10:43:46 +03:00
Mikhail Glukhikh
aa4a042612 [FIR2IR] Use deepest matching symbol also for synthetic properties
#KT-42359 Fixed
2020-10-07 10:43:43 +03:00
Mikhail Glukhikh
fb4f27e136 [FIR2IR] Add test for problematic KT-42359 2020-10-07 10:43:38 +03:00
Jinseong Jeon
49307e243c FIR deserializer: load annotations on default accessors 2020-10-07 09:46:40 +03:00
Dmitriy Dolovov
c25742c91a kotlinx-metadata: Fix tests for Flag.Constructor.IS_SECONDARY flag
^KT-42429
2020-10-07 09:43:23 +03:00
Dmitriy Dolovov
52e56ca070 kotlinx-metadata: Wrong interpretation of Flag.Constructor.IS_PRIMARY
^KT-42429
2020-10-07 09:43:14 +03:00
Sergey Igushkin
3a5ffe479e General fixes for composite builds in HMPP
* Register project structure metadata providers globally, so included
  builds can access it from the root build.

* Rework some dependency management logic so that it doesn't assume that
  dependencies resolved to projects are safe to access – it is so only
  if the project is in the same build; also, in dependency handling, use
  proper keys which distinguish project with same ID in different
  builds.

* Add a separate implementation of `MppDependencyMetadataExtractor` that
  reads the project structure metadata from the mentioned global storage
  (as we can't read it from artifacts – those are not yet build at the
  project configuration phase) but when it comes to artifacts
  processing, takes real artifacts rather than introspect the project
  structure.

* Register the Kotlin/Native host-specific metadata artifact
  configurations as consumable, so that a consumer from a different
  build can properly resolve a dependency to such a configuration and
  get the artifact.
2020-10-06 23:26:17 +03:00
Sergey Igushkin
7d1a3a137b Publish MPP -metadata artifact in the root module, drop separate module
Until now, there was a separate module foo-metadata that contained the
Kotlin metadata artifacts. The reasons for this were only historical,
namely the platform modules used to depend on the metadata module and
expect it to bring the common sources to the IDE.

Now we don't really need the -metadata module, and it's now more harm
from it than good, as users never need to specify it as a dependency.

We fix this by removing the -metadata module from the default publishing
layout and putting the -metadata artifact(-s) directly to the root
module.
2020-10-06 23:26:17 +03:00
Sergey Igushkin
a0fbf54d11 Simplify matching of Kotlin variant name and Gradle configuration name
Earlier, the matching was non-trivial and required the consumer to look
through all of the producer's targets to find the Kotlin variant given
the name of the configuration that Gradle chose during variant-aware
dependency resolution. This is not feasible in composite builds as we
can't look into a project model of an included build.

To fix this, simplify the matching of the Gradle configuration name and
the Kotlin variant name by just using a suffix for the published
configurations.

Namely, instead of names like `jvm-api`, use the original configuration
name `jvmApiElements` for Kotlin variant names. To avoid ambiguity with
Gradle configurations (which we might want to customize for publishing,
like by altering the attributes or the published artifacts compared to
the configuration exposed for inter-project dependencies), create
publishing configurations
2020-10-06 23:26:16 +03:00
Sergey Igushkin
16d493558e HMPP resolution fixes
While we already had the associateWith relationship
that established additional visibility between such
source sets as fooMain and fooTest, this
relationship was not used properly when requested
dependencies were built for source set visibility
inference in HMPP. Instead, an old workaround was
used that just added dependencies of commonMain to
commonTest.

Fix this by using the associateWith relationship in
the preparation logic of source sets visibiltiy.

ALso, make the artifact view used in source sets visibility inference
lenient, so that a host-specific module that has not yet been published
won't lead to fail in source sets visibility and will instead be
ingored.
2020-10-06 23:08:01 +03:00
Sergey Igushkin
5963b07987 Use JSON as the format for the Kotlin project structure metadata 2020-10-06 23:08:01 +03:00
Sergey Igushkin
f19ef0184c Cleanup GranularMetadataTransformation after refactoring 2020-10-06 23:08:00 +03:00
Mads Ager
3817aa32a1 [IR] Move isAssignable to IrValueDeclaration. 2020-10-06 21:47:29 +02:00
Mads Ager
af0999ec6f [IR] Support isAssignable in builders and serialization. 2020-10-06 21:47:29 +02:00
Mads Ager
37145fb055 [JS_IR] Fix exponential behavior accidentally introduced. 2020-10-06 21:47:29 +02:00
Mads Ager
1f2ca606a5 [IR] Add isAssignable property to IrValueParameter.
Use it to check that only the value parameters that are explicitly
marked assignable are assigned.

Currently, the only parameters marked assignable are those for
default argument stubs.
2020-10-06 21:47:29 +02:00
Mads Ager
8d791ca98e [IR] Update naming, but not binary format for IrSetValue. 2020-10-06 21:47:29 +02:00
Mads Ager
33ab2299f9 [IR] Fix the type of the default argument mask condition.
On JVM and JS we can get away with using an Int but it really
should be a Boolean and Native reasonably insists on that.
2020-10-06 21:47:29 +02:00
Mads Ager
87f17dec4a [JS_IR] Use IrSetValue for default argument handling for JS backend.
Fix a couple of parameter remappings that now have to take IrSetValue
into account as well as IrGetValue.
2020-10-06 21:47:29 +02:00
Mads Ager
9a93bb3f09 [IR] Add IR support for setting parameters.
Use it in the JVM_IR backend for default values code. The parameter
local has to be overwritten for the inliner to work.
2020-10-06 21:47:29 +02:00
Ilya Chernikov
db23460fd5 Implement proper script runtime exception rendering with tests
#KT-42335 fixed
2020-10-06 21:43:11 +02:00
Ilya Kirillov
d5ad424e8f FIR: introduce source element mappings tests for raw FIR 2020-10-06 22:24:01 +03:00
Ilya Kirillov
a8ca2f8065 FIR IDE: fix diagnostics collection 2020-10-06 22:24:00 +03:00
Ilya Kirillov
551864d8c1 FIR: fix source element of FirQualifiedAccessExpression 2020-10-06 22:24:00 +03:00
Yan Zhulanow
c6de983476 Keep class members of the ExtensionPoint interface instead of its implementation for easier usage 2020-10-07 04:11:02 +09:00
Yan Zhulanow
0dc243d74c Parcelize: Don't activate both 'kotlin-parcelize' and 'kotlin-android-extensions' in IDE (KT-42267)
The actual problem is a lack of plugin activation check in ParcelableUltraLightClassModifierExtension (see how it should be done in ParcelizeUltraLightClassModifierExtension). However, ParcelableUltraLightClassModifierExtension lays inside ADT sources, and it's impossible to make an fast&easy fix from our side. However, we control the compiler plugin on which the IDE support is based, so the check is added there.

There should be no troubles if the application with 'kotlin-android-extensions' includes an Android library with 'kotlin-parcelize' or vise-versa, as runtime libraries of both plugins are attached to the 'implementation' Gradle configuration since AGP 2.5.
2020-10-07 04:11:02 +09:00
Yan Zhulanow
4c540152fe Parcelize: Forbid applying both 'kotlin-parcelize' and 'kotlin-android-extensions' (KT-42342) 2020-10-07 04:11:02 +09:00
Mads Ager
a37f16d7a2 [IR] Do not generate line numbers for synthesized data class members.
Fixes KT-41903.
2020-10-06 19:53:47 +02:00
Mikhael Bogdanov
5048471835 Properly check default kind on inheriting from old DefaultImpls scheme 2020-10-06 18:10:44 +02:00
Steven Schäfer
714d17ac63 Parcelize, JVM IR: Handle star projected and nullable arrays. 2020-10-06 17:42:35 +02:00
pyos
a6d5c02d9b JVM_IR: add a transformChildren call to PropertyReferenceLowering
#KT-42354 Fixed
2020-10-06 17:06:34 +02:00
Dmitry Petrov
b1bd138afb JVM_IR fix inline class <-> collection stubs issues
Move collectionStubMethodLowering before jvmInlineClassPhase, and make
them interact properly.

Note that some issues still remain in inline class <-> special bridges
interaction.

KT-40187 KT-42469
2020-10-06 17:08:24 +03:00
Alexander Udalov
2573eaa77f IR: do not crash renderer on functions with uninitialized return type
This is a follow-up to b497f39c29. It
turns out that it didn't help because `IrFunction.returnType` throws
exception, and checking for `IrUninitializedType` in `IrType.render` was
already too late. Throw and catch specific exception instead.

Also add function name into the exception message for better diagnostics
elsewhere (can't compute the full FQ name because in cases like
KT-42020, the parent is also uninitialized).
2020-10-06 14:23:34 +02:00
Alexander Udalov
06f1bd6101 Reformat IR tree declarations and implementations
Most of the changes are to the incorrect formatting introduced in
d1fd1da56f.
2020-10-06 14:21:40 +02:00
Mads Ager
b47e0e861b [PSI2IR] Use SYNTHETIC_OFFSET for delegated brigdes.
This allows kotlin-native to generate code in debug mode.
LLVM requires debug attributes for this code and SYNTHETIC_OFFSET
makes kotlin-native generate dummy debug attributes.
2020-10-06 13:32:55 +02:00
Mikhael Bogdanov
ed5c2b0565 Add tests for data class runtime string concatenation
#KT-35176
2020-10-06 13:20:41 +02:00
Mikhael Bogdanov
eb32a6ddbd Add test for for kt42457 wrong behaviour. Align runtime concatenation with it
#KT-42457
2020-10-06 13:20:40 +02:00
Mikhail Glukhikh
64fb114c30 FIR Java annotations: create vararg or Array depending on parameter name
#KT-42346 Fixed
2020-10-06 12:13:58 +03:00
Mikhail Glukhikh
f6b49a2c9a FirAnnotationArgumentChecker: handle conversion calls properly 2020-10-06 12:13:58 +03:00
Mikhail Glukhikh
6f432ea5dd [FIR] Add problematic test for KT-42346 (double vararg in annotation) 2020-10-06 12:13:57 +03:00
Mikhail Glukhikh
862fb6a405 FIR Java: make annotation parameters not-null 2020-10-06 12:13:57 +03:00
Ilya Goncharov
bcdc53d1c4 [Gradle, JS] Consider GString in npm dependencies parse in root dependencies
^KT-42462 fixed
2020-10-06 11:32:59 +03:00
Mikhael Bogdanov
39cde978d0 Minor. Rename test folder 2020-10-06 07:14:39 +02:00
Mikhael Bogdanov
d2c4be18a0 Rename runtime-string-concat option into 'string-concat' 2020-10-06 07:14:39 +02:00
LepilkinaElena
402f7df0d4 [IR] Save several last calculated line numbers not to recalculate them several times during code and debug info generation (#3792) 2020-10-06 08:03:50 +03:00
Roman Artemev
a52e045c91 [IR BE] Remap references in default arg value in inner class constructor
Make sure that there is no reference into zombie declarations.

 - fix KT-40771
 - add test
2020-10-06 00:06:47 +03:00
Roman Artemev
f597585ffb [IR BE] Refactor DefaultArgumentStubGenerator a bit 2020-10-06 00:06:46 +03:00
Ilya Chernikov
d7e0649d93 Automatically add -- after script/expression in kotlin runner
#KT-37987 fixed
2020-10-05 22:35:58 +02:00
Vladimir Dolzhenko
153217ae2e Clean up muted tests 2020-10-05 21:34:39 +02:00
Mikhael Bogdanov
b27955d268 Wrong specialization diagnostic is reported on java default inheritance 2020-10-05 20:09:21 +02:00
Jinseong Jeon
2d001a46fc FIR CFG traverser: do not skip graph enter node
#KT-42348 fixed
2020-10-05 19:48:12 +03:00
Jinseong Jeon
a154cf4c45 FIR checker: reproduce KT-42348 2020-10-05 19:48:11 +03:00
Vladimir Dolzhenko
be84110ada Clean up muted tests
Muted tests failed with `Range must be inside element being annotated` is fixed

Relates to ^KT-38959
2020-10-05 18:09:45 +02:00
Vladimir Dolzhenko
71d76bdb4b Revert "Perform shorten references under modal dialog"
This reverts commit 0b822aa4
2020-10-05 18:00:46 +02:00
Yaroslav Chernyshev
dcf18ec500 [Gradle, Cocoapods] Fix false-negative testCinteropExtraOpts failing 2020-10-05 16:40:32 +03:00
Ilya Gorbunov
76c5d036a8 Do not pack source of invisible runtime helpers to stdlib-js
Use reference sources of built-in Enum and Comparable instead.

KT-42318
2020-10-05 16:07:05 +03:00
Vyacheslav Gerasimov
4a9819bf9e Build: Upgrade gradle-enterprise plugin to 3.4.1 2020-10-05 15:57:10 +03:00
Vladimir Dolzhenko
0b822aa492 Perform shorten references under modal dialog
To prevent freezes and show progress to user shorten references has to be performed in a background thread

^KT-42170 Fixed
2020-10-05 11:41:56 +00:00
Vladimir Dolzhenko
36b3a8e0e3 Revert "Open build tool window on Gradle DSL errors"
This reverts commit 741df42c
2020-10-05 12:57:35 +02:00
Vladimir Dolzhenko
5eac949b43 Report EXPLICIT_DELEGATION_CALL_REQUIRED on relevant element
^KT-38959 Fixed
2020-10-05 09:43:05 +00:00
Jinseong Jeon
7af564c9f2 FIR: fix vararg remapping that merged named vararg 2020-10-05 12:33:03 +03:00
Vladimir Dolzhenko
29b23e79f3 Register EXPRESSION_CODE_FRAGMENT, BLOCK_CODE_FRAGMENT in KtStubElementTypes
Stubbed type has to be register earlier (see IStubFileElementType#checkNotInstantiatedTooLate)

Relates to ^KT-28732
2020-10-05 11:10:06 +02:00
Mikhail Glukhikh
3cd552cb43 [FIR2IR] Process anonymous object nested classes correctly
#KT-42373 Fixed
2020-10-05 12:06:53 +03:00
Mikhail Glukhikh
76cdf97b6d [FIR2IR] Set facade class for backing field properly #KT-42384 Fixed 2020-10-05 12:06:52 +03:00
Yaroslav Chernyshev
ad7ad98738 [Gradle, Cocoapods] Custom packageName and extraOpts for pods cinterop
#KT-40999 Fixed
2020-10-05 11:59:30 +03:00
Georgy Bronnikov
b0b971cd0a IR: Remove unused class 2020-10-05 11:02:12 +03:00
Georgy Bronnikov
80b7194799 IR: remove KotlinType usage from Ir.kt 2020-10-05 11:02:12 +03:00
Georgy Bronnikov
7afad9a91d Use wrapped descriptors in IrReturnableBlock 2020-10-05 11:02:12 +03:00
Georgy Bronnikov
38ee182f51 IR: remove unused AbstractClosureAnnotator 2020-10-05 11:02:11 +03:00
Ilmir Usmanov
5e02a4efd7 Mark implicit receiver as captured if the function is expression
#KT-40260 Fixed
 #KT-42280 Fixed
2020-10-05 09:36:54 +02:00
Dmitry Gridin
3078bd7b67 [formatter] line indent provider: fix indent for empty braces
^KT-42411 Fixed
2020-10-05 07:27:53 +00:00
Jinseong Jeon
380226cba0 FIR2IR: correct dispatch receiver inside inner class constructor 2020-10-05 09:12:19 +03:00
Jinseong Jeon
aa488eabc9 FIR2IR: distinguish constructor when picking return target 2020-10-05 09:09:39 +03:00
Ilya Chernikov
5ab822be36 Import scope of the imported script
#KT-34178
2020-10-02 18:53:31 +02:00
Ilya Chernikov
a71eab89e7 Remove unused code...
left after "Optimize scopes handling inside LexicalChainedScope"
refactoring commit.
2020-10-02 18:53:31 +02:00
Leonid Startsev
bdbf8d7980 Use correct class type when creating class references
(for e.g. PolymorphicSerializer)

Former class reference may had type arguments in it, which lead to bugs
in JS IR.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1072
2020-10-02 19:11:25 +03:00
Leonid Startsev
d4bdb0eedc Remove requirement on 'Serializable class must have single primary constructor'
#KT-38868 Fixed
 #KT-41627 Fixed
 Fixes https://github.com/Kotlin/kotlinx.serialization/issues/396
 Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1049
2020-10-02 19:11:25 +03:00
Ilya Goncharov
de8776ec1d [Gradle, JS] Support for groovy dsl and Pair in kotlin dsl
[Gradle, JS] Use package json custom fields as inputs

^KT-42400 fixed
2020-10-02 18:42:33 +03:00
Victor Petukhov
6c1dc43d25 Add check already fixed variables in PostponedArgumentInputTypesResolver during adding constraints on them and using inside a functional type
^KT-42374 Fixed
2020-10-02 18:31:54 +03:00
Ilya Goncharov
96ccf03794 [Gradle, JS] Test: Add yarn resolution by version shortcut
^KT-42420 fixed
2020-10-02 18:14:53 +03:00
Ilya Goncharov
18ec9f10f9 [Gradle, JS] Add yarn resolution by version shortcut
^KT-42420 fixed
2020-10-02 18:14:42 +03:00
Dmitriy Dolovov
07f78f5ab8 [Commonizer] Drop "kind" from CirClassConstructor
... as it is always CallableMemberDescriptor.Kind.DECLARATION
for serialized constructor declarations
2020-10-02 16:47:29 +03:00
Vladimir Dolzhenko
abc4aef403 Store kotlin-script-cache-dependencies as project file attribute
To avoid extra root project scan we need to store already processed script cache dependencies

^KT-41640 Fixed
2020-10-02 13:23:43 +00:00
Dmitry Petrov
941a506885 Add test for inline classes implementing collection interfaces
KT-40186
2020-10-02 14:06:07 +03:00
Ilya Chernikov
2828f0a814 Fix restoring script configuration from file attributes
#KT-41622 fixed
2020-10-02 12:38:22 +02:00
Ilya Chernikov
d88e87aaac Fix ScriptDefinition subtyping after earlier refactorings
#KT-41905 fixed
(may also fix other yet undetected or not analyzed problems with script
definitions)
2020-10-02 12:38:21 +02:00
Ilya Chernikov
adcfca3f98 Treat classpath extraction problems on script definition loading as warnings
#KT-44206 fixed
2020-10-02 12:38:21 +02:00
Vladimir Dolzhenko
741df42c18 Open build tool window on Gradle DSL errors
^EA-236697 Fixed
2020-10-02 10:08:49 +00:00
Dmitry Petrov
e018f2bd3e JVM_IR more precise check for special bridges in super class
KT-41123
2020-10-02 12:51:49 +03:00
Mikhael Bogdanov
cf5bd38bec JVM_IR. Support runtime string concatenation 2020-10-02 11:47:28 +02:00
Mikhael Bogdanov
1938f9459f Support indy concatenation 2020-10-02 11:47:28 +02:00
Mikhael Bogdanov
942e1962d9 Properly process constants 2020-10-02 11:47:27 +02:00
Mikhael Bogdanov
8a1f7c5859 Add TODO 2020-10-02 11:47:27 +02:00
Mikhael Bogdanov
c329c22630 Add runtime string concat options. Some renaming 2020-10-02 11:47:27 +02:00
Mikhael Bogdanov
04012951c1 Basic invokedynamic string concatenation support 2020-10-02 11:47:27 +02:00
Mikhael Bogdanov
88892ec65d Introduce StringAppendGenerator 2020-10-02 11:47:27 +02:00
Mikhael Bogdanov
bf35818438 Minor. Reformat 2020-10-02 11:47:27 +02:00
Mark Punzalan
b58d75440b [FIR] Fix tests for vararg execution order after rebase. 2020-10-02 12:08:07 +03:00
Mark Punzalan
e175e87225 [FIR] Change type of argumentMapping properties and parameters from Map
to LinkedHashMap, to signify that the order is important and we don't
assume that mutableMapOf() will always return a LinkedHashMap.
2020-10-02 12:08:06 +03:00
Mark Punzalan
6b83f2d70e [FIR] Remove Candidate.oldToNewArgumentMapping and use
Candidate.argumentMapping instead of the Fir*Call's argumentList to
remap vararg arguments to a FirVarargArgumentExpression.

The argumentList was used to preserve the order, but we can rely on
Candidate.argumentMapping to have its keys in order.
2020-10-02 12:08:05 +03:00
Mark Punzalan
a2a4d94834 [FIR] Capture array and indices for postfix/prefix increment/decrement
of array element (including overloaded indexed access operators, e.g.,
`a[b, c]++`).

This prevents double-evaluation of the array and indices expressions,
which may have side-effects.
2020-10-02 12:08:03 +03:00
Mark Punzalan
eb631bc429 [FIR] Keep vararg argument order in resolved calls (KT-17691). 2020-10-02 12:08:02 +03:00
Mark Punzalan
f6ce2d893c [FIR] Handle varargs in overloaded indexed access operator. 2020-10-02 12:08:01 +03:00
Yan Zhulanow
c471a7735e Keep all variants of ExtensionPointImpl.registerExtension() in the pro-guarded compiler (KT-42103) 2020-10-02 17:50:23 +09:00
Toshiaki Kameyama
bcbb90dd81 "Receiver parameter is never used" inspection: don't report it when anonymous function is called with receiver
#KT-41246 Fixed
2020-10-02 13:32:31 +07:00
Mikhail Glukhikh
112e07814e [FIR] Mute test after rebase 2020-10-02 08:58:01 +03:00
Mikhail Glukhikh
cc88374fd7 [FIR] Add compile Kotlin against Kotlin test group 2020-10-02 08:57:55 +03:00
Mikhail Glukhikh
582f8fe287 FIR: recursive transform annotation if it has annotation as argument
#KT-42344 Fixed
2020-10-02 08:57:49 +03:00
Mikhail Glukhikh
2fd752f8f6 IR interpreter: fix calculation of constant Java fields
#KT-42117 Fixed
2020-10-02 08:57:44 +03:00
Mikhail Glukhikh
44ebec05bb FIR Java: support read of field constant initializers 2020-10-02 08:57:39 +03:00
Ilya Gorbunov
fafb4a7914 Use regex for case-insensitive String.replace
KT-41799
2020-10-02 00:29:26 +03:00
Francesco Vasco
4a0109cf44 Use StringBuilder in String.replace (2x faster)
KT-41799
2020-10-02 00:28:53 +03:00
Vladimir Ilmov
51a37bffff Incorrect package name for multipart classes 2020-10-01 23:06:17 +03:00
LepilkinaElena
dc2845df10 [IR] Avoid extra lists creation during getting explicit/all parameters (#3769) 2020-10-01 21:19:40 +03:00
Denis Zharkov
6d7744a921 FIR2IR: Use correct origin for lazily created fake overrides 2020-10-01 17:49:02 +03:00
Denis Zharkov
26a43b253f FIR2IR: Avoid recreation of declarations
They may be previously created for fake overrides
2020-10-01 17:49:02 +03:00
Denis Zharkov
ff4b6a0bf9 FIR: Fix modality computation for corner cases in FirTypeIntersectionScope
See org.jetbrains.kotlin.resolve.OverridingUtil#determineModalityForFakeOverride
2020-10-01 17:49:02 +03:00
Denis Zharkov
de3df799bc FIR: Fix implicit return type computation for synthetic property+intersection 2020-10-01 17:49:02 +03:00
Denis Zharkov
754e17a28f FIR2IR: Fix checking if accessor is allowed to have fake override 2020-10-01 17:49:02 +03:00
Denis Zharkov
70bf7063c9 FIR2IR: Add hack for delegate combinated with intersection 2020-10-01 17:49:02 +03:00
Denis Zharkov
85b8673434 FIR: Fix overload resolution with defaults 2020-10-01 17:49:02 +03:00
Denis Zharkov
4964ff0019 FIR2IR: Refine definition if we need a fake override
`realDeclarationSymbols` that was used before is built from klass.declarations that doesn't
contain e.g. declarations from enhancement
Next time, we should get rid of `realDeclarationSymbols` and use only
originalDeclaration.origin.fromSupertypes, but originalSymbol.callableId.classId == classId
doesn't work correctly
2020-10-01 17:49:02 +03:00
Denis Zharkov
3dfbd36f15 FIR: Unmute passing blackbox tests 2020-10-01 17:49:02 +03:00
Denis Zharkov
be6bef13d3 FIR2IR: Drop some unused declarations 2020-10-01 17:49:02 +03:00
Denis Zharkov
5c9187b270 FIR2IR: Rework fake overrides generation
- To discriminate what's already been generated, use the set of declaration
instead of names (it's obviously more correct)
- Make it possible to set more then one overridden (base)
2020-10-01 17:49:02 +03:00
Denis Zharkov
b241161c35 FIR2IR: Rework DelegatedMemberGenerator
Use scope content instead of manual traversing of declarations
2020-10-01 17:49:02 +03:00
Denis Zharkov
e311a60055 FIR: Refine FirDelegatedMemberScope
- Use an attribute instead of overriddenSymbol
- Use createCopyForFir because it copies type parameters
2020-10-01 17:49:02 +03:00
Denis Zharkov
28c536e511 FIR: Add temporary workaround to avoid changes in test data
CallableId for intersection overrides has been changed in previous commits
and many rendered FIR test data needs to be changed
But, we're going to get rid of callableId's/or fix them back for intersection overrides soon
2020-10-01 17:49:02 +03:00
Denis Zharkov
ff83555729 Minor. Optimize imports 2020-10-01 17:49:02 +03:00
Denis Zharkov
fd9c6479bf FIR: Do not call withReplacedConeType if type is unresolved 2020-10-01 17:49:02 +03:00
Denis Zharkov
cb07ffc4fd FIR: Clarify contracts for two versions FirClass<*>::scope
- One of them really creates a scope a specific type
- Another one is used for supertypes and includes creation of FirDelegatedMemberScope wrapper
2020-10-01 17:49:02 +03:00
Denis Zharkov
1adf731fc5 FIR: Minor. Use buildValueParameterCopy 2020-10-01 17:49:02 +03:00
Denis Zharkov
9696fecab5 FIR: Use refined visibility/modality for intersection overrides 2020-10-01 17:49:02 +03:00
Denis Zharkov
20bf238c27 FIR2IR: Fix signature computed for fake-overrides
Take into account _new owner_ of the function
Namely, if there's a substitution override from a class A<T> in its subtype B,
it will refer `B` as its owner in the signature
2020-10-01 17:49:02 +03:00
Denis Zharkov
9914b487b7 FIR: Do not load hashCode/toString/equals methods from Java interface
As it's done in FE 1.0, and there are subtle semantics in the language that depends on it
2020-10-01 17:49:02 +03:00
Denis Zharkov
7c7c5336f9 FIR: Reuse callables copying parts in FirClassSubstitutionScope
It changes the behavior in FirTypeIntersectionScope:
- now type parameters are also get copied
- value parameters are being copied unchanged
2020-10-01 17:49:02 +03:00
Denis Zharkov
0297be1fa8 FIR: Replace callableId for intersection overrides 2020-10-01 17:49:02 +03:00
Denis Zharkov
11bc0e3225 FIR: Extract FirTypeScope.getDirectOverridden* 2020-10-01 17:49:02 +03:00
Denis Zharkov
73c6eb2793 FIR2IR: Extract common parts in FakeOverrideGenerator 2020-10-01 17:49:02 +03:00
Denis Zharkov
d67a1f9123 FIR: Rework default parameters propagation through overrides 2020-10-01 17:49:02 +03:00
Denis Zharkov
ac666187b0 FIR: Use correct session in FirJvmMangleComputer 2020-10-01 17:49:02 +03:00
Denis Zharkov
c8afa8f715 FIR2IR: Remove unused FakeOverrideMode 2020-10-01 17:49:02 +03:00
Roman Golyshev
2b76fe8a72 [FIR Completion] Enable basic insertion handler tests for FIR completion
Enable tests that are passing
2020-10-01 15:42:50 +03:00
Steven Schäfer
39736868bf JVM IR: Allow debugger to evaluate expressions involving IR dependencies 2020-10-01 14:35:05 +02:00
Steven Schäfer
48b736e551 JVM IR: Enable evaluate expression tests for the JVM IR backend 2020-10-01 14:35:05 +02:00
Toshiaki Kameyama
33969c5f9a Redundant semicolon: fix false negative on start of line
^KT-40704 Fixed
2020-10-01 14:31:59 +02:00
Nikita Skvortsov
02c31a711c Avoid iterating over all idea modules.
Use hash table to quickly lookup idea module by gradle project path
2020-10-01 14:09:34 +02:00
Florian Kistner
713f6e1ed3 Load artifactory in root script to workaround conflicts 2020-10-01 13:46:01 +02:00
Yaroslav Chernyshev
4c9d3b4668 [Gradle, Cocoapods] Add Podfile missing info to podInstall error report
#KT-42243 Fixed
2020-10-01 14:30:19 +03:00
Roman Golyshev
6c79040cfb [FIR Completion] Enable passing tests 2020-10-01 13:07:20 +03:00
Roman Golyshev
12cd5fb43a [FIR Completion] Refactor FIR completion tests
Extract logic about checking the directive and catching the exception
2020-10-01 13:07:20 +03:00
anastasiia.spaseeva
31de584d14 [Spec tests] Generate sections json map 2020-10-01 12:32:22 +03:00
Victor Petukhov
d02432cf93 Introduce warning for the changing arguments execution order for named varargs (KT-17691) 2020-10-01 12:15:13 +03:00
Victor Petukhov
d62c665e99 Introduce language feature to enable the correct arguments execution order for named varargs (KT-17691) 2020-10-01 12:14:49 +03:00
Bart van Helvert
485ada7b90 Move getColon from KtClass to KtClassOrObject
Makes it possible to retrieve the colon from a KtObjectDeclaration.
2020-10-01 10:20:20 +03:00
Vladimir Dolzhenko
4d5b32b140 Clean up perf tests TC stats output 2020-10-01 07:52:01 +02:00
Victor Petukhov
986ee11aab Fix failing spec test 2020-09-30 22:14:11 +03:00
Kirill Shmakov
4f51367196 Remove build settings of CLion plugin 2020-09-30 19:56:49 +03:00
Vyacheslav Gerasimov
f03b957812 Build: Check ivy repository by empty marker file instead of directory
Should fix situations when directory exists but contents are invalid
which happens when unpacking process is interrupted.
2020-09-30 17:51:22 +03:00
Victor Petukhov
d0a1f18c7d Fix failing test after fcfabb70d5 2020-09-30 17:37:20 +03:00
Bingran
60cf3b5740 Upgradle agp version for ConfigurationCacheForAndroidIT
The new agp version contains the fix regarding build listeners which
will allow kgp run config caching test without warnings.

Fixes: n/a
Test: existing
2020-09-30 16:06:35 +03:00
Dmitry Petrov
af86c52101 JVM_IR merge annotations when substituting types
Otherwise special annotations such as @EnhancedNullability are lost,
which affects JVM signatures.

KT-42330
2020-09-30 15:44:54 +03:00
sebastian.sellmair
4b152a635e multiplatformUtil; Module.implementedModules: Extend Android M2 fallback to also include M3 relevant modules
Port of `kotlin-ide` commit: 9053046ad5731b7aca73e2f74b93e8bd8251f507
2020-09-30 12:34:26 +00:00
sebastian.sellmair
f9b8bc0edb Move KotlinAndroidDependsOnEdgesTest.kt to new functionalTest source set 2020-09-30 12:26:49 +00:00
sebastian.sellmair
1173c4380a KotlinPlugin: Setup default 'dependsOn' edges for Android source sets 2020-09-30 12:26:48 +00:00
Dmitriy Novozhilov
dbf34205ff Advance bootstrap to 1.4.30-dev-738 2020-09-30 15:00:44 +03:00
Victor Petukhov
fcfabb70d5 Report invisible setter error if it's resolved to synthetic property of base class with public getter and protected setter
^KT-11713 Fixed
2020-09-30 14:35:43 +03:00
Denis Zharkov
fdd71c0bce Fix incorrect NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER
^KT-42257 Fixed
2020-09-30 14:10:53 +03:00
Jinseong Jeon
d09ccdbe3c FIR serializer: distinguish typealias classifier 2020-09-30 12:21:57 +03:00
Jinseong Jeon
b4ac2f5b55 FIR serializer: special handling of Continuation 2020-09-30 12:21:57 +03:00
Konstantin Tskhovrebov
5d2adce7ab as42: Add lost project parameter to CliLightClassGenerationSupport. 2020-09-30 11:38:18 +03:00
Vladimir Dolzhenko
3212df6183 Reverted back occasional commenting of perf runs 2020-09-30 09:41:21 +02:00
Konstantin Tskhovrebov
803463ac11 Revert "as42: Fix override."
This reverts commit d33391f4
2020-09-30 10:28:38 +03:00
Nikolay Krasko
646e6446f7 as41: Fix compile error in :compiler:tests-common:compileTestJava 2020-09-30 10:05:57 +03:00
Nikolay Krasko
6d2647c681 Clean .bunch file
No need to pass base branch in the rule
2020-09-30 10:05:56 +03:00
Vladimir Dolzhenko
ce1b388668 Add registry key kotlin.resolve.forceFullResolveOnHighlighting
Relates to ^KT-41195
Relates to ^KT-38687
2020-09-30 05:56:46 +00:00
Vladimir Dolzhenko
50a16aa9bc Do not print metadata for perf tests 2020-09-29 23:48:16 +02:00
Dmitry Petrov
f79afd67f4 Add more tests for collections implemented by delegation 2020-09-29 22:44:00 +03:00
Vladimir Dolzhenko
3c380faeb5 Added deprecated PackageFragmentProvider#getPackageFragments for BWC
Relates to ^KT-33394
^KT-42259 Fixed
2020-09-29 19:14:44 +00:00
Mikhael Bogdanov
a228206cf5 Minor. Regenerate tests 2020-09-29 20:29:40 +02:00
Dmitry Petrov
79a2d9858c JVM_IR emulate JVM stub generation scheme
KT-42114
KT-42115
2020-09-29 21:06:30 +03:00
pyos
6dc08cb2fd Add a bytecode test that checks inlining of adapted references 2020-09-29 19:49:46 +02:00
pyos
9a3507af59 JVM_IR: treat adapted references as lambdas for inlining
#KT-38536 Fixed
 #KT-38535 Fixed
2020-09-29 19:49:46 +02:00
pyos
0e8a664c9b JVM_IR: fix bound suspend-converted references
Note: inlining of adapted callable references is still suboptimal.

 #KT-42021 Fixed
2020-09-29 19:49:46 +02:00
Mikhail Glukhikh
ac50433e17 Fix failing bytecode text test
In this commit I moved IGNORE_BACKEND_FIR to the end or deleted it
when it was applicable, to preserve correct line numbers
2020-09-29 19:16:42 +03:00
Yan Zhulanow
cfd90c85cb Kapt: Re-enable JDK 9/11 tests disabled by occasion 2020-09-30 00:31:08 +09:00
Pavel Kirpichenkov
b39af51390 [FIR] Extract language settings into a dedicated component
^KT-42080 Fixed
2020-09-29 18:22:56 +03:00
Pavel Kirpichenkov
8f31b1ca83 [FIR] Use default language settings in inference components
Without settings common inference components require additional parameters
to be passed explicitly from components not shared between FIR and FE10.
Proper configuration can be postponed in FIR, defaults are good enough for now.

^KT-42080 In progress
2020-09-29 18:22:56 +03:00
Yan Zhulanow
dba1b50aed Parcelize: Don't write Parcelize model if the Parcelize plugin is disabled 2020-09-29 23:58:30 +09:00
Yan Zhulanow
9cdd6e9a8f Kapt: Support new @JvmDefault functionality (KT-25960) 2020-09-29 23:58:30 +09:00
Yan Zhulanow
a44fd964cf Kapt: Don't convert field initializers for enum fields inside companion objects (KT-37732)
For classes with companion objects, Kotlin compiler generates a 'Companion' static accessor field.
Java prioritizes fields over inner types (apparently, Scala does this as well, KT-29864), so the generated initializer doesn't compile.
As a workaround, initializer generatation is disabled for enum fields inside companion objects. Certainly, it's not a proper fix, however it does fix the regression.
2020-09-29 23:58:29 +09:00
Toshiaki Kameyama
86ac44c23e "Replace 'if' with elvis operator": don't suggest if val initializer is a complex expression
#KT-35165 Fixed
2020-09-29 23:58:29 +09:00
Toshiaki Kameyama
653e20dcba Convert put to assignment: don't report when receiver object has custom 'set' method
#KT-33212 Fixed
2020-09-29 23:58:29 +09:00
Toshiaki Kameyama
5abb6bc7a5 Add quickfix for SENSELESS_NULL_IN_WHEN to remove redundant when branch
#KT-24556 Fixed
2020-09-29 23:58:29 +09:00
Toshiaki Kameyama
668473c337 Add quickfix for CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT to remove const modifier
#KT-35215 Fixed
2020-09-29 23:58:28 +09:00
Toshiaki Kameyama
5a3c6def8f Join with assignment: fix false negative when local variable are used
#KT-34270 Fixed
2020-09-29 23:58:28 +09:00
Toshiaki Kameyama
b56272dc64 Add name to argument: do not remove necessary backticks
#KT-30894 Fixed
2020-09-29 23:58:28 +09:00
Toshiaki Kameyama
a492fe7757 "Put arguments/parameters on separate lines": respect code style settings
#KT-20420 Fixed
2020-09-29 23:58:27 +09:00
Toshiaki Kameyama
74ee68e57b Remove redundant backticks: do not report if variable inside the string and isn't followed by space
#KT-35051 Fixed
2020-09-29 23:58:27 +09:00
Toshiaki Kameyama
ad3ea9a36a Replace with binary operator: don't highlight when receiver is platform type
#KT-35097 Fixed
2020-09-29 23:58:27 +09:00
Toshiaki Kameyama
93db78e7ac JavaMapForEachInspection: report for expression with implicit receiver
#KT-31833 Fixed
2020-09-29 23:58:27 +09:00
Yan Zhulanow
85e8b56a02 Minor: Simplify code 2020-09-29 23:58:26 +09:00
Toshiaki Kameyama
75e8849c94 Add quick fix for INLINE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER
#KT-34533 Fixed
2020-09-29 23:58:26 +09:00
Yan Zhulanow
9f192ba85e Fix false positive in +0.0 == -0.0 comparison simplification (KT-17735) 2020-09-29 23:58:26 +09:00
Toshiaki Kameyama
915dc6ce91 FoldInitializerAndIfToElvisInspection: don't report when 'var' variable has no explicit type and it's used as not nullable type
#KT-38349 Fixed
2020-09-29 23:58:26 +09:00
Yan Zhulanow
db140b2815 Fix Pill debug IDEA run configurations 2020-09-29 23:58:25 +09:00
Yan Zhulanow
7b5fc19156 Minor: Simplify replacement check logic in ReplaceJavaStaticMethodWithKotlinAnalogInspection 2020-09-29 23:58:25 +09:00
Yan Zhulanow
ed2b547973 Minor: Extract suspend call check to a separate function 2020-09-29 23:58:25 +09:00
Toshiaki Kameyama
ef5335ba99 ReplaceJavaStaticMethodWithKotlinAnalogInspection: don't report for Character.toString(int)
#KT-34859 Fixed
2020-09-29 23:58:25 +09:00
Toshiaki Kameyama
b008e6c9be SimplifiableCallChainInspection: don't report if suspend function cannot be called correctly
#KT-23934 Fixed
2020-09-29 23:58:24 +09:00
Yan Zhulanow
1e9bb00744 Debugger: Disable "missing dependency superclass" diagnostic in evaluator (KT-38659) 2020-09-29 23:58:24 +09:00
Yan Zhulanow
62affd8e0d Kapt: Allow to strip @Metadata annotation from stubs (KT-36667) 2020-09-29 23:58:24 +09:00
Ilya Goncharov
da16b8e527 [Gradle, JS] Add includedRange with version only 2020-09-29 16:29:01 +03:00
Kirill Shmakov
3075de917b Add useAndroidX property into mobile library template KT-42123 2020-09-29 16:22:56 +03:00
Kirill Shmakov
ac9b5dabfc Clarify test names to avoid clashes in resolve
This is to workaround problem described in #KT-41342
2020-09-29 16:22:54 +03:00
Ilya Goncharov
31e7dd5fcc [Gradle, JS] Fix escaped characters in package.json
^KT-40202 fixed
2020-09-29 15:46:16 +03:00
Ilya Goncharov
337a66f906 [Gradle, JS] Fix NpmRange string representation with concrete version
^KT-42222 fixed
^KT-40986 fixed
^KT-39838 fixed
2020-09-29 15:46:16 +03:00
Ilya Goncharov
0fa4f0572b [Gradle, JS] Add test for duplicated dependency with range version
^KT-42222 fixed
^KT-40986 fixed
^KT-39838 fixed
2020-09-29 15:46:16 +03:00
Ilya Goncharov
024771028c [Gradle, JS] Fix yarn.lock resolution in case of duplicated dependencies
^KT-42222 fixed
^KT-40986 fixed
^KT-39838 fixed
2020-09-29 15:46:16 +03:00
Konstantin Tskhovrebov
34b6003371 as42: remove unused bunch files 2020-09-29 15:32:35 +03:00
Konstantin Tskhovrebov
c8def4543d Bump AS versions. 2020-09-29 15:32:35 +03:00
Konstantin Tskhovrebov
8a4aac53d8 as42: Fix override. 2020-09-29 15:32:34 +03:00
Andrei Klunnyi
ddfb86c839 KT-42014 ClassNotFoundException in Android Studio 4.2
KotlinCodeHintsPass was removed in 5fe1eaea but later a reference to
it appeared by accident in 50461e61.
2020-09-29 15:32:34 +03:00
Mikhail Zarechenskiy
8ff141357e as42: move plugin.xml to appropriate resource directy
#KT-41930 Fixed
2020-09-29 15:32:34 +03:00
Mikhail Zarechenskiy
11ac5bd32a as42: Fix test about forgotten bunches 2020-09-29 15:32:34 +03:00
Mikhail Zarechenskiy
929fb1f178 as42: Fix compilation of tests 2020-09-29 15:32:34 +03:00
Nikolay Krasko
99b9bc83a1 as42: Fix assertEqualsToFile usage 2020-09-29 15:32:34 +03:00
Nikolay Krasko
d83355e4c4 as42: Remove setupGradleSettings usage 2020-09-29 15:32:34 +03:00
Nikolay Krasko
fa9368125f as42: Remove clearing scratchesMapping in tests 2020-09-29 15:32:33 +03:00
Nikolay Krasko
c5b70797e2 as42: Fix compilation errors in AbstractJavaToKotlinConverterForWebDemoTest 2020-09-29 15:32:33 +03:00
Nikolay Krasko
1dc3cb5978 as42: Fix compilation errors caused by 202 platform 2020-09-29 15:32:33 +03:00
Nikolay Krasko
ecff2816ac as42: Fix duplication registration for com.intellij.psi.classFileDecompiler in plugin 2020-09-29 15:32:33 +03:00
Nikolay Krasko
a3bef10b97 as42: Add fastutil library to dependency to make KtUsefulTestCase.<clinit> work
java.lang.NoClassDefFoundError: it/unimi/dsi/fastutil/objects/Object2FloatMap
  at com.intellij.configurationStore.MyXmlSerializer$bindingProducer$1.createRootBinding(xmlSerializer.kt:172)
  at com.intellij.configurationStore.MyXmlSerializer$bindingProducer$1.createRootBinding(xmlSerializer.kt:170)
  at com.intellij.configurationStore.OldBindingProducer.getRootBinding(xmlSerializer.kt:154)
  at com.intellij.configurationStore.MyXmlSerializer.getRootBinding(xmlSerializer.kt:186)
  at com.intellij.util.xmlb.Serializer.getRootBinding(Serializer.java:18)
  at com.intellij.configurationStore.JdomSerializerImpl.serializeObjectInto(xmlSerializer.kt:78)
  at com.intellij.configurationStore.XmlSerializer.serializeObjectInto(xmlSerializer.kt:39)
  at com.intellij.configurationStore.XmlSerializer.serializeObjectInto$default(xmlSerializer.kt:38)
  at com.intellij.configurationStore.XmlSerializer.serializeObjectInto(xmlSerializer.kt)
  at com.intellij.codeInsight.CodeInsightSettings.writeExternal(CodeInsightSettings.java:231)
  at org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase.<clinit>(KtUsefulTestCase.java:123)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  at junit.framework.TestSuite.createTest(TestSuite.java:60)
  at junit.framework.TestSuite.addTestMethod(TestSuite.java:307)
  at junit.framework.TestSuite.addTestsFromTestCase(TestSuite.java:150)
  at junit.framework.TestSuite.<init>(TestSuite.java:129)
2020-09-29 15:32:33 +03:00
Nikolay Krasko
1f3602c4b7 as42: Register DumbUtil service as it required in PsiElementFinderImpl 2020-09-29 15:32:33 +03:00
Nikolay Krasko
1b97511248 as42: Register classFileDecompiler through xml
It doesn't work otherwise. It's expected that extension point is registered
at the moment of ClassFileDecompilers instatiation or it fails.
2020-09-29 15:32:32 +03:00
Nikolay Krasko
5ba70b2cbb as42: Additional fixes for AS42 and 202 platform 2020-09-29 15:32:32 +03:00
Nikolay Krasko
2df030f583 as42: Apply 201 <-> AS41 diff 2020-09-29 15:32:32 +03:00
Nikolay Krasko
17e43aadaa Introduce AS42 bunch 2020-09-29 15:32:32 +03:00
Dmitry Petrov
1fc459ab4c JVM_IR KT-42260 add abstract overrides for generated stubs 2020-09-29 14:06:12 +03:00
Alexander Udalov
445b2d6eb1 JVM IR: minor, unmute bytecode text test
Also fix typo in the name
2020-09-29 12:38:54 +02:00
Alexander Udalov
b497f39c29 IR: do not try to render IrUninitializedType
This will improve exception messages in case some error happens on a
function whose return type is uninitialized, as in KT-41401.
2020-09-29 12:32:45 +02:00
Ilya Goncharov
522fdb3e59 [Gradle, JS] Empty compiler plugin classpath for KotlinJsIrLink
^KT-42245 fixed
2020-09-29 12:17:38 +03:00
Mikhail Glukhikh
cebbd21a1e FIR2IR: simplify analysis of companion' callable references 2020-09-29 11:51:21 +03:00
Jinseong Jeon
3151fc8577 FIR2IR: set dispatch receiver for companion member reference
#KT-42132 fixed
2020-09-29 11:51:21 +03:00
Jinseong Jeon
01d852c006 FIR: carry annotations on delegated property accessors 2020-09-29 11:35:19 +03:00
Aleksei Cherepanov
f1aa75fdf8 [JPS] Fix startup environment for Android Studio 2020-09-29 11:30:14 +03:00
Ilmir Usmanov
6ae2951850 Minor. Do not check suffix of function for tail-call optimization hit 2020-09-29 10:04:03 +02:00
Dmitriy Novozhilov
7d277b907f [FIR] Add new backend tests to "[JPS] Run fast FIR tests" configuration 2020-09-29 10:45:16 +03:00
Victor Petukhov
8f333aef3a Introduce warning about forbidden referencing to underscore named parameter of the catch block in a future release (KT-31567) 2020-09-29 10:23:45 +03:00
Victor Petukhov
09f1764f82 Introduce warning for private inline functions which return anonymous objects without specified supertypes (KT-33917) 2020-09-29 10:23:45 +03:00
Victor Petukhov
63d825fa24 Introduce warning for secondary constructor in enums without delegation to primary constructors (KT-35870) 2020-09-29 10:23:45 +03:00
Mikhail Glukhikh
416874f9d0 [FIR] Update BB test license comments 2020-09-29 10:21:22 +03:00
Mark Punzalan
238cc7c257 [FIR] Enable BytecodeText tests for FIR.
143 out of 767 tests (18.6%) are currently failing.
2020-09-29 10:21:21 +03:00
Mark Punzalan
69cd729506 [FIR] Enable BlackBoxAgainstJavaCodegen tests for FIR.
23 out of 156 tests (14.7%) are currently failing.
2020-09-29 10:21:21 +03:00
Mark Punzalan
348ba3e08c [FIR] Enable BlackBoxInlineCodegen tests for FIR.
16 out of 638 tests (2.5%) are currently failing.
2020-09-29 10:21:21 +03:00
Dmitriy Novozhilov
53a7d69ca6 [FIR] Make FirPropertyAccessor inherits FirCallableMemberDeclaration 2020-09-29 10:17:43 +03:00
Dmitriy Novozhilov
8f1062594f [FIR] Add ability to get scopes for declarations of TYPES resolve phase 2020-09-29 10:17:43 +03:00
Dmitriy Novozhilov
cc4f72e032 [FIR] Capture type from type parameter upper bound when needed 2020-09-29 10:17:43 +03:00
Dmitriy Novozhilov
393688ad82 [FIR] Add extension to FirSession to get ConeTypeCheckerContext 2020-09-29 10:17:42 +03:00
Dmitriy Novozhilov
9e4623c52b [FIR] Fix resolution of calls on super to avoid resolve to interface methods
#KT-38400 Fixed
2020-09-29 10:17:42 +03:00
Dmitriy Novozhilov
fb871a55a3 [FIR] Don't create backing field for property without explicit type
#KT-41977 Fixed
2020-09-29 10:17:42 +03:00
Dmitriy Novozhilov
0c0a8f9849 [FIR] Properly pass type attributes for inference of lambda with type variable as expected type
#KT-41989 Fixed
#KT-37317 Fixed
2020-09-29 10:17:42 +03:00
Dmitry Petrov
d9906ae8da Minor: unmute some bytecode listing tests in JVM_IR 2020-09-28 21:48:14 +03:00
Dmitry Petrov
565c156ddb Minor: reformat and cleanup warnings in CollectionStubMethodGenerator.kt 2020-09-28 21:48:14 +03:00
Yan Zhulanow
af1ed77d15 Parcelize: Fix NPE on availability check 2020-09-29 02:37:44 +09:00
pyos
8c423729e4 JVM_IR: slightly refactor ClassCodegen
* reduce code duplication for constructing JvmDeclarationOrigin;
 * move all `visitor.visitInnerClass` calls to before `visitor.done`;
 * make the order of members more strict & remove 3 mutable fields, as
   order-dependent mutation can lead to differences with incremental
   compilation due to inline calls (thus keeping mutable state in
   ClassCodegen is in general unsafe).
2020-09-28 17:08:01 +02:00
Andrei Klunnyi
79e5177126 [KTIJ-145] Memory leak detected 2020-09-28 15:21:21 +02:00
Yaroslav Chernyshev
819e83b68b [Gradle, Cocoapods] Complete logging for corner-case pod configurations 2020-09-28 16:09:36 +03:00
Yaroslav Chernyshev
5f4aa4db27 [Gradle, Cocoapods] Improve logging when deprecated podspec path is used
#KT-41948 Fixed
2020-09-28 16:09:36 +03:00
Toshiaki Kameyama
330502a0a6 KT-22665 "Create object" quick fix produce wrong code for enum (#2883)
* "Create object" quick fix: do not suggest for enum

#KT-22665 Fixed
2020-09-28 14:02:10 +02:00
Victor Petukhov
076eacb3d1 Check implicitly inferred Nothing inside special calls properly: compare constructors instead of types
^KT-41176 Open
2020-09-28 13:27:02 +03:00
Dmitriy Novozhilov
051d64742c Make SpaceBootstrap as default bootstrap source 2020-09-28 12:45:36 +03:00
Dmitriy Novozhilov
f39adfdf15 Update version of kotlin-build-gradle-plugin dependency 2020-09-28 12:43:10 +03:00
Dmitriy Novozhilov
7aef253a36 Add SpaceBootstrap option to kotlin-build-gradle-plugin 2020-09-28 12:43:10 +03:00
Vladimir Dolzhenko
a149d38c98 Register TYPE_CODE_FRAGMENT in KtStubElementTypes
Stubbed type has to be register earlier (see IStubFileElementType#checkNotInstantiatedTooLate)

^KT-28732 Fixed
2020-09-28 11:15:04 +02:00
Alexander Udalov
243db689af Build: fix "unknown enum constant" warning on Nls.Capitalization
#KTI-88 Fixed
2020-09-25 22:17:10 +02:00
Alexander Udalov
cb5c317f91 Gradle: support moduleName option in KotlinJvmOptions
#KT-42058 Fixed
2020-09-25 22:15:55 +02:00
Ilya Kirillov
0edbdaf0c7 Wizard: use EAP Kotlin versions for running import tests 2020-09-25 21:38:36 +03:00
Toshiaki Kameyama
bc580d2fd9 Introduce "Unused result of data class copy" inspection
#KT-34121 Fixed
2020-09-25 17:18:41 +02:00
Alexander Udalov
ae6d89b100 Minor, mute new test for FIR 2020-09-25 16:50:58 +02:00
pyos
bd6ead0467 JVM_IR: check for null when converting unboxed inline classes to strings
`C?` can be unboxed into `T?` if if wraps a reference type `T!!`, but in
this case `null` is not a valid value to pass to `toString-impl`.

 #KT-42005 Fixed
2020-09-25 16:50:34 +02:00
Igor Yakovlev
d2bdab2ef5 [FIR IDE] Add find usages tests for FIR plugin 2020-09-25 17:26:22 +03:00
Igor Yakovlev
d534d92123 [FIR IDE] Implement FIR for KotlinUsageTypeProvider 2020-09-25 17:26:22 +03:00
Toshiaki Kameyama
37ba9eccc4 KT-31553 Complete Statement: Wrong auto-insertion of closing curly brace for a code block (#2378)
* Complete statement: wrap property initializer by run/when block

#KT-31553 Fixed
2020-09-25 16:04:03 +02:00
Toshiaki Kameyama
14bdcb1e26 "Create enum constant" quick fix: suggest if expected type is Any
#KT-22666 Fixed
2020-09-25 15:57:11 +02:00
Mikhael Bogdanov
31ed5430ee Minor. Update test data 2020-09-25 15:45:56 +02:00
Alexander Udalov
f8f2be3d9f Minor, improve test on suspend invoke function reference
Add WITH_RUNTIME to enable it for the old backend, check the generated
function reference methods by starting the coroutine.
2020-09-25 14:52:46 +02:00
Steven Schäfer
20a5c44e41 JVM IR: Fix types in generated function reference constructor
For references to suspend functions this fixes an IllegalStateException
in the type mapper, which is what the "suspendFunctionMethodReference"
test is about.
2020-09-25 14:52:19 +02:00
Jinseong Jeon
f3db113a82 FIR2IR: use @Target to put annotations on either property or backing field 2020-09-25 14:45:49 +03:00
Jinseong Jeon
b59832c5fd FIR: refactor annotation-related utils 2020-09-25 14:45:48 +03:00
Jinseong Jeon
c8170702c6 FIR serializer: special version requirement for @JvmField property in interface companion 2020-09-25 14:45:48 +03:00
Jinseong Jeon
dc2226b42f FIR2IR: put @JvmField on field, not property
#KT-42118 fixed
2020-09-25 14:45:48 +03:00
Mikhail Glukhikh
ae23adb6f5 FIR Java: fix exception during synthetic property enhancement 2020-09-25 14:44:13 +03:00
Mikhail Glukhikh
368de43623 FIR Java: support Java setters more properly in use-site scope 2020-09-25 14:44:11 +03:00
Mikhail Glukhikh
873ea560a9 [FIR2IR] Fix conversion of flexible class reference 2020-09-25 14:44:10 +03:00
Mikhail Glukhikh
fe8e3e99ab [FIR Java] Hide function in scope in case it's an accessor by fact
#KT-42116 Fixed
2020-09-25 14:44:09 +03:00
Dmitry Petrov
70095712eb Minor: drop new bytecode listing test that passes only in JVM_IR
Unfortunately, there's no way to mute it in JVM right now.
Corresponding case is tracked as KT-42179, anyway.
2020-09-25 13:49:53 +03:00
Toshiaki Kameyama
a2f70dfc3d KT-41298 "Remove redundant 'with' call" intention works incorrectly with non-local returns and single-expression functions (#3713)
* Remove redundant 'with' call: remove redundant 'return' keyword

#KT-41298 Fixed
2020-09-25 12:48:31 +02:00
Konstantin Tskhovrebov
8a58ada4cd Fix version parser for versions without status "1.4-M1-42-IJ2020.1-1". 2020-09-25 12:17:17 +03:00
Roman Golyshev
945edfe987 KT-41859 Place classes after typealiases in DeserializedMemberScope
This way, the order in stubs and in deserialized text would be the same

On the next stub version bump, this fix should be reworked: the order
in the `DeserializedMemberScope` should be restored, and the order in
the stubs should be fixed to match the order in `MemberComparator`

^KT-41859 Fixed
2020-09-25 09:03:12 +00:00
Dmitry Petrov
cfd62c15bf JVM_IR KT-36994 don't generate stub if present in superclass 2020-09-25 11:57:33 +03:00
Dmitry Petrov
1adce11257 Add tests for KT-40191 2020-09-25 11:57:32 +03:00
Dmitry Petrov
a45b409e23 Minor: update generated JS tests 2020-09-25 11:57:32 +03:00
Mads Ager
4e518e77ca [JVM_IR] Fix expectations for parcelize tests.
The generated bridges now have line numbers as for the JVM
backend. There are some extra (irrelevant) labels in the JVM_IR
bytecode listing compared to JVM so expectations can still not
be shared even though they are closer.
2020-09-24 20:52:22 +02:00
Alexander Udalov
6d13fe8213 Minor, add explicit type argument to workaround KT-42175 2020-09-24 19:38:26 +02:00
pyos
f30e564c90 JVM_IR: do not use fields' superQualifierSymbol to cast the receiver
It's only for computing the field owner.

 #KT-42131 Fixed
2020-09-24 18:28:23 +02:00
anastasiia.spaseeva
a57c95624d Add changelog for 1.4.20-M1 2020-09-24 18:59:56 +03:00
Dmitriy Novozhilov
0d954f1190 Change module :core:compiler.backend.common.jvm to :compiler:backend.common.jvm 2020-09-24 16:51:06 +03:00
Dmitriy Novozhilov
b343d05e14 [FIR] Implement JvmTypeMapper based on cone types 2020-09-24 16:51:06 +03:00
Dmitriy Novozhilov
a28d0e0b7f Make IrTypeMapper delegate to AbstractTypeMapper 2020-09-24 16:51:06 +03:00
Dmitriy Novozhilov
86d4d320c4 Introduce AbstractTypeMapper based on type markers 2020-09-24 16:51:06 +03:00
Dmitriy Novozhilov
7380abac13 Split AsmUtils to descriptors dependent and independent parts 2020-09-24 16:51:05 +03:00
Dmitriy Novozhilov
54a5a066e8 Introduce new module for common parts of backend utils
Mainly it needed for abstract jvm type mapper for different type systems:
  IrTypes and ConeKotlinTypes
2020-09-24 16:51:05 +03:00
Dmitriy Novozhilov
c3a89e2507 Move common part of typeSignatureMapping.kt to :core:compiler.common.jvm 2020-09-24 16:51:05 +03:00
Dmitriy Novozhilov
d215c413cc Move TypeMappingMode to :core:compiler.common.jvm 2020-09-24 16:51:05 +03:00
Dmitriy Novozhilov
4ef57c120f [FIR] Consider variance of type parameters during java type enhancement
#KT-41940 Fixed
2020-09-24 15:43:20 +03:00
Dmitriy Novozhilov
a0db510e49 [FIR] Split creating fir for java declarations to separate methods 2020-09-24 14:59:35 +03:00
Dmitriy Novozhilov
0d29d6d361 [FIR] Transform when conditions with boolean expected type
#KT-42130 Fixed
2020-09-24 14:59:35 +03:00
Dmitriy Novozhilov
68a47d6efb [FIR] Add helpers for creating diagnostics on nullable source 2020-09-24 14:59:34 +03:00
Svyatoslav Kuzmich
162d9744ff [JS IR] Fix export of constructor with default argument (KT-41275) 2020-09-24 14:58:14 +03:00
Jinseong Jeon
5b136516c4 FIR: utilize checking subtype of functional type and finding invoke symbol 2020-09-24 14:05:52 +03:00
Jinseong Jeon
b10466f6a2 FIR: extend suspend conversion to subtype of functional type 2020-09-24 14:05:52 +03:00
Toshiaki Kameyama
17176c00ae Move lambda out: don't remove block comments
#KT-35357 Fixed
2020-09-24 12:05:43 +02:00
Roman Artemev
6670e4b21d [JS IR] Fix callable reference to generic constructor
- add tests
 - fix KT-42025
2020-09-24 12:50:47 +03:00
Ilmir Usmanov
4da67bf013 Minor. Unmute tests 2020-09-24 10:08:43 +02:00
Ilmir Usmanov
f22f10febb JVM_IR: Unbox inline classes in suspend functions
if the function can be verified to safely returning unboxed
inline class.
Box the return value on resume path.
2020-09-24 10:08:41 +02:00
Victor Petukhov
ccc9b757c0 Fix failing MPP tests after 25ea3df5ca through registering InferenceCompatibilityCheckerImpl instance 2020-09-24 10:49:33 +03:00
Mads Ager
ac742123fd [JVM_IR] Generate line numbers in synthetic bridges.
The current backend does that for some bridges. We do it consistently
for all bridges.

The line number used differs. For the JVM_IR backend, we use the
line number of the class to which the bridge is added. For the
JVM backend, that does not appear to be the case for bridges
in lambdas. I prefer the line number for a lambda invoke bridge
to be the line for the lambda instead os some surrounding class.
2020-09-24 08:59:48 +02:00
Yan Zhulanow
acf1a15f3e Parcelize: Add integration test for the new kotlin-parcelize plugin 2020-09-24 15:51:00 +09:00
Yan Zhulanow
2d158ffebd Parcelize: Add tests for deprecated (kotlinx.android.parcel) annotations 2020-09-24 15:50:59 +09:00
Yan Zhulanow
1d5ab192f5 Parcelize: Support old (kotlinx.android.parcel) annotations in Parcelize plugin 2020-09-24 15:50:59 +09:00
Yan Zhulanow
f0b93bf352 Parcelize: Move back annotations from kotlinx.android.parcel, deprecate them 2020-09-24 15:50:59 +09:00
Yan Zhulanow
75a1323974 Parcelize: Add deprecation warning to Android Extensions Gradle plugin (KT-42121) 2020-09-24 15:50:58 +09:00
Yan Zhulanow
419c88d1f2 Parcelize: Publish Parcelize compiler plugin to IDE dependencies repository 2020-09-24 15:50:58 +09:00
Yan Zhulanow
0ce9003ef7 Parcelize: Add missing dependencies to Parcelize components in tests 2020-09-24 15:50:58 +09:00
Yan Zhulanow
4bd8e2f78c Parcelize: Support the new Parcelize plugin in Gradle (KT-40030) 2020-09-24 15:50:57 +09:00
Yan Zhulanow
15b2850ee0 Parcelize: Add IDE support for the Parcelize compiler plugin with sources extracted from Android Extensions plugin (KT-40030) 2020-09-24 15:50:57 +09:00
Yan Zhulanow
b7796d63d8 Parcelize: Add the Parcelize compiler plugin with sources extracted from Android Extensions plugin (KT-40030) 2020-09-24 15:50:57 +09:00
Yan Zhulanow
c9bca165bc Update generated tests in android-extension-compiler 2020-09-24 15:50:57 +09:00
Steven Schäfer
aca9478998 Parcelize: Recognize (suspend) function types as serializable 2020-09-24 15:50:56 +09:00
Steven Schäfer
a2418484bb Parcelize: More robust code for locating layoutlib.jar 2020-09-24 15:50:56 +09:00
Steven Schäfer
9bf3f105d9 Parcelize: Add a test for sealed Parcelable classes 2020-09-24 15:50:56 +09:00
Steven Schäfer
77fb0ddd32 Parcelize: Update test expectations 2020-09-24 15:50:55 +09:00
rbares
9d000529e7 Fix JVM Parcelize use of Parceler 2020-09-24 15:50:55 +09:00
Steven Schäfer
8ab6411b93 Parcelize, JVM IR: Fix types in nested containers 2020-09-24 15:50:55 +09:00
Yan Zhulanow
eaa5d08736 Move all sources for android-tests to the 'test' source set 2020-09-24 15:50:55 +09:00
Steven Schäfer
3a7cc93c4e JVM IR: More precise check for calls to the implementation method in a default stub 2020-09-24 07:53:31 +02:00
Steven Schäfer
648bc9b1c4 JVM IR: Check for cycles when inlining into default stubs 2020-09-24 07:53:31 +02:00
Steven Schäfer
111c550f3c JVM IR: More tests for inlining in $default stubs 2020-09-24 07:53:31 +02:00
Steven Schäfer
5e27d9b089 JVM IR: Make inlining in $default stubs compatible with the JVM BE
The JVM BE inlines calls to the underlying function in a $default stub
verbatim, e.g., without renaming LVT entries or regenerating anonymous
objects. This commit introduces the same behavior in the JVM IR BE.

Fixes KT-36769.
2020-09-24 07:53:31 +02:00
Steven Schäfer
bef0437edb JVM IR: Generate LVT entries for parameters in inline $default methods 2020-09-24 07:53:31 +02:00
Ilya Kirillov
347a984ce0 FIR IDE: fix tests compilation 2020-09-23 21:43:58 +03:00
Ilya Kirillov
f36cd28696 FIR IDE: introduce withFir function 2020-09-23 21:43:58 +03:00
Ilya Kirillov
a516264923 FIR IDE: introduce withFirDeclaration function 2020-09-23 21:43:57 +03:00
Ilya Kirillov
ebc2ea59cd FIR IDE: introduce WeakFirRef for low level 2020-09-23 21:43:57 +03:00
Ilya Kirillov
8ee4c4e047 FIR IDE: introduce scoped fir functions 2020-09-23 21:43:57 +03:00
Ilya Kirillov
e19d2ecc73 FIR IDE: make FirModuleResolveState functions to be internal 2020-09-23 21:43:57 +03:00
Ilya Kirillov
8e41384f6d FIR IDE: separate LowLevelFirApiFacade from completion 2020-09-23 21:43:56 +03:00
Ilya Kirillov
7cc714c598 FIR IDE: move all public low level api to separate package 2020-09-23 21:43:56 +03:00
Ilya Kirillov
a0337ec10d FIR: fix invalid increasing inner array size in ArrayMapImpl 2020-09-23 21:43:56 +03:00
Ilya Kirillov
4238fd3842 FIR IDE: fix compilation after rename registerJavaSpecificComponents -> registerJavaSpecificResolveComponents 2020-09-23 21:43:55 +03:00
Ilya Kirillov
65ef629ca7 FIR: add ensureResolved to processConstructors 2020-09-23 21:43:55 +03:00
Ilya Kirillov
a570be4e76 FIR IDE: fix compilation of AbstractFirIdeDiagnosticsCollector.kt 2020-09-23 21:43:55 +03:00
Ilya Kirillov
fa570710ee FIR IDE: move diagnostic highlighting to separate
pass
2020-09-23 21:41:54 +03:00
Ilya Kirillov
1f4aff9643 FIR: add ensureResolved to FirSealedClassInheritorsTransformer 2020-09-23 21:41:53 +03:00
Ilya Kirillov
1c0bbaf225 FIR: add ensureResolved to FirExposedVisibilityDeclarationChecker 2020-09-23 21:41:53 +03:00
Ilya Kirillov
04fca93b1e FIR IDE: fix completion on parenthesized expression 2020-09-23 21:41:52 +03:00
Ilya Kirillov
879cf3b049 FIR IDE: do not fail whole completion on exception in lookup element creation 2020-09-23 21:41:52 +03:00
Ilya Kirillov
e9fb79741a FIR IDE: fix completion in initializer 2020-09-23 21:41:51 +03:00
Roman Golyshev
1ab6595ae2 FIR Completion: Use name filtering in completion contributor 2020-09-23 21:41:51 +03:00
Roman Golyshev
75d8710bf6 FIR IDE: Add name filtering to scope KtScope and implementations 2020-09-23 21:41:50 +03:00
Roman Golyshev
dc600e3caf FIR IDE: Fix buildKtType for ConeDefinitelyNotNullType 2020-09-23 21:41:49 +03:00
Ilya Kirillov
74298aae32 FIR IDE: invalidate sessions on exception 2020-09-23 21:41:48 +03:00
Ilya Kirillov
a743b80d17 FIR IDE: reuse up-to-date fir sessions 2020-09-23 21:41:47 +03:00
Ilya Kirillov
22c2d34b14 FIR IDE: add debug info when can not build KtType 2020-09-23 21:41:46 +03:00
Ilya Kirillov
a52262bf97 FIR IDE: run completion resolve under lock 2020-09-23 21:41:45 +03:00
Ilya Kirillov
f1c808384e FIR IDE: do not resolve symbols by transitive module dependencies 2020-09-23 21:41:44 +03:00
Ilya Kirillov
01875635db FIR IDE: do not resolve whole firFile in completion 2020-09-23 21:41:44 +03:00
Ilya Kirillov
2cfbfabe04 FIR IDE: do not recreate transformer phases & ScopeSession 2020-09-23 21:41:42 +03:00
Ilya Kirillov
9a99703f24 FIR IDE: implement incremental function analysis 2020-09-23 21:41:41 +03:00
Ilya Kirillov
8bcba00bb7 FIR IDE: do not resolve declarations if they are already resolved when we are inside lock 2020-09-23 21:41:40 +03:00
Ilya Kirillov
fc64d8d5e8 FIR IDE: reanalyse dependent modules only then they change 2020-09-23 21:41:40 +03:00
Ilya Kirillov
07be30c5db FIR IDE: separate fir session for current module from dependent modules session 2020-09-23 21:41:39 +03:00
Ilya Kirillov
ab897752de FIR IDE: remove invalid comments from FirIdeSessionFactory 2020-09-23 21:41:39 +03:00
Ilya Kirillov
4045c8fbf4 FIR IDE: fix invalid order of classes in classIdIfNonLocal 2020-09-23 21:41:38 +03:00
Ilya Kirillov
766063ba77 FIR IDE: optimize search for FirDeclaration by KtDeclaration 2020-09-23 21:41:37 +03:00
Ilya Kirillov
36e57545e8 FIR IDE: simplify psiModificationTrackerBasedCachedValue 2020-09-23 21:41:36 +03:00
Ilya Kirillov
73451b1616 FIR IDE: reresolve libraries only when they change 2020-09-23 21:41:35 +03:00
Ilya Kirillov
c48cc615dd FIR IDE: use KtAnalysisSession as receiver 2020-09-23 21:41:35 +03:00
Ilya Kirillov
d4786e06a9 FIR IDE: ignore PCE when running lazy resolve phase 2020-09-23 21:41:34 +03:00
Ilya Kirillov
9130392eb9 FIR IDE: resolve symbol to status to get it modality 2020-09-23 21:41:34 +03:00
Ilya Kirillov
0c47d42659 FIR IDE: add failing multiModuleLazyResolve test 2020-09-23 21:41:33 +03:00
Ilya Kirillov
a3a59131b5 FIR IDE: fix passing whenWithHeiarchy test 2020-09-23 21:41:32 +03:00
Roman Golyshev
6d0a5a0bb2 KT-41346 Implement NoReorderImplementation without reordering
- See the documentation for `DeserializedMemberScopeHelper` for the full
info about the fix and the issue
- Add `preserveDeclarationsOrdering` setting to
`DeserializationConfiguration`
- Enable this setting in `DeserializerForClassfileDecompiler`
- Also, use `List` instead of `Collection` to pass members to
`DeserializedMemberScope`. It is done to emphasize that the order of
the members is important and may be used
- Review: https://jetbrains.team/p/kt/review/1627
- ^KT-41346 Fixed
2020-09-23 15:27:51 +00:00
Roman Golyshev
bf371ff98a KT-41346 Refactor computeNonDeclared*
Change the signature of the `computeNonDeclared*` methods so they expect
mutable lists - it better suits their contracts. Also, add a little
documentations about the contract

Also, change `Collection` to `List` for incoming protos to `emphasize`
that their order might be used
2020-09-23 15:27:50 +00:00
Roman Golyshev
b1097c49d3 KT-41346 Move Implementation to DeserializedMemberScope 2020-09-23 15:27:49 +00:00
Roman Golyshev
5596bf33d8 KT-41346 Move related code to OptimizedImplementation
This does not change any semantics, only moves the code around
2020-09-23 15:27:49 +00:00
Roman Golyshev
c8878f862d KT-41346 Introduce inner OptimizedImplementation class
Make it implement `Implementation` and move definitions
there
2020-09-23 15:27:48 +00:00
Roman Golyshev
683dd57f24 KT-41346 Extract Implementation interface
This is a temporary interface to make refactoring easier
2020-09-23 15:27:47 +00:00
Roman Golyshev
341a7478ed KT-41346 Move removing non-available functions to protected method
This would allow to stricten contract on `computeNonDeclaredFunctions`
2020-09-23 15:27:47 +00:00
Roman Golyshev
4f4c25ca5e KT-41346 Cleanup DeserializedMemberScope 2020-09-23 15:27:46 +00:00
Ilya Kirillov
622f71bd65 Fix binary compatibility with AS
#KT-42061 fixed
2020-09-23 18:25:07 +03:00
Dmitry Petrov
1c4567c999 Add tests for KT-40152 2020-09-23 18:14:21 +03:00
Dmitry Petrov
cd37301ea2 Minor: TARGET_BACKEND=JVM in JVM-specific tests 2020-09-23 18:14:21 +03:00
Dmitry Petrov
99dbeecc40 Some more bytecode listing tests for JVM_IR 2020-09-23 18:14:20 +03:00
Victor Petukhov
25ea3df5ca Put fix in 9123c4f73baf77f8a50dede6c890c46f5ffafd6c under the inference compatibility flag 2020-09-23 17:15:58 +03:00
Victor Petukhov
bfb46befa5 Mark projection of a nullable captured type as not null during simplification constrains with it and a nullable type variable
^KT-41913 Fixed
2020-09-23 17:15:57 +03:00
Dmitriy Novozhilov
0f868ff83f [TEST] Regenerate tests 2020-09-23 17:12:14 +03:00
Alexander Udalov
84df996204 JVM IR: fix "step over" for inline function calls in conditions
Reimplement the same hacky approach used in the old backend (see
cc2fe6b0c6).

Previously, the debugger incorrectly stepped into Collections.kt on
"step over" inline function calls from stdlib like 'any'.

Since `if` and `when` expressions are represented the same way in IR,
the behavior is fixed for both of them. It's not the case in the old JVM
backend, where stepping over `when` conditions still suffers from the
same problem, which the newly added test checks.
2020-09-23 15:54:15 +02:00
Toshiaki Kameyama
4144adf4ee Make internal: don't suggest in interface
#KT-35346 Fixed
2020-09-23 15:34:09 +02:00
Toshiaki Kameyama
6e8565917e MapGetWithNotNullAssertionOperatorInspection: decrease severity to INFORMATION
#KT-33096 Fixed
2020-09-23 14:52:14 +02:00
Dmitriy Novozhilov
5e73e28695 [FIR-TEST] Fix psi consistency test due to 5efd533f 2020-09-23 15:32:09 +03:00
Dmitriy Novozhilov
10e7c0f1b2 [TEST] Fix long literal in testdata broken in 4374c06 2020-09-23 15:22:03 +03:00
Toshiaki Kameyama
a2bde2ffb2 Redundant overriding method: do not report when super method is not called
#KT-34959 Fixed
2020-09-23 14:12:06 +02:00
Roman Artemev
76ed09482f [IR BE] Fix inline class lowering
- provide additional type parameters from context when transforming
 constructor into static function.
 - fix KT-41771
 - add test
2020-09-23 14:49:38 +03:00
pyos
5954db18cb JVM_IR: fix lifting of arguments to object super constructors
If the arguments are reordered, they can not only be reads of temporary
variables, but also implicit type casts of said reads.

Fixes #KT-42002
2020-09-23 13:49:16 +02:00
Dmitriy Novozhilov
4d5e54cab6 [FIR] Unwrap definitely not null when matching overrides
#KT-41984 Fixed
2020-09-23 14:05:11 +03:00
Dmitriy Novozhilov
08b5f3ddde [FIR] Remove unused list with java.lang.Object member names 2020-09-23 14:05:11 +03:00
Dmitriy Novozhilov
896103b94b [FIR] Properly resolve implicit invoke calls
#KT-41990 Fixed
2020-09-23 14:05:11 +03:00
Dmitriy Novozhilov
a8e81e9ad1 [FIR] Add special node for implicit invoke calls 2020-09-23 14:05:11 +03:00
Dmitriy Novozhilov
696c8f07b4 [FIR] Add pretty toString to CallKind 2020-09-23 14:05:11 +03:00
Dmitriy Novozhilov
40a9bb6eac [FIR] Assume nullable types as good types for ILT approximation
#KT-41982 Fixed
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
f069857492 [FIR] Cleanup annotations transform in FirExpressionsResolveTransformer 2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
0e91c8f048 [FIR] Create synthetic properties for members of java annotations
#KT-41939 Fixed
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
da3a676c2a [FIR] Get rid of FirIntegerLiteralTypeScope and corresponding stuff 2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
4374c06537 [FIR] Approximate all integer literals which resolved in independent mode
#KT-42016
2020-09-23 14:05:10 +03:00
Dmitriy Novozhilov
5efd533f55 [FIR] Desugar unary plus and minus as part of integer literal
#KT-42016
2020-09-23 14:05:09 +03:00
Dmitriy Novozhilov
a018847f85 [FIR] Properly deserialize type attributes for type arguments
#KT-41991 Fixed
2020-09-23 14:05:09 +03:00
Dmitriy Novozhilov
a274216f14 [FIR] Check that expected lambda type is extension function using cone expected type
#KT-41991 In progress
2020-09-23 14:05:09 +03:00
Dmitriy Novozhilov
57a57d10da [FIR] Add rendering for attribites of cone types 2020-09-23 14:05:07 +03:00
Alexander Udalov
d48307ec34 JVM IR: do not copy type parameters into suspend lambda classes
Declarations inside that class are referencing the type parameters of
the containing function anyway, since we don't do any remapping. So the
resulting IR is slightly more correct, and doesn't lead to type
parameter/argument size mismatch error on IrBased/Wrapped-descriptors.

This reverts a part of 01da7f289b, which looks like it was no longer
necessary after 8d0ffa1444.

 #KT-42028 Fixed
2020-09-23 12:21:37 +02:00
Toshiaki Kameyama
bdf502edef Override/Implement members: don't add 'external' modifier
#KT-33466 Fixed
2020-09-23 11:51:08 +02:00
Vladimir Dolzhenko
4e5c61cd2f Notify if gradle points to invalid JDK
^KT-41141 Fixed
2020-09-23 09:44:07 +00:00
Vladimir Dolzhenko
be20a8bd80 Configure modules Kotlin language settings in a background with a progress
^KT-41936 Fixed
2020-09-23 09:18:52 +00:00
Dmitriy Dolovov
f0cbd6b1a5 HMPP: Avoid NPE during Kotlin facet serialization
^KT-42029
2020-09-23 10:39:11 +03:00
Mikhail Glukhikh
4653a16450 [FIR2IR] Add problematic test with in/out clash during approximation 2020-09-23 09:01:45 +03:00
Mikhail Glukhikh
3a57a541f4 FIR mangler: support captured types 2020-09-23 09:01:42 +03:00
Mikhail Glukhikh
b64b32e06b FIR: keep captured types in substitution scope 2020-09-23 09:00:57 +03:00
Mikhail Glukhikh
b7059a3eeb FIR: perform type approximation when completion isn't required 2020-09-23 09:00:57 +03:00
Mikhail Glukhikh
0310272738 FIR: perform more proper type approximation in completion
Note: test data change is questionable here
2020-09-23 09:00:57 +03:00
Mikhail Glukhikh
14cfc62745 FIR: fix calculation of type arguments for bare types 2020-09-23 09:00:57 +03:00
Mikhail Glukhikh
3c3aa3210e FIR: use FROM_EXPRESSION, not FOR_SUBTYPING capt. types in substitution 2020-09-23 09:00:56 +03:00
Mikhail Glukhikh
86d1a3be37 FIR serializer: throw exception on getting ConeIntegerLiteralType
This commit assumes that ILTs are forbidden
at the end of resolve, at least in public API
2020-09-23 09:00:56 +03:00
Mikhail Glukhikh
5a919cc827 FIR element serializer: drop duplicated approximation code 2020-09-23 09:00:56 +03:00
Mikhail Glukhikh
104f088d4e FIR serializer: throw exception on getting ConeCapturedType
This commit assumes that captured types are forbidden
at the end of resolve, at least in public API
2020-09-23 09:00:56 +03:00
Georgy Bronnikov
83ee705c0a IR: make IrClassReference.classType mutable 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
9d22ef948c IR: rework ScopeValidator 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
377940a6ea IR: handle IrVararg.varargElementType in RemapTypes 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
a542bb6af7 IR: check IrClassReference.classType in ScopeValidator 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
728c55973a IR: handle MemberAccessExpression type parameters in RemapTypes 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
3041a2815c IR: handle varargElementType in LocalDeclarationsLowering 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
8990344bb2 Varargs: add test 2020-09-22 23:53:41 +03:00
Georgy Bronnikov
67d7bf3269 IR: take care of supertypes when copying IrTypeParameters 2020-09-22 23:53:40 +03:00
Georgy Bronnikov
916d66c220 IR: add ScopeValidator 2020-09-22 23:53:40 +03:00
Georgy Bronnikov
382f423ab9 Mute a test under DCE 2020-09-22 23:53:40 +03:00
Georgy Bronnikov
33a2c69122 IR: remap types in LocalDeclarationsLowering 2020-09-22 23:53:40 +03:00
Georgy Bronnikov
1f3d344835 IR: add RemapTypes.kt 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
df1d9a0113 IR: make IrTypeParameter.superTypes persistent mutable field 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
a409976d28 IR: make IrValueParameter.varargElementType mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
a3763e8276 IR: make IrTypeAlias.expandedType mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
78fc690f29 IR: make IrLocaldelegatedProperty.type mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
09a906cc9a IR: make IrTypeOperatorCall.typeOperand mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
d9681e535d IR: make IrField.type mutable 2020-09-22 23:53:39 +03:00
Georgy Bronnikov
5065b1a4c6 Make IrValueDeclaration.type mutable 2020-09-22 23:53:38 +03:00
Georgy Bronnikov
1f37795e08 IR: make IrExpression.type mutable 2020-09-22 23:53:38 +03:00
Alexander Udalov
fde7fc6951 JVM IR: use correct file for final test output check in debugger tests
Before this change, a test with incorrect .ir.out could pass if the test
execution result was equivalent to the main .out file, which was a bit
confusing.
2020-09-22 19:15:35 +02:00
Mads Ager
78483930bc [JVM_IR] Fix offsets in constant propagation optimization.
Loads of temporary variables that contain constants are replaced
with a copy of the constant. This avoids locals loads and stores.
However, the copy of the constant needs to have the offset of
the load and not of the original constant.

Fixes KT-41963.
2020-09-22 19:12:06 +02:00
Alexander Udalov
f273edeb8e Build: upgrade language to 1.3 in cli, compiler plugins and Gradle plugin
The language/API version restriction here is to make sure the code works
with Gradle of earlier versions, but all versions of Gradle that we
support already depend on Kotlin 1.3+.
2020-09-22 19:10:58 +02:00
Alexander Udalov
5755c32c84 Minor, fix appendln deprecation warnings in cli
Can't use appendLine yet because this module is compiled with API
version 1.3.
2020-09-22 19:10:58 +02:00
Toshiaki Kameyama
f20a6b7fe1 Change function signature: add/change receiver type
#KT-21799 Fixed
2020-09-22 18:07:24 +02:00
Mads Ager
9f3ce099ee [JVM_IR] Fix line numbers for function reference invoke methods. 2020-09-22 16:59:46 +02:00
Ilya Goncharov
16b2379cd7 [Gradle, JS] Use new npm versions 2020-09-22 16:57:21 +03:00
Ilya Goncharov
9f9cb4f57e [Gradle, JS] Parallelize requests 2020-09-22 16:57:21 +03:00
Ilya Goncharov
a86dd8b5ba [Gradle, JS] Refactor with coroutines 2020-09-22 16:57:21 +03:00
Ilya Goncharov
4986e8c9cc [Gradle, JS] Fetch NPM package versions in separate module 2020-09-22 16:57:21 +03:00
Ilya Goncharov
db90c9cc88 [Gradle, JS] Move from NpmVersions 2020-09-22 16:57:21 +03:00
Mikhael Bogdanov
7d4a734791 Fix nullability of typePath parameter
#KT-41484 Fixed
2020-09-22 15:37:02 +02:00
Dmitry Petrov
0539b2b389 Mute some FIR->JVM_IR box tests
FIR generates delegated class members incorrectly (with non-substituted
signatures).
2020-09-22 16:32:27 +03:00
Dmitry Petrov
c03573fc18 JVM_IR fix override equivalence check for collection stub generation
KT-42043 KT-42033
2020-09-22 15:26:34 +03:00
Pavel Kirpichenkov
fdc134ff66 [NI] Use compatibility mode for KT-41934 2020-09-22 15:06:12 +03:00
Pavel Kirpichenkov
1465e10f12 Add language feature for inference compatibility mode
The feature is intended for updates in the inference algorithm
that change behaviour compared to the previous stable version.
2020-09-22 15:06:12 +03:00
Pavel Kirpichenkov
896fbbd1a3 [NI] Add extra ordering for ready-for-fixation variables
Helps fixing to more specific type in the following situations:
Type1 <: Var1
Var2 <: Var1
Var2 <: Type2

Type1 and Type2 may also be nullable and non-nullable versions of the same type.
Note that no additional constraints can be inferred from such constraints before fixation.
Resulting types for variables will always Type1 and Type2 may also be nullable and non-nullable versions of the same type.
Fixing Var1 first will make Var2's type more specific while fixing Var2 first
will make Var1's type less specific. The first is preferrable in general.
2020-09-22 15:06:12 +03:00
Kirill Shmakov
ec8465859c Support rerun of MPP tests for jvm target 2020-09-22 14:44:22 +03:00
Kirill Shmakov
23642d2f86 Support rerun of common MPP tests
This is to fix #KT-36909
2020-09-22 14:44:19 +03:00
Toshiaki Kameyama
c09c0468d4 Replace deprecated symbol usage: move named lambda argument outside parentheses
#KT-31523 Fixed
2020-09-22 10:51:36 +02:00
Toshiaki Kameyama
d9cf4ee732 Add intention to evaluate compile time expression
#KT-40251 Fixed
2020-09-22 10:46:54 +02:00
Mark Punzalan
8cac3f654c [FIR] Handle pre/postfix dec/increment of labeled expression 2020-09-22 11:06:27 +03:00
Mark Punzalan
f55ff8eb1b [FIR] Capture receiver for pre/postfix dec/increment of qualified access
This prevents double-evaluation of the receiver expression, which may
have side-effects. E.g.: a.b++
2020-09-22 10:20:46 +03:00
Mikhail Glukhikh
393189db8d FIR JVM serializer: fix compilation after rebase 2020-09-22 09:54:43 +03:00
pyos
6e143a2656 JVM_IR: collect free type parameters when serializing FIR metadata
The "free" in "createFreeFakeLambdaDescriptor" and such refers to the
fact that there are no references to type parameters from outside the
current declaration. This is necessary because at the point where the
metadata is written, the type parameters may not even be in scope (e.g.
local delegated properties are serialized at class level, but may refer
to function-scope type parameters).
2020-09-22 09:35:50 +03:00
pyos
aa58ed9234 JVM_IR: partially implement FIR local delegated property reflection
Type parameter references are broken, just like for lambdas. Also, the
code is super ugly.
2020-09-22 09:35:45 +03:00
Alexander Udalov
6f622920e7 Minor, deduplicate matching JVM_OLD/JVM_IR duplicateJvmSignature tests 2020-09-21 18:49:36 +02:00
Mads Ager
05c662ec55 [JVM_IR] Remove line numbers from delegated member functions.
This fixes smart step into for delegated member functions.
Additionally, we align on the string "memberFunctionName(...)"
for expression non-null checks for both JVM_IR and JVM
backends.
2020-09-21 18:49:08 +02:00
Leonid Startsev
eea4ff33a0 Adapt serialization exceptions constructor calls to signature change
(see https://github.com/Kotlin/kotlinx.serialization/pull/1054)
2020-09-21 17:10:12 +03:00
Leonid Startsev
fe5dbf75fa Add diagnostic to check whether provided custom serializer matches
type of the property.

Check for serializer type mismatch only when custom serializer is present

Otherwise, there are too many false positives on e.g. PolymorphicSerializer

#KT-36329 Fixed

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/830
2020-09-21 17:10:12 +03:00
Leonid Startsev
bc432ecb85 Improve remove/specify type intentions in Explicit API mode
Do not suggest to remove type for public declarations

 #KT-38915 Fixed

Do not show intention to specify type when corresponding quickfix is available

 #KT-39026 Fixed
2020-09-21 17:10:10 +03:00
Leonid Startsev
5f0e7c3c3f Check return type of internal @PublishedApi functions in Explicit API mode
#KT-38981 Fixed
2020-09-21 17:03:06 +03:00
Mikhail Glukhikh
a9972913a6 [FIR TEST] Add some FIR_IDENTICAL to fix recently changed tests 2020-09-21 16:20:37 +03:00
Andrey Uskov
c9054e7a04 Added possibility to split gradle-integration-tests locally
Added property `gradle.integration.tests.split.tasks` for splitting
gradle-integration-tests into several tasks locally (like it happens
at TeamCity)
2020-09-21 13:34:32 +03:00
Andrey Uskov
d151f0e573 Fixed splitting gradle tests into different tasks 2020-09-21 13:34:25 +03:00
Dmitry Savvinov
769c741d87 Revert "Pack jvm builtins into kotlin-stdlib shipped with idea plugin"
This reverts commit 0b5aedb0a2.
2020-09-18 17:30:44 +03:00
Dmitry Savvinov
6db70bb97d Minor: fix forgotten testdata after 6a55475392 2020-09-18 16:42:49 +03:00
Ilya Gorbunov
0b5aedb0a2 Pack jvm builtins into kotlin-stdlib shipped with idea plugin
This lessens the possibility that kotlin plugin will get different
variants of builtins in the classpath, thus making builtins resources
loading less order-dependent.
2020-09-18 15:11:45 +03:00
Leonid Startsev
f2cf64aec7 Create plugin context before launching actual psi2ir process.
Because IrPluginContextImpl constructor creates new instance of
BuiltinSymbolsBase (with symbols for stdlib declarations like `arrayOf` etc),
there should be at least one pass of `declareUnboundSymbolsAsDependencies`
between creation and usage in plugin. Such pass is located between psi2ir
and compiler plugins application. If plugin context is created inside lambda,
right before plugins are applied, the symbols will remain unbound.

 #KT-41764 Fixed
2020-09-18 14:58:38 +03:00
Dmitry Petrov
ee3ada4e55 JVM_IR KT-40304 KT-41998 special handling for 'removeAt' 2020-09-18 14:27:36 +03:00
Kirill Shmakov
9008944860 Use target of the test in rerun dialog
This is to fix #KT-37799
2020-09-18 13:15:41 +03:00
Ilmir Usmanov
b406022315 Mark Unit unspillable if it is merged with unspillable Unit
#KT-42004: Fixed
2020-09-17 23:23:14 +02:00
Alexander Udalov
f6e4705d9c Regenerate KotlinSteppingTestGenerated 2020-09-17 22:16:47 +02:00
Mads Ager
a62ffbf992 [JVM_IR] Ignore fwBackingField stepping test.
The test relies on fixes not yet landed, so it currently fails.
2020-09-17 22:14:30 +02:00
Georgy Bronnikov
8343ca093c IR: bugfix in wrapped, IR-based descriptors 2020-09-17 19:16:03 +03:00
Georgy Bronnikov
c2bdedfbae JVM_IR: remove descriptor usage from JvmSignatureClashDetector 2020-09-17 19:16:03 +03:00
Georgy Bronnikov
c7f10c272a JVM_IR: remove .toKotlinType() from PromisedValue 2020-09-17 19:16:03 +03:00
Georgy Bronnikov
7c5e255fa3 JVM_IR: remove .toKotlinType() from IrInlineIntrinsicsSupport 2020-09-17 19:16:03 +03:00
Georgy Bronnikov
991a832d8c JVM_IR: remove KotlinType reference from jvm/ir/IrUtils.kt 2020-09-17 19:16:03 +03:00
Georgy Bronnikov
3c0fbd5f45 IR: remove .toKotlinType() usage from coerceToUnit calls in lowerings 2020-09-17 19:16:03 +03:00
Dmitry Savvinov
6a55475392 Dont show warning for KT-21515 with LV>=1.3 2020-09-17 18:33:19 +03:00
Dmitriy Novozhilov
57ceb0fa20 [FIR] Don't create call to this in generated provideDelegate for top-level extension properies 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
a666eee67b [FIR] Properly deserialize annotations on typealias and underlying type 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
748049daa3 [FIR] Don't call inline lambda twice in withFullBodyResolve 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
f9de2621b2 [FIR] Minor, fix TODO in constantValues
KT-8507
2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
535de7bdc8 [FIR] Cleanup code of FirTypeDeserializer.kt 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
8deab3559e [FIR] Get rid of FirDeserializationComponents 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
d4cc98fab1 [FIR] Safe VersionRequirementTable in deserialized declarations 2020-09-17 17:23:26 +03:00
Dmitriy Novozhilov
7c5160a968 [FIR] Remove meaningless TODO's 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
73c8059884 [FIR] Properly deserialize arrays in annotation arguments 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
ae819ff059 [FIR] Add configurable typeRef to FirArrayOfCallBuilder 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
d4891cb464 [FIR] Move Jsr305State from FirSession to separate component 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
93d63f7c66 [FIR] Get rid of FirResolvedFunctionTypeRef 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
edab50ac61 [FIR] Get rid of FirResolvedTypeRef.isSuspend 2020-09-17 17:23:25 +03:00
Dmitriy Novozhilov
6c5cf8eda3 [FIR] Cleanup code in body resolve 2020-09-17 17:23:24 +03:00
Dmitriy Novozhilov
d4038f35b6 [FIR] Make BodyResolveComponents an abstract class 2020-09-17 17:23:24 +03:00
Ilmir Usmanov
dfd7f33bd3 Minor. Add test with reified type parameter 2020-09-17 16:14:07 +02:00
Ilmir Usmanov
9ecf5dc9af Support is/as operations on suspend callable reference conversion 2020-09-17 16:14:04 +02:00
Vladimir Dolzhenko
dfe6c42f63 Remove 203 version from idea range for kotlin plugin 1.4.20
^KT-41976 Fixed
2020-09-17 11:58:46 +02:00
Vladimir Dolzhenko
985f2b839c Add regression tests to cover Unused symbol with private anonymous object property
^KT-39454 Fixed
2020-09-17 11:54:53 +02:00
Jinseong Jeon
d1ba69044e FIR: update the type of anonymous function as SAM 2020-09-17 12:45:26 +03:00
Ilmir Usmanov
f960201f52 Ignore type parameters of inline class
when checking whether we can return unboxed inline class
from suspend function
2020-09-17 11:20:48 +02:00
Dmitry Petrov
fbfe56e0cc JVM_IR KT-41915 compare Kotlin signatures when adding collection stubs 2020-09-17 11:37:29 +03:00
Toshiaki Kameyama
0e4bd70c29 Redundant nullable return type: fix false positive with elvis return
#KT-41878 Fixed
2020-09-17 09:49:02 +02:00
Vladimir Dolzhenko
51d405e950 Add json output for IDE performance tests 2020-09-17 08:57:08 +02:00
Jinseong Jeon
72dea05854 FIR2IR: approximate type argument if reified 2020-09-17 09:43:46 +03:00
Jinseong Jeon
721248f883 FIR: migrate type-related utils to relevant file 2020-09-17 09:32:52 +03:00
Mikhail Glukhikh
0436a555d5 [FIR serializer] Support type approximation
Before this commit we relied on a fact that exotic types aren't
possible at serialization stage. However, in non-ABI mode we can get
even a private function (e.g. top-level private), so we have to perform
this approximation.
2020-09-17 09:19:34 +03:00
Mikhail Glukhikh
94a30ff904 [FIR] Drop redundant type check 2020-09-17 09:16:00 +03:00
Roman Artemev
4da7e762fe [IR] Skip hidden parameters in WrappedDescriptors 2020-09-17 00:57:17 +03:00
Roman Artemev
1da2830e2b [IR] Support hidden parameters in ir builder 2020-09-17 00:57:16 +03:00
Roman Artemev
b84084d54e [IR] Support hidden parameters in IrMangler
- make them be skipped in signature
2020-09-17 00:57:16 +03:00
Roman Artemev
8209b70a2f [KLIB] Support isHidden flag in deserialization 2020-09-17 00:57:16 +03:00
Roman Artemev
83d6255294 [KLIB] Support isHidden in proto flags 2020-09-17 00:57:16 +03:00
Roman Artemev
f01941d1dd [IR] Support isHidden is IrFactory API
- add API to create a hidden value parameter
2020-09-17 00:57:16 +03:00
Roman Artemev
79e2886da1 [IR] Add isHidden flag into IrValueParameter 2020-09-17 00:57:15 +03:00
Ilya Kirillov
be16fa76ab Wizard: fix not auto-updated artifactId on project name change
#KT-41695 fixed
2020-09-17 00:29:48 +03:00
Ilya Kirillov
ca3b327592 Wizard: add missing jvm target version for tests in Groovy DSL
#KT-41958 fixed
2020-09-17 00:29:48 +03:00
Ilya Kirillov
ee2f0f45fc Wizard: ignore Kotlin repo in tests
They may differ sometimes as they depend on the latest Kotlin release
2020-09-17 00:29:47 +03:00
pyos
9b157fd291 JVM_IR: remove a descriptor-related hack from InterfaceLowering
It will break with FIR.
2020-09-16 18:58:40 +02:00
pyos
dd913ef450 JVM_IR: move common metadata serialization code to ClassCodegen 2020-09-16 18:58:40 +02:00
pyos
a06181771f IR: make DescriptorMetadataSource a subtype of MetadataSource
FirMetadataSource is a metadata source too.
2020-09-16 18:58:40 +02:00
Alexander Udalov
86cc5840ed JVM IR: unmute stepping test noParameterExtensionLambdaArgumentCallInInline3.kt
Bytecode generated by JVM IR ensures that on multiline expressions,
every call is stepped over, which seems better than in the old backend.

Also remove kt34905.kt since it duplicates this test case.
2020-09-16 17:52:27 +02:00
Alexander Udalov
0cccc61654 JVM IR: unmute stepping test smartStepIntoInterfaceImpl.kt
The only difference seems to be that step into IImpl.fooOverride is
actually supported in JVM_IR. Also fix slightly incorrect line numbers
in the comments.
2020-09-16 17:52:27 +02:00
Mads Ager
e943d76266 [JVM_IR] Rebase fwBackingField stepping test.
The difference is that JVM_IR generates line numbers for the
constructor field initialization.

In this case:

```
29: class B {
30:   // comment
31:   val bPropVal: Int,
32:   // comment
33:   var bProbVar: Int
34: ) {
```

the line numbers for the field initializations are 31 and 33 where
in the current backend the whole constructor has line number 29.
2020-09-16 17:51:22 +02:00
Лихолетов Михаил
cfc1ebb4be [FIR] Support several annotation argument diagnostics 2020-09-16 16:53:31 +03:00
Mikhail Glukhikh
0c13d3197c [FIR] Fix non-serializable type argument at the end of resolve 2020-09-16 16:53:29 +03:00
Dmitry Petrov
54d5494ecd JVM_IR special handling for 'remove' collection method stub 2020-09-16 15:36:16 +03:00
Kirill Shmakov
e6e47f8848 Make watchOS test runnable on another bitness 2020-09-16 14:58:28 +03:00
Alexey Tsvetkov
c56952a01e Provide message collector for Java IC analysis
#KT-37446 Fixed
2020-09-16 14:04:51 +03:00
Victor Petukhov
17db188b0e Add regression test for already fixed issue KT-41396 2020-09-16 14:02:32 +03:00
Alexander Anisimov
5e46e5355d Merge pull request #3706 from 1anisim/patch-2
Update ReadMe.md
2020-09-16 13:59:12 +03:00
Igor Yakovlev
57ebd0e13a [FIR IDE] Remove unused code and add logging to LightClassProvider
Remove not used icons from independed icons provider
Add class logging to KotlinUsageTypeProvider
Remove redundant comments from LightClassProvider
2020-09-16 10:47:47 +03:00
Igor Yakovlev
be4fcd626c [FIR IDE] Separate searchers from descriptor usage
KotlinConstructorDelegationCallReferenceSearcher
KotlinConventionMethodReferencesSearcher
KotlinDefinitionsSearcher
KotlinOverridingMethodReferenceSearcher
KotlinPropertyAccessorsReferenceSearcher
KotlinTodoSearcher
2020-09-16 10:47:47 +03:00
Abduqodiri Qurbonzoda
36e6247125 Add more details about bit shift operations #KT-41112 2020-09-16 04:05:12 +03:00
Abduqodiri Qurbonzoda
1c0ac850e8 Incorrect documentation for rangeTo function #KT-41356 2020-09-16 04:05:12 +03:00
Steven Schäfer
56c4a27887 Android Synthetics: Resolve unbound symbols in the AndroidIrExtension 2020-09-15 22:36:50 +02:00
Steven Schäfer
fe466f3dc6 Android Synthetics: Update test infrastructure 2020-09-15 22:36:50 +02:00
Alexander Udalov
fb183ec3f8 Never use JVM IR to compile coroutines-experimental
JVM IR backend doesn't support old coroutines, so we disable it via
-Xno-use-ir, just as for the main source set. This option has no effect
for the current master builds, but will be necessary once JVM IR is
enabled project-wide.
2020-09-15 19:59:14 +02:00
Alexander Udalov
f6187b9d64 Remove dependency of fir:tree:tree-generator on kotlin-reflect
This dependency was unused. It allows to avoid waiting for compiling
kotlin-reflect (which includes descriptors, deserialization, etc.)
before compiling FIR modules and thus improves total build time.
2020-09-15 19:59:14 +02:00
Ilmir Usmanov
58146c4452 Keep DebugMetadata annotation when regenerate lambda with state-machine
When a suspend lambda does not capture crossinline lambda, it is
generated with as state-machine, since it does not inline anything.
However, when regenerating, the inliner used to remove all DebugMetadata
annotations to avoid duplication. This lead to missing annotation if
the lambda is regenerated, but state-machine is not regenerated.
This change fixes the blind spot by readding the annotation after
regeneration.
 #KT-41789 Fixed
2020-09-15 19:57:02 +02:00
Kirill Shmakov
12489ef1b4 Show run test gutters only when appropriate
This is to fix KT-36370
2020-09-15 19:09:52 +03:00
Victor Petukhov
8cabfda832 Add regression test for already fixed issue KT-41885 2020-09-15 19:03:16 +03:00
Ivan Gavrilovic
7c360c0068 Kotlin Gradle plugin - use build service to share incremental compilation info
For large projects, incremental comilation mapping information may be quite
large. With configuration caching enabled, each task gets its own copy of that
state, and for a project with 1400 subprojects, this resulted in 3.6GB of additional
state stored (once task graph is cached).

This change introduces IncrementalModuleInfoProvider which allows build service
to be used if configuration caching is enabled, and it falls back to static
constant otherwise.
2020-09-15 15:19:56 +03:00
Igor Yakovlev
16d51eb510 [FIR IDE] Add ReadWriteAccessChecker FIR stub 2020-09-15 11:25:07 +03:00
Igor Yakovlev
7a19bc32a7 [FIR IDE] Add base implementation of find usages of overrides 2020-09-15 11:25:07 +03:00
Igor Yakovlev
f05630fcab [FIR IDE] Enabled search services and added services stubs 2020-09-15 11:25:07 +03:00
Igor Yakovlev
1a10275d0d [FIR IDE] Enabled usages services and added services stubs 2020-09-15 11:25:06 +03:00
Igor Yakovlev
75347d06b9 [FIR IDE] Move IconProvider in fir independed module 2020-09-15 11:25:06 +03:00
Igor Yakovlev
e30f09d513 [FIR IDE] Separate find usages logic from descriptors 2020-09-15 11:25:06 +03:00
Pavel Kirpichenkov
b102042dd8 Minor: add regression test for KT-41806 2020-09-15 10:52:47 +03:00
Jinseong Jeon
2fad935ce2 FIR deserializer: load inline/external flags properly 2020-09-15 10:21:35 +03:00
Sergey Bogolepov
2154c94100 [Native] Add tests for resolvable properties 2020-09-15 13:54:10 +07:00
Sergey Bogolepov
5a0a853d9b [Native] Add simple symbol mechanism to konan.properties
Java Properties format is extremely trivial and does not support any
kind of references or variables. It makes konan.properties repetitive.
This commits adds support of perl-like `$` sigil which allows to
reference properties inside values.
2020-09-15 13:54:09 +07:00
Pavel Punegov
fc35b5398c Mute test in Native 2020-09-14 23:41:47 +03:00
Nikita Bobko
0b2d05ee30 Minor: dereference archiveFile when logging it
Previously it was "Plugin artifacts packed to task ':zipPlugin' property 'archiveFile'"
After fix it's    "Plugin artifacts packed to /home/bobko/jb/kotlin/build/kotlin-plugin.zip"

`archiveFile` has type `Provider<RegularFile>`
2020-09-14 21:37:09 +03:00
Aleksei Cherepanov
c64c319231 JPS. Suppress "Add new files to git" during portable artifacts extraction 2020-09-14 19:06:43 +03:00
Roman Golyshev
7e2269a3cf Update completion-ranking-kotlin dependency (0.1.2 -> 0.1.3) 2020-09-14 15:19:36 +00:00
Mikhail Glukhikh
97ebf2867a [FIR] Get rid of type mismatch suppression during diagnostic casting 2020-09-14 18:08:33 +03:00
Mikhail Glukhikh
6fd3b011ca [FIR] Simplify substitution for unsafe-variant type parameter types
#KT-41792 Fixed
2020-09-14 18:08:31 +03:00
Mikhail Glukhikh
e1b4108e4a [FIR2IR] Mute some tests due to captured type problems 2020-09-14 18:08:30 +03:00
Mikhail Glukhikh
aa897db132 [FIR] Introduce UnsafeVariance attribute (see KT-41792) 2020-09-14 18:08:29 +03:00
Mikhail Glukhikh
e4aaae9ae7 FIR call completion: approximate type argument types
This commit removes some captured / ILT types at the end of resolve
2020-09-14 18:08:28 +03:00
Mikhail Glukhikh
3b828ac62b [FIR] Bad test data fixes (around captured types) 2020-09-14 18:08:27 +03:00
Mikhail Glukhikh
cf5480a398 [FIR] Questionable test data fixes (around captured types) 2020-09-14 18:08:26 +03:00
Mikhail Glukhikh
4605a65f41 [FIR] Good test data fixes (around captured types) 2020-09-14 17:56:39 +03:00
Mikhail Glukhikh
c2d9fc469a Get rid of exception at ConeKotlinType.varargElementType 2020-09-14 17:56:37 +03:00
Mikhail Glukhikh
2f61a2f56f [FIR] Provide correct comparison of captured types 2020-09-14 17:56:36 +03:00
Mikhail Glukhikh
b5f8fec213 FIR substitution: use standard approximation to remove captured types 2020-09-14 17:56:35 +03:00
Mikhail Glukhikh
7a73787680 [FIR] Use captureFromArguments in createSubstitution
This commit breaks ~57 resolve tests because captured types
now exists at the end of FIR resolve
2020-09-14 17:56:34 +03:00
Mikhail Glukhikh
e83f3bbf04 Introduce substitution to ConeTypeContext.captureFromArguments
This commit itself does not influence anything
2020-09-14 17:56:33 +03:00
Mikhail Glukhikh
414842343d [FIR2IR] Add another problematic test with captured type argument 2020-09-14 17:56:32 +03:00
Mikhail Glukhikh
267382d86b [FIR2IR] Add problematic test with incorrect type argument
NB: we should not have <E> as AbstractFirBasedSymbol type argument,
because it isn't accessible in the current scope. Star expected instead.
2020-09-14 17:56:30 +03:00
Dmitry Petrov
b395771d01 KT-37050 don't generate redundant special bridges
Loosely based on https://github.com/JetBrains/kotlin/pull/3662
2020-09-14 16:13:34 +03:00
Alexander Udalov
f0282bcfdf JVM IR: add module name for internal functions before "$default"
The change is a bit complicated because the name mapping logic is
refactored so that we would compute the needed suffix first (either
module name, or multifile part class name), and then shove it into the
mangled name between the original function name and "$default", if the
function in question is the default arguments adapter.

The main motivation for this change was to fix KT-41809, but as a side
effect, private functions with default arguments in multifile parts now
also contain the file name, just like normal private functions.

 #KT-41809 Fixed
2020-09-14 13:18:24 +02:00
Alexander Udalov
93f38e1c61 JVM IR: minor, use more specific types in MethodSignatureMapper 2020-09-14 13:18:24 +02:00
Alexander Udalov
2a0f64ebcb JVM IR: do not generate Deprecated(HIDDEN) class as synthetic
#KT-41810 Fixed
2020-09-14 13:18:24 +02:00
Ivan Gavrilovic
162dc3aa0c KT-41295: Friend paths and compiler options compatible with conf caching
This change fixes serialization of friend paths and it uses
a file collection to record all friend paths. Also, when
computing the tested classpath for android projects, we now avoid
resolving the file collection until necessary.

Fixes: KT-41295
Test: ConfigurationCacheForAndroidIT
2020-09-14 13:31:52 +03:00
Dmitriy Novozhilov
be916e556a [FIR] Properly update type of block after postponed analysis of it's content 2020-09-14 11:46:06 +03:00
Dmitriy Novozhilov
535898c8a4 [FIR] Fix processing integer operator calls for not integer types 2020-09-14 10:57:10 +03:00
Dmitriy Novozhilov
def647c094 [FIR] Don't constraints for return expressions of lambda if it has Unit return type 2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
8e0d0d2fd8 Remove redundant safe call to fix FIR compilation 2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
4929417aea Remove redundant type arguments to fix compilation with FIR
#KT-41835
2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
324aaaddad [FIR] Rename createArrayOf to createArrayType 2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
3b941a8f43 [FIR] Complete types of array literals in annotations 2020-09-14 10:57:09 +03:00
Dmitriy Novozhilov
fbe964c074 [FIR] Transform annotations on safe calls 2020-09-14 10:57:08 +03:00
Jinseong Jeon
0bd7de158c FIR: update suspend lambda type during declaration resolution 2020-09-14 10:20:45 +03:00
Jinseong Jeon
680dd64211 FIR2IR: pick return target based on matched IrFunction 2020-09-14 10:09:51 +03:00
Jinseong Jeon
6ebad9589a FIR2IR: set proper IR origin for iterator in ranges 2020-09-14 10:09:45 +03:00
Mikhail Glukhikh
578e707ab9 FIR2IR: set VARIABLE_AS_FUNCTION origin only for invoke receivers 2020-09-14 10:09:32 +03:00
Mikhail Glukhikh
f0a2a62405 [FIR2IR] Minor: coneTypeSafe -> coneType 2020-09-14 09:18:46 +03:00
Jinseong Jeon
89ffce22d8 FIR2IR: set proper IR origin for variable as function 2020-09-14 09:05:08 +03:00
Andrey Uskov
bf3a7e5fea Add more tasks in Gradle build for running GradleIT in parallel 2020-09-13 22:48:12 +03:00
Nikolay Krasko
a7f57646bf Prevent rebuilding by avoid registering doFirst on source tasks (KTI-324)
Do the check for empty directories at the build end instead.

Registering doFirst makes constant recompile when switching from Kotlin to Kotlin
Native composite with the reason:

```
The task was not up-to-date because of the following reasons:
One or more additional actions for task ':kotlin:kotlin-stdlib-common:compileKotlinCommon' have changed.
```

Exact reason why actions are different is not clear (there's a single
action in both builds in comparison), but probably the reason in
different types due to usage of composite build.

 #KTI-324 Fixed
2020-09-13 19:18:01 +03:00
Alexander Udalov
9250d86915 JVM IR: generate field for private companion object in interface as synthetic 2020-09-13 09:13:27 +02:00
Alexander Udalov
fc141a52da IR: minor, make IrClass.companionObject return IrClass 2020-09-13 09:13:26 +02:00
Alexander Udalov
2f86554d5a IR: don't produce fake overrides for static and private declarations
Note that only irrelevantStaticProperty.kt failed before this change.
Having private declarations caused no problems, but it seems incorrect,
so it's fixed now and irrelevantPrivateDeclarations is added just in
case.

 #KT-41848 Fixed
2020-09-12 20:01:34 +02:00
Roman Golyshev
703150e3ad FIR IDE: Refactor LowLevelFirApiFacade.kt 2020-09-12 11:49:36 +00:00
Roman Golyshev
edb277b30a FIR Completion: Enable passing tests 2020-09-12 11:49:36 +00:00
Roman Golyshev
dcc22d3e5d FIR IDE: Fix completion in property setters
Property consists of getter and setter (both optional). The setter
have a single `value` parameter with type

Because of it, we have to make a separate 'frankenstein setter' with
original resolved header, but with the body of the fake one

It seems that getters does not have such issues
2020-09-12 11:49:35 +00:00
Roman Golyshev
5c1520305b FIR IDE: Build symbols from any FirValueParameter 2020-09-12 11:49:35 +00:00
Roman Golyshev
ae8933dbd2 FIR IDE: Correctly handle properties in KtFirCompletionCandidateChecker
- Introduce `EnclosingDeclarationContext` to remove code duplication
2020-09-12 11:49:34 +00:00
Roman Golyshev
6fd871d0ba FIR IDE: Add building completion context for properties 2020-09-12 11:49:33 +00:00
Roman Golyshev
58965d1e71 FIR IDE: Implement RawFirBuilder::buildPropertyWithBody, add tests 2020-09-12 11:49:33 +00:00
Georgy Bronnikov
5f57311015 JVM_IR: remove .toKotlinType() from intrinsics.Equals 2020-09-12 12:59:12 +03:00
Georgy Bronnikov
2c1735c211 JVM_IR: remove descriptor usage from JvmOptimizationLowering 2020-09-12 12:59:12 +03:00
Georgy Bronnikov
a14c9018b1 JVM_IR: remove descriptor usage from SyntheticAccessorLowering 2020-09-12 12:59:12 +03:00
Georgy Bronnikov
3327524e18 JVM_IR: remove descriptor usage from TypeAliasAnnotationMethodsLowering 2020-09-12 12:59:12 +03:00
Georgy Bronnikov
905978a458 JVM_IR: remove descriptor usage from JvmCachedDeclarations 2020-09-12 12:59:12 +03:00
Georgy Bronnikov
92b03e7ede JVM_IR: Remove descriptor usage from IrSourceCompilerForInline 2020-09-12 12:59:03 +03:00
Georgy Bronnikov
0a66dbf2b5 JVM_IR: remove descriptor usage in CompareTo intrinsic 2020-09-12 12:58:29 +03:00
Toshiaki Kameyama
370622087b Redundant nullable return type: false negative with return expression in local function or lambda
#KT-41817 Fixed
2020-09-11 19:09:57 +02:00
Toshiaki Kameyama
de3907e8cc Redundant nullable return type: fix false positive with non-local return
#KT-41800 Fixed
2020-09-11 19:09:57 +02:00
Ilya Gorbunov
349cad7b9a Minor: migrate remaining scanReduceIndexed usages 2020-09-11 19:08:04 +03:00
Alexander Gorshenev
744f290fc4 A proper modality calculation was missing in IR fake override construction algorithm
#KT-41765 Fixed
2020-09-11 18:56:17 +03:00
Louis CAD
2886f48795 Improve spelling in Kotlin Test module's README.md 2020-09-11 18:45:58 +03:00
Louis CAD
64408c19f8 Add missing "The" article in kotlin.test doc 2020-09-11 18:20:37 +03:00
Andrey Uskov
175a8bec9d Make KotlinCoreEnvironment.disposeApplicationEnvironment() public
The method disposeApplicationEnvironment should be used in Gradle
after the configuration phase. This allows not to recreate the compiler
environment after each kts file compilation and improve overall
performance the evaluation and configuration phases.
2020-09-11 15:13:11 +03:00
Victor Petukhov
fca6436170 Fix IDE test after bcd33da6f8 2020-09-11 13:51:15 +03:00
Igor Yakovlev
e08763f3dd [ULC] Add annotations for PsiTypes in UltraLight classes
WIP on KT-41148, KT-41406, KT-41420
2020-09-11 12:49:05 +03:00
Igor Yakovlev
b82d8cd4f4 [ULC] Fixed invalid access to lightclass infrastructure from UL 2020-09-11 12:49:05 +03:00
Igor Yakovlev
8fc94ddb8c [UCL] Minor fixes 2020-09-11 12:49:05 +03:00
Igor Yakovlev
97ac86273a [ULC] Add support of const fields to multifile facade 2020-09-11 12:49:05 +03:00
Igor Yakovlev
309bf49a83 Update lightclass tests renderer
+mute invalid old light classes tests
2020-09-11 12:49:04 +03:00
Igor Yakovlev
c70383cc70 [ULC] Add compiler flag -Xdisable-ultra-light-classes to fallback to light implementation in CLI 2020-09-11 12:49:04 +03:00
Nicolay Mitropolsky
e53db4c771 Uast: fixing WrappedUAnnotation identifiers 2020-09-11 12:49:04 +03:00
Igor Yakovlev
4b8f1bb362 [ULC] Add LanguageVersionSettings to CliLightClassGenerationSupport
+ refactoring
2020-09-11 12:49:04 +03:00
Igor Yakovlev
31b4a021a9 [ULC] Add JvmDeclarationOriginKind.DELEGATION to DeclarationOriginKindForOrigin of delegated methods 2020-09-11 12:49:03 +03:00
Igor Yakovlev
b263e1c924 [ULC] Remove nullability annotation for UL backing fields of private props 2020-09-11 12:49:03 +03:00
Igor Yakovlev
a36d53e086 [ULC] Skip nullability annotation for backing field of lateinit property 2020-09-11 12:49:03 +03:00
Igor Yakovlev
cd32cf7828 [ULC] Add PsiElement overrides for UL elements with source 2020-09-11 12:49:03 +03:00
Igor Yakovlev
131c14626c [ULC] Fix invalid alias search for UL classes 2020-09-11 12:49:03 +03:00
Igor Yakovlev
2c16ae968d [ULC] Add support @receiver annotation site to UL classes 2020-09-11 12:49:02 +03:00
Igor Yakovlev
dbb4337ac4 [ULC] Fix invalid annotation resolve for KtUltraLightParameterForSetterParameter 2020-09-11 12:49:02 +03:00
Igor Yakovlev
db6aa9140d [ULC] Refactor for lightAnnotations classes 2020-09-11 12:49:02 +03:00
Igor Yakovlev
c4cee35cca [ULC] Fixed invalid UL facade annotations
1) Hide annotations for MultiFile class
2) Remove nullability for private fields
2020-09-11 12:49:01 +03:00
Igor Yakovlev
6542ea9ba1 [ULC] Add constant evaluation to light classes service 2020-09-11 12:49:01 +03:00
Igor Yakovlev
55bb8f24e3 [ULC] Move UltraLightSupport to service provided bridge 2020-09-11 12:49:01 +03:00
Igor Yakovlev
7cb2631991 [ULC] Fix light class Coherence test 2020-09-11 12:49:01 +03:00
Igor Yakovlev
7b0eb51f8d [ULC] Add annotation support for UL facades 2020-09-11 12:49:01 +03:00
Igor Yakovlev
a5e304f520 [ULC] Better nullability annotations for light classes 2020-09-11 12:49:00 +03:00
Igor Yakovlev
c3810dc223 [ULC] Fixed UL backing field initializers 2020-09-11 12:49:00 +03:00
Igor Yakovlev
129979b0ff [ULC] Improve UL facades for private properties without accessors 2020-09-11 12:49:00 +03:00
Igor Yakovlev
025e2f2fe9 [ULC] Better support for UL MultifileFacade classes 2020-09-11 12:49:00 +03:00
Igor Yakovlev
bc12fb0d6b [ULC] Enable UL for script classes 2020-09-11 12:49:00 +03:00
Igor Yakovlev
1d248f1a00 [ULC] Fixed invalid fqName for script inner classes 2020-09-11 12:49:00 +03:00
Igor Yakovlev
236e41e024 [ULC] Fixed invalid super type for UL scripts 2020-09-11 12:48:59 +03:00
Igor Yakovlev
6accc8fcf9 [ULC] Fixed invalid constructor parameter list for UL script 2020-09-11 12:48:59 +03:00
Dmitriy Novozhilov
bf91ada06c [NI] Suppress false positive IDEA warnings in NewConstraintSystemImpl 2020-09-11 12:13:34 +03:00
Dmitriy Novozhilov
178cef5631 [FIR] Don't create synchronized lazy for constraint system in candidate 2020-09-11 12:13:34 +03:00
Dmitriy Novozhilov
a528deef0a [FIR] Update testdata due to previous commit and KT-37638
JavaSymbolProvider looks for available class names using KotlinJavaPsiFacade
  which don't return package private java classes which lays in files
  with names that don't match with class names, so we can not build FIR
  for such classes
2020-09-11 12:13:34 +03:00
Dmitriy Novozhilov
1dc3c93efa [FIR] Don't assume types with not found symbol as error types 2020-09-11 12:13:33 +03:00
Dmitriy Novozhilov
7f692be11e [FIR] Properly detect callable reference type according conversions 2020-09-11 12:13:33 +03:00
Mikhail Glukhikh
ec93e5886a [FIR2IR] Fix generation of accessors' extension receiver (f/o case) 2020-09-11 11:43:00 +03:00
Dmitriy Novozhilov
36d2129fd3 Move common deserialization classes from :core:metadata modules 2020-09-11 10:08:37 +03:00
Dmitriy Novozhilov
07a3009d43 Introduce new modules for common parts of deserialization 2020-09-11 10:08:37 +03:00
Dmitriy Novozhilov
2f4bd626fc [FIR] Make constant values in fir serialization internal
This is needed to avoid possible name clash with ConstantValue from FE 1.0
2020-09-11 10:08:36 +03:00
Dmitriy Novozhilov
9e1e525343 Fix circular dependency between :core:compiler:common.jvm and :core:metadata.jvm 2020-09-11 10:08:36 +03:00
Dmitriy Novozhilov
c82d9ea9f4 Remove dependency on :compiler:frontend.java from :compiler:fir:java 2020-09-11 10:08:36 +03:00
Dmitriy Novozhilov
1417fcecb8 Move more common parts from :compiler:descriptors.jvm 2020-09-11 10:08:36 +03:00
Dmitriy Novozhilov
192e07a07b [FIR] Remove dependency on FE 1.0 modules form :compiler:fir:fir-deserialization 2020-09-11 10:08:35 +03:00
Dmitriy Novozhilov
5d4d07066b Move common deserialization components to :core:metadata and :core:metadata.jvm 2020-09-11 10:08:35 +03:00
Dmitriy Novozhilov
cdab00fdc8 [FIR] Remove dependency on :core:deserialization from :compiler:fir:fir-serialization 2020-09-11 10:08:35 +03:00
Dmitriy Novozhilov
9beeb51227 [FIR] Implement fir-specific contract values and fix annotations serialization 2020-09-11 10:08:35 +03:00
Dmitriy Novozhilov
e1ad1aabc4 Move RequireKotlinConstants to :core:compiler.common 2020-09-11 10:08:34 +03:00
Dmitriy Novozhilov
8d2e89a9ea Move ProtoEnumFlags to :core:metadata 2020-09-11 10:08:34 +03:00
Igor Chevdar
e39ce91253 [IR] Fixed fake override builder for lowerings 2020-09-11 09:35:01 +05:00
Andrey Uskov
7f4bda0d52 Enable FUS internal mode on IDE launching 2020-09-10 21:07:14 +03:00
Alexander Udalov
ae9c1af883 Do not use erroneous unsigned/signed comparison in UnsignedArraysTest
The error SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED is suppressed in this
file, and JVM IR is not able to generate comparisons of UInt and Long
(KT-41780).
2020-09-10 19:27:09 +02:00
Victor Petukhov
bcd33da6f8 Don't check an argument type during passing it to vararg in the named form to avoid false positives if the argument type is type variable yet
^KT-41144 Fixed
2020-09-10 19:38:26 +03:00
Ilya Goncharov
2c4c8cdf01 [Wizard] Update versions in wizard 2020-09-10 19:25:26 +03:00
Vladimir Dolzhenko
38854ce40b Disable profilerConfig for AHeavyInspectionsPerformanceTest 2020-09-10 16:23:51 +02:00
Vyacheslav Gerasimov
e3b07120bb Build: Don't retry tests in local builds 2020-09-10 16:50:43 +03:00
Kirill Shmakov
29f3811bab Update gradle tooling
In response to a766369e72
2020-09-10 16:07:30 +03:00
Kirill Shmakov
60b812f452 Reorder arguments in KotlinNativeTest for better debug
Previously it was broken on Linux and worked poorly on macOS
2020-09-10 16:07:28 +03:00
1anisim
b202cf0f55 Apply suggestions from code review
Co-authored-by: Alexander Udalov <udalov@users.noreply.github.com>
2020-09-10 15:30:33 +03:00
1anisim
33d3e1f13e Update ReadMe.md 2020-09-10 14:13:42 +03:00
Jinseong Jeon
ef58e0cd71 FIR2IR: refactor adapter generation 2020-09-10 11:31:24 +03:00
Jinseong Jeon
5fdd06676f FIR: discriminate candidates with suspend conversion 2020-09-10 11:31:24 +03:00
Jinseong Jeon
6de8ba40c1 FIR: initial support of suspend conversion on arguments 2020-09-10 11:31:24 +03:00
Jinseong Jeon
49679f3145 FIR: map arguments for overloading indexed access operator 2020-09-10 11:25:36 +03:00
Vladimir Dolzhenko
a73856be66 Add warn message to ReplaceWithIgnoreCaseEquals inspection.
Relates to ^KT-40016
2020-09-10 08:20:54 +00:00
Vladimir Dolzhenko
5036673187 Improve package caching in KotlinJavaPsiFacade
^KT-33394 Fixed
2020-09-10 07:38:46 +00:00
Andrey Uskov
05d3e48564 Implemented collecting statistics about JS target mode 2020-09-10 00:39:27 +03:00
Ilya Goncharov
4716228500 Add js generate executable default collecting statistics
#KT-40462 Fixed
2020-09-10 00:39:24 +03:00
Ilya Goncharov
405e271b68 Add js generate externals collecting statistics
#KT-39995 Fixed
2020-09-10 00:39:20 +03:00
Vladimir Dolzhenko
6f03e42ef7 Revert back Inspection: convert initialized val to non-null type
Relates to ^KT-35757
Relates to ^KT-19321
2020-09-09 23:38:21 +02:00
Vladimir Ilmov
12ebd429bc Revert "Light classes support for declarations in multipart classes."
This reverts commit 3ea51a982c.
2020-09-09 19:46:03 +02:00
Vladimir Dolzhenko
d324ae6cda Fix AS 4.0 compilation 2020-09-09 17:59:49 +02:00
Ilmir Usmanov
0492a52a6a Minor. Regenerate tests 2020-09-09 17:43:43 +02:00
Ilmir Usmanov
52f9569d33 Generate CHECKCAST Object inside the markers
otherwise, the unboxing interferes with bytecode analysis.
2020-09-09 17:43:42 +02:00
Ilmir Usmanov
e8a451072e Minor. Add tests with same JvmType in covariant override 2020-09-09 17:43:41 +02:00
Ilmir Usmanov
7cbd067460 Add tests with resume path 2020-09-09 17:43:39 +02:00
Ilmir Usmanov
1c97eafea8 Check for COROUTINE_SUSPENDED inside callable reference
#KT-41429 Fixed
2020-09-09 17:43:37 +02:00
Ilmir Usmanov
4303e8126f Do not generate suspend markers inside callable reference
#KT-41429
 #KT-25519 Fixed
2020-09-09 17:43:36 +02:00
Ilmir Usmanov
ccc5b7afe0 Box inline class in resume path of suspend call
#KT-41429
2020-09-09 17:43:35 +02:00
Ilmir Usmanov
023cdd7cd4 Support not boxing inline class of reference class
even if the class is other than Any.
 #KT-41429 In progress
2020-09-09 17:43:34 +02:00
Toshiaki Kameyama
5c011bc954 Don't report when property is multi-line and action is MOVE 2020-09-09 22:31:56 +07:00
Toshiaki Kameyama
4569b85a16 MoveVariableDeclarationIntoWhenInspection: report it if initializer is single line even if property is multi line
#KT-39467 Fixed
2020-09-09 22:31:56 +07:00
Vladimir Ilmov
75d4c7e91c Find stdlib usages test case
relates to #KT-39196
2020-09-09 17:30:04 +02:00
Vladimir Ilmov
8b239d89b6 SourceNavigationHelper multifile classes support
Use .class files as BINARY instead of .metadata.
 relates to #KT-39196
2020-09-09 17:30:04 +02:00
Vyacheslav Gerasimov
3764eeba25 Build: Setup gradle.test-retry plugin for all test tasks in the project 2020-09-09 18:20:01 +03:00
Alexander Udalov
3d7619421f JVM IR: fix exception on star projection in type parameter upper bound
#KT-41761 Fixed
2020-09-09 17:07:52 +02:00
Victor Petukhov
685d16ec68 NI: don't do substitution for unsupported callable descriptors to use as callable references
^KT-41729 Fixed
2020-09-09 18:00:41 +03:00
Ilya Goncharov
668098f3a8 [Gradle, JS] Add simple files without kotlinx.html
^KT-41696 fixed
2020-09-09 17:24:08 +03:00
Vladimir Ilmov
3ea51a982c Light classes support for declarations in multipart classes.
relates to #KT-39196
2020-09-09 15:01:55 +02:00
Vladimir Ilmov
a5d91339b5 (lightClass) multifile classes facade in libraries added
relates to #KT-39196
2020-09-09 15:01:54 +02:00
Vladimir Dolzhenko
ac22232b8d Register disposable startup items in PluginStartupService 2020-09-09 12:51:19 +00:00
Vladimir Dolzhenko
e5985ad98b Rename PluginStartupService to PluginStartupApplicationService 2020-09-09 12:51:18 +00:00
Victor Petukhov
c1ebd33833 Capture flexible intersection types properly: take into account both bounds and use the same captured arguments for them
^KT-41693 Fixed
2020-09-09 14:52:12 +03:00
Victor Petukhov
140edb2215 Consider intersection with ILT subtype of ILT 2020-09-09 13:55:07 +03:00
Roman Golyshev
7bd9c52732 FIR Completion: Fix completion in function calls (foo.bar<caret>())
In such expressions, `KtCallExpression` wraps `KtSimpleNameExpression`,
so `getQualifiedExpressionForSelector()` returns `null`

Also, enable tests that are fixed by this
2020-09-09 13:14:08 +03:00
Roman Golyshev
2d4d48b401 FIR IDE: Invert the order of the scopes for completion
This way local declarations will be fetched first
2020-09-09 13:14:08 +03:00
Dmitriy Novozhilov
f748d8cf70 [FIR] Extract ResolutionContext to separate file 2020-09-09 12:38:36 +03:00
Dmitriy Novozhilov
1a84ec9677 [FIR] Mark all session components respectively to they have mutable state or not
Also add documentation for all fir annotations
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
8686e3779e [FIR] Make all session components abstract classes 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
caf325934c [FIR] Unmake FirSamResolver as session component
It can not be stored in session because it depends on scope session
  and have mutable state
2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
29addd2a2b [FIR] Make InferenceComponents session component 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
41b395b0aa [FIR] Extract mutable state from InferenceComponents 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
d70858edfa [FIR] Get rid of inference components in CheckerSink 2020-09-09 12:38:35 +03:00
Dmitriy Novozhilov
912676d868 [FIR] Introduce ResolutionContext and get rid of components in Candidate 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
c53ffca34f [FIR] Extract BodyResolveContext from FirAbstractBodyResolveTransformer 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
edb1273355 [FIR] Report ResolutionDiagnostics instead of applicability in resolve 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
a148db9d81 [FIR] Get rid of CandidateApplicability.SYNTHETIC_RESOLVED 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
19707667fd [FIR] Cleanup detection that applicability is successful 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
68f3d84e22 [FIR] Use CandidateApplicability from FE 1.0 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
cd557ad178 Change order of enum entries in CandidateApplicability 2020-09-09 12:38:34 +03:00
Dmitriy Novozhilov
d1568c1ce6 Rename ResolutionCandidateApplicability to CandidateApplicability 2020-09-09 12:38:33 +03:00
Mikhail Glukhikh
db2e3f219f [FIR] Keep bare type for type alias case 2020-09-09 12:16:09 +03:00
Alexander Udalov
3a5d0ab427 JVM IR: fix HashCode intrinsic for generics substituted with primitives
The problem here was that although the IR type of the expression was
primitive, the type of the actual expression in the bytecode generated
after type erasure was `Ljava/lang/Object;`, and we were trying to call
a non-existing method `Object.hashCode(Object)`.

 #KT-41669 Fixed
2020-09-08 23:37:00 +02:00
Alexander Udalov
c46c80822c JVM IR: fix enclosing constructor for lambdas in inner classes
Before this change, we stored the enclosing constructor in a map in
JvmBackendContext before moving lambdas and local classes out of
initializer blocks. However, in case the lambda was declared in an inner
class, we stored a reference to the unlowered constructor of the inner
class, whose JVM signature is "()V" instead of the correct "(LOuter;)V".
Java reflection then threw exception if we tried to call
`getEnclosingConstructor()` on such class at runtime. Proguard finished
with errors for the same reason.

It turns out that we can just store the fact that the class has been
moved, and load the matching constructor in codegen, where everything is
already lowered and guaranteed to match with the signatures of the
actual generated declarations.

 #KT-41668 Fixed
2020-09-08 23:37:00 +02:00
Alexander Udalov
228e329d1f JVM IR: generate enclosing constructor only for lambdas in initializers
There was a typo in JvmLocalClassPopupLowering which allowed the
EnclosingMethod for lambdas and anonymous classes in initializers to
become any function in a class, in case when there was no primary
constructor in that class. E.g. in the added test, `getIrrelevantField`
was the EnclosingMethod of the lambda class before this change.
2020-09-08 23:37:00 +02:00
Ilya Kirillov
2ab68b3245 Wizard: move boolean setting description to the bottom 2020-09-09 00:20:58 +03:00
Ilya Kirillov
ce00366c7f Wizard: fix when first selected template cannot be applied 2020-09-09 00:20:58 +03:00
Ilya Kirillov
3a6011fae9 Wizard: always generate android MPP tests
#KT-40940 fixed
2020-09-09 00:20:57 +03:00
Ilya Kirillov
553c525701 Wizard: fix Gradle buildscript formatting
#KT-37965 fixed
2020-09-09 00:20:57 +03:00
Ilya Kirillov
0f799d593d Wizard: specify test platform to use on JVM
#KT-37965 fixed
2020-09-09 00:20:57 +03:00
Ilya Kirillov
7002e86d6b Wizard: fix path & artifactId updating on name update
#KT-41695 fixed
2020-09-09 00:20:56 +03:00
Alexander Udalov
929b5f727d Build: add :compiler:fir:entrypoint to compilerModules
This fixes FIR usage from the CLI compiler.
2020-09-08 20:26:28 +02:00
Alexander Udalov
7fb7dc0210 Fix deprecation warnings related to Project extensions 2020-09-08 20:26:20 +02:00
Alexander Udalov
196893bc4d Build: fix more warnings about deprecated/Alpha MPP plugins
Using the new flags added in KT-41340 and
413d02621b.
2020-09-08 20:26:20 +02:00
Mads Ager
06680452dc [JVM_IR] Always look for default lambdas in the inliner.
This allows compiler plugins such as Compose to do custom
default argument handling in methods that do not have origin
`FUNCTION_FOR_DEFAULT_PARAMETER`.

The code still bails out early is there is not defaults
mask, so there should be no compile-time penalty.
2020-09-08 19:07:31 +02:00
anastasiia.spaseeva
a12e22bba4 [Spec tests] Fix dependencies for spec tests generator 2020-09-08 16:14:47 +03:00
1anisim
cf9f120d55 Update ReadMe.md
Added a section about Multiplatform Capabilities, highlighted KMM
2020-09-08 14:54:47 +03:00
Ilya Goncharov
9d3426486b [Gradle, JS] Support explicitApi in js plugin
^KT-41328 fixed
2020-09-08 12:54:11 +03:00
Dmitriy Novozhilov
28a83b04cd [FIR] Minor. Fix code style 2020-09-08 12:51:13 +03:00
Dmitriy Novozhilov
67604dcb66 [FIR] Add generator for checkers aliases and sets of checkers 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov
4de57fcac2 [FIR] Initialize module for checkers generator 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov
6656669551 [FIR] Fix typo 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov
3b9e86ccbf [FIR] Remove empty file 2020-09-08 12:51:12 +03:00
Dmitriy Novozhilov
a8a5ed3cd3 [FIR] Get rid of runCheck in checkers components 2020-09-08 12:51:11 +03:00
Dmitriy Novozhilov
71a855112e [FIR] Get rid of ParallelDiagnosticsCollector 2020-09-08 12:51:11 +03:00
Ilya Goncharov
20a1ea0413 [Wizard, JS] Change js compiler default
^KT-41656 fixed
2020-09-08 12:48:52 +03:00
Dmitry Petrov
6746bd81d5 PSI2IR tests for KT-41735 2020-09-08 12:34:19 +03:00
Vladimir Ilmov
aa04c0b5df Parent call already on KotlinBuiltInDecompiler.kt:79 2020-09-08 10:59:17 +02:00
Steven Schäfer
44ffb1fb3e Psi2Ir: Fix SAM conversion with new inference 2020-09-08 11:14:14 +03:00
pyos
75891e860b FIR2IR: split getIrPropertyOrFieldSymbol, handle locals there 2020-09-08 08:40:13 +03:00
pyos
f198a19ab0 FIR2IR: add local delegated property generation 2020-09-08 08:40:07 +03:00
Steven Schäfer
4792be2522 JVM IR: Optimize static property references (KT-36975) 2020-09-07 21:01:29 +02:00
Alexander Udalov
669fda6b77 Do not add duplicate $completion when compiling JVM against JVM_IR
This change fixes JvmOldAgainstIrBoxInlineTestGenerated.Suspend and
JvmIrAgainstOldBoxInlineTestGenerated.Suspend tests.
2020-09-07 19:41:38 +02:00
Alexander Udalov
ae448ececb Minor, add compileKotlinAgainstKotlin test case for KT-41374 2020-09-07 19:41:37 +02:00
Alexander Udalov
9e357354fb Add JVM/JVM_IR mixed compilation tests for compileKotlinAgainstKotlin/boxInline 2020-09-07 19:41:37 +02:00
Alexander Udalov
e324733b01 Tests: accept TargetBackend in KotlinBaseTest.createConfiguration 2020-09-07 19:41:37 +02:00
Alexander Udalov
0dea6b94c6 JVM IR: unmute boxInline tests on enclosing method/class
In box tests, only check that Java reflection does not crash on the
EnclosingMethod attribute generated in these classes. If it doesn't
crash, most likely it returns the value that can be read from the class
file by ASM, which is what the newly added bytecode listing tests are
checking now.
2020-09-07 19:41:37 +02:00
Ilya Goncharov
985088a3f1 [Gradle, JS] Add test on dukat with both mode 2020-09-07 19:29:17 +03:00
Ilya Goncharov
b694e3b009 [Gradle, JS] Dukat with both create externals only once 2020-09-07 19:29:17 +03:00
Ilya Goncharov
210cd982f0 [Gradle, JS] Use webpack config's required dependencies in karma
^KT-41663 fixed
^KT-41662 fixed
2020-09-07 18:56:47 +03:00
Pavel Kirpichenkov
b5aca450b1 Make cancellation checks when building resolution anchor caches
^KT-39734
2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
54811613f4 Minor: drop unnecessary wrapper for utility function
^KT-39734
2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
1ff064d98d Make Kotlin OOCBM updater for modules internal again
Replace direct API access with dedicated service.
2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
9d6bdc6fc4 Support modification tracking for source-dependent LibraryInfo
#KT-39734
2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
6abd708d42 Preserve order entry to module info mapping in IdeaModelInfosCache 2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
24d8aee2bb Prioritize resolution anchors during resolution
When required dependency is present both in source dependencies and in
library dependencies, the former one should be selected.

#KT-24309
2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
f8ee976720 Use union of all available descriptors in composite importing scope 2020-09-07 18:52:10 +03:00
Pavel Kirpichenkov
5892bdf3f4 Extend import resolution for library-to-source analysis
Use composite importing scope for references when resolution anchors are enabled.
Composite scope provides additional descriptors from scope of resolution anchor module.
Overriding old importing scope with a new one is not possible as it breaks library
dependencies on other libraries, which are inaccessible in anchor scope (scope for sources).

KT-24309 In Progress
2020-09-07 18:52:10 +03:00
Roman Golyshev
8c876e4621 FIR IDE: Get rid of originalPosition in KtFirCompletionCandidateChecker 2020-09-07 18:46:38 +03:00
Roman Golyshev
828fc2520c FIR IDE: Refactor KtFirCompletionCandidateChecker
- Move searching for the `originalEnclosingFunction`
to the `getImplicitReceivers`
2020-09-07 18:18:02 +03:00
Pavel Kirpichenkov
33ac487a42 [FIR-IDE] Fix leaking KtAnalysisSession 2020-09-07 17:40:18 +03:00
Roman Golyshev
909d418dd1 Improve diagnostics in KtElementImplStub::getContainingKtFile
- If containing file is not a `PsiFileImpl`, `getNode()` will
throw a CCE (which will prevent collecting the diagnostics)
- Relates to #EA-209630
2020-09-07 14:36:09 +00:00
Dmitry Petrov
5b53663eb8 PSI2IR KT-41181 don't generate deep trees in hashCode 2020-09-07 16:09:42 +03:00
Dmitry Petrov
ade1a346e1 JVM: add test for KT-40123 2020-09-07 16:09:42 +03:00
Vladimir Ilmov
45c67a90c2 (CoroutineDebugger) Disposing under IW lock.
#KT-41505 fixed
2020-09-07 14:50:07 +02:00
Sebastian Kaspari
01143f24a4 Add KotlinClassConstructorInfoHandler for showing parameter info of parameterized super class constructor.
^KT-41617 Fixed
2020-09-07 13:23:08 +02:00
Pavel Kirpichenkov
d674f519fd [FIR-IDE] Fix completion check for generic extensions
Generic candidate extensions are completed in partial mode
when there is not enough information for type parameter in return position.
Partial completion mode in single candidate resolver leads to unconditionally failing candidate.
Providing noExpectedType instead of null guarantees full completion.
2020-09-07 13:38:11 +03:00
Vladimir Ilmov
60dfa8cc84 Ignore ProcessCancelledException in VirtualFileKotlinClass 2020-09-07 12:17:06 +02:00
Vladimir Dolzhenko
3de32e13ea Clean up declarationAccessorNames debug check in UnusedSymbolInspection
declarationAccessorNames(KtNamedDeclaration) could be more than declaration.getAccessorNames() as it relies on LC, some of them could be not accessible

^EA-237873 Fixed
2020-09-07 09:36:28 +00:00
Vladimir Dolzhenko
127257aa27 Provide setter-method for LC for private property setter
^KT-41694 Fixed
2020-09-07 09:36:28 +00:00
Vladimir Dolzhenko
b5b319803b Add more diagnostics to tackle exception in KotlinFunctionParameterInfoHandler
Relates to #EA-221900
2020-09-07 09:36:27 +00:00
Vladimir Dolzhenko
87e70cf690 Handle project disposed in ScriptDefinitionsManager
^EA-237136 Fixed
2020-09-07 09:36:26 +00:00
Vladimir Dolzhenko
4e3b1f141e Use runReadActionInSmartMode instead of runReadAction in ConfigureKotlinInProjectUtils
runReadActionInSmartMode has no effect if it is already run under runReadAction - therefore it could lead to IndexNotReadyException

^EA-220414 Fixed
^EA-210940 Fixed
^KT-30929 Fixed
2020-09-07 09:36:26 +00:00
Vladimir Dolzhenko
02be470e91 Check if vFile is still valid in ScriptClassRootsUpdater#updateHighlighting
^EA-218774 Fixed
2020-09-07 09:36:25 +00:00
Vladimir Dolzhenko
ba027a785c Fix NPE in GradleScriptInfo
^EA-237746 Fixed
2020-09-07 09:36:24 +00:00
Vladimir Dolzhenko
698f51079f Perform paste reference resolve in smart mode
^EA-226712 Fixed
2020-09-07 09:36:24 +00:00
Dmitry Petrov
b00ce872ea JVM: record JVM signature for equals/hashCode/toString in inline classes 2020-09-07 12:25:50 +03:00
Lilia
38975e4e7c Add changelog for 1.4.10 2020-09-06 19:10:42 +07:00
cketti
7755d9fe24 Mark used parameters as disabled in parameter info popup
When using named arguments the IDE might be unable to map the current
argument to a parameter. In that case mark already used parameters as
disabled. That way developers can easily see which parameters have not
been used yet.

^KTIJ-128 Fixed
2020-09-05 23:17:46 +02:00
Yaroslav Chernyshev
81339d54eb Added :core:compiler.common.jvm and :compiler:resolution.common.jvm
dependencies to pill importer
2020-09-05 10:56:55 +03:00
Toshiaki Kameyama
3f7aab6fae Redundant 'asSequence' call: don't report when reciever type is Map
#KT-41338 Fixed
2020-09-04 22:10:34 +02:00
cketti
78493395c3 Don't mark signature as inapplicable when argument is empty/incomplete
This will improve the usability when using named arguments where
incomplete arguments can't be mapped to a parameter simply by position.

^KT-24172 Fixed
2020-09-04 13:11:24 +02:00
Toshiaki Kameyama
343010a833 "Unused equals expression" inspection: highlight whole expression with yellow background
^KT-41615 Fixed
2020-09-04 12:55:55 +02:00
Dmitriy Novozhilov
b81ec2c8f0 Fix compilation errors in bunches 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov
a8c68d9e6f Remove dependency on :compiler:frontend.java from :compiler:fir:jvm 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov
6906e0d82d Move common jvm classes from :core:descriptors.jvm to :core:compiler.common.jvm 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov
9806a85cc1 Move Java model classes to :core:compiler.common.jvm 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov
b81c0e91d5 Replace DescriptorVisibility with Visibility in Java model classes 2020-09-04 11:42:51 +03:00
Dmitriy Novozhilov
696f089b3e Make DescriptorVisibility delegate to Visibility 2020-09-04 11:42:50 +03:00
Dmitriy Novozhilov
a05d6da43b Move descriptor-independent Visibilities to common modules 2020-09-04 11:42:50 +03:00
Dmitriy Novozhilov
d1fd1da56f Rename Visibility to DescriptorVisibility 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov
2bcd8ee07f Get rid of Visibility.effectiveVisibility member 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov
7d9b7df3b4 Cleanup code in EffectiveVisibility.kt and extract descriptors related part to separate file 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov
6346b1b2ab Use type markers instead of class descriptors in effective visibility 2020-09-04 11:07:42 +03:00
Dmitriy Novozhilov
64ec3fc42b Move BuiltinSpecialProperties and JvmAbi to :core:compiler.common.jvm 2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov
10fd164b77 Extract FE 1.0 dependent part from JavaToKotlinClassMap
Also move JavaToKotlinClassMap to :core:compiler.common.jvm
2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov
136435bcc2 Move JvmPrimitiveType to :core:compiler.common 2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov
4d5f28d5c0 Move FunctionInvokeDescriptor.BIG_ARITY to :core:compiler.common 2020-09-04 11:07:41 +03:00
Dmitriy Novozhilov
bf4bf30b4a Move CompanionObjectMapping to :core:compiler.common 2020-09-04 11:07:40 +03:00
Dmitriy Novozhilov
0e04af463d Move JvmTypeSpecificityComparator to :compiler:resolution.common.jvm 2020-09-04 11:07:40 +03:00
Dmitriy Novozhilov
564d382b9d Introduce new modules for common jvm related parts of compiler 2020-09-04 11:07:40 +03:00
Dmitry Petrov
dd016b759e JVM_IR: write raw types as raw in JVM generic signatures 2020-09-04 10:21:49 +03:00
Dmitry Petrov
475522f938 Represent raw types in IR using a special type annotation 2020-09-04 10:21:48 +03:00
Dmitry Petrov
714ab7c37f Handle java raw types in IR
Raw type Q is represented as a flexible type
  Q<B1, ... Bn> .. Q<*, ... *>
where Bi is a representative upper bound of the corresponding ith type
parameter of Q.
When mapping generic signature, JVM takes type arguments of lower bound
(which is 'Q<B1, ..., Bn>').

There is still some difference in how JVM and JVM_IR handle raw type in
signature. It requires additional investigation.
2020-09-04 10:21:48 +03:00
Toshiaki Kameyama
8420c0b7c7 Add "Redundant nullable return type" inspection
^KT-19321 Fixed
2020-09-04 09:07:22 +02:00
Toshiaki Kameyama
d703284d01 Naming convention inspection: don't report for factory functions
#KT-20438 Fixed
2020-09-03 22:25:06 +02:00
Vladimir Dolzhenko
4f4db68a61 I18N fixes after merging convert initialized val to non-null type inspection
Relates to ^KT-35757
2020-09-03 22:01:11 +02:00
Vladimir Dolzhenko
eb3bde1538 Amend test data after adding Convert assignment to assignment expression intention
Relates to #KT-22420
2020-09-03 21:38:46 +02:00
Dmitriy Dolovov
8a7f33f044 [Commonizer] Fix internal error when TAs have different expanded classes
^KT-41643
2020-09-04 01:19:41 +07:00
Vladimir Dolzhenko
d4ef85f6c2 Amend test data after adding Convert assignment to assignment expression intention
Relates to #KT-22420
2020-09-03 18:04:55 +02:00
Mark Punzalan
16ab11289c [JS_IR] Enable RangeContainsLowering optimizations. 2020-09-03 18:42:35 +03:00
Ilya Goncharov
88755a8d20 [Gradle, JS] Use npm project dir as executable
^KT-40812 fixed
2020-09-03 18:31:56 +03:00
Toshiaki Kameyama
6db0785615 Wrap with let: apply to unsafe qualified expression
#KT-18125 Fixed
2020-09-03 17:04:06 +02:00
kvirolainen
18fbf5729d Inspection: convert initialized val to non-null type
^KT-35757 Fixed
2020-09-03 16:30:28 +02:00
Pavel Kirpichenkov
8b28e54584 [FIR-IDE] Update tests 2020-09-03 16:44:57 +03:00
Pavel Kirpichenkov
177fcefa68 [FIR-IDE] Minor: refactor completion contributor 2020-09-03 16:44:41 +03:00
Enteerman
c3aeaa9052 Inspection: Simplify Nested forEach/onEach in also/apply to onEach
^KT-40283 Fixed
2020-09-03 15:29:32 +02:00
Victor Petukhov
85d99612a2 Don't create inconsistent types (with contradictive use site and declaration site variances) for star projections with corresponding contravariant type parameters during substitution
^KT-41388 Fixed
2020-09-03 16:24:28 +03:00
Dereck Bridie
94970e2d1e Intention to replace a = b with b.also { a = it }
^KT-22420 Fixed
2020-09-03 15:11:36 +02:00
Vladimir Dolzhenko
e387d56d93 Drop redundant synchronized from LibraryEffectiveKindProviderImpl
effectiveKindMap is SoftFactoryMap that wraps CHM

^KT-41634 Fixed
2020-09-03 12:25:38 +00:00
Enterman
d09b20f11d Inspection to replace !string.isBlank() with string.isNotBlank()
#KT-40769 Fixed
2020-09-03 14:20:35 +02:00
vldf
f9a2d01d57 [FIR] Add UselessCallOnNotNullChecker 2020-09-03 14:28:57 +03:00
Mikhail Glukhikh
548adc29d0 [FIR] Enter loops in resolve using independent context 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh
a7da0d5080 [FIR] Approximate exotic return types for public declarations 2020-09-03 14:24:31 +03:00
Jinseong Jeon
bf918e6184 FIR: hide local types if needed 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh
9e38e6d051 [FIR2IR] Intercept exceptions in convertToIrCall to provide more info 2020-09-03 14:24:31 +03:00
Mikhail Glukhikh
23e83e8933 FirClassSubstitutionScope: don't recreate type parameters for unbound f/o 2020-09-03 14:24:30 +03:00
Jinseong Jeon
e8157a5488 FIR: introduce & use various comparators to sort members while de/serialization
#KT-41018 fixed
2020-09-03 13:55:52 +03:00
cketti
91c021c699 Add support for mixed named arguments to parameter info popup
Don't display parameter info in square brackets if the caller doesn't
have to use a named argument. This makes the parameter info popup
reflect the new capability introduced with
MixedNamedArgumentsInTheirOwnPosition.

^KT-41645 Fixed
2020-09-03 12:30:27 +02:00
n-p-s
af6e744b65 Allow generate toString(), equals(), and hashCode() to include non-default accessors
^KT-15262 Fixed
2020-09-03 12:12:33 +02:00
KotlinIsland
3bf18343f5 Build: Upgrade gradle to 6.6.1
[We recommend that you use Gradle 6.6.1 over the initial release of Gradle 6.6](https://github.com/gradle/gradle/releases/tag/v6.6.1)
2020-09-03 10:50:22 +02:00
Roman Artemev
685b74769d [JVM IR] Fix lineNumber passing into CoroutineTransformer.
- Get it from `IrFile` & `IrElement.startOffset` instead of descriptor
 - Unmute stepping tests
2020-09-03 11:37:24 +03:00
Alexander Udalov
5aca8ebda8 Minor, add test case on metadata of lambdas in constructors
KT-41465
2020-09-02 20:04:05 +02:00
pyos
6b65a2ea7d JVM_IR: move classes out of lambdas inlined into initializers
Fixes KT-41465
2020-09-02 20:03:38 +02:00
Florian Kistner
9775a2148a 203: Fix compilation 2020-09-02 18:48:57 +02:00
Pavel Kirpichenkov
9d12df28c1 [FIR-IDE] Add idea-fir test runtime dep for fir plugin only
Leads to duplicated bundled resources annotation templates otherwise.
2020-09-02 19:15:07 +03:00
Pavel Kirpichenkov
26982d1b48 [FIR-IDE] Use delegating KtScope for type param scope 2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
0d3f1af6e4 Fix imports after rebase 2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
5ddf62b30f [FIR-IDE] Use thread-local cache in completion component 2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
f229ae413d [FIR-IDE] Ignore FirMemberTypeParameterScope in KtScopes 2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
dc538d420e [FIR-IDE] Changes after review
Move usage of SingleCandidateResolver into dedicated component from KtFirAnalysisSession.
Add validity assertion, use concurrent map for context cache, provide original PSI when building context.
Update names, make other minor changes.
2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
ec072798b1 [FIR-IDE] Hack for checking single candidate resolver in tests 2020-09-02 19:15:06 +03:00
Pavel Kirpichenkov
2c816d8911 [FIR-IDE] Introduce resolver for a single candidate
The purpose of this resolver is to reuse parts of tower resolver in IDE tasks.
For now it can run resolution stages to check suitability of extension receiver.
2020-09-02 19:15:06 +03:00
Roman Artemev
c6a338bcdc Mute broken stepping JVM IR tests
They are broken because of c7b57c0fb3.
Current debug info generator in IR uses information from descriptors so
removing that break tests.
2020-09-02 17:52:27 +03:00
Alexander Udalov
b8d16f3d46 Add EnclosingMethod information to bytecode listing tests 2020-09-02 16:46:05 +02:00
Alexander Udalov
d4ecde5cb0 Minor, don't use token COROUTINES_PACKAGE in bytecode listing tests
Most of the tests that are run both for 1.2 and 1.3 coroutines have
different expectation .txt files anyway.
2020-09-02 16:46:05 +02:00
Alexander Udalov
24aee1cce3 JVM IR: unmute tests on anonymous objects in inline lambdas
All tests on anonymous objects should use the NO_CHECK_LAMBDA_INLINING
directive, since the test framework can't tell an anonymous object from
a lambda and checking that anonymous objects are "inlined" makes no
sense.
2020-09-02 16:46:04 +02:00
Alexander Udalov
e7937db8fa Add link to the online docs to kotlinc's help
#KT-35111 Fixed
2020-09-02 16:45:56 +02:00
Alexander Udalov
6b05e1d179 Add warning to 'kotlinc.bat help' that delimiters need to be escaped
Related to KT-41303, KT-41309.
2020-09-02 16:45:40 +02:00
Roman Artemev
2612609664 [JS] Add test for KT-39378 2020-09-02 14:42:17 +03:00
Roman Golyshev
3d5ec8aa10 FIR Completion: Add simple classifiers completion
- This also fixes a few test
2020-09-02 14:32:53 +03:00
Roman Golyshev
64645c5049 FIR Completion: Refactor KotlinAvailableScopesCompletionProvider
- Move different types of completion to separate functions
2020-09-02 14:32:53 +03:00
Roman Golyshev
0375a19e78 FIR Completion: Refactor KotlinAvailableScopesCompletionProvider 2020-09-02 14:32:53 +03:00
Roman Golyshev
1ab246f71e FIR Completion: Drop originalPosition parameter from getScopeContextForPosition
- It is easier to retrieve the original enclosing function by the fake
enclosing function than trying to correct the `originalPosition` in
different situations
2020-09-02 14:32:52 +03:00
Roman Golyshev
ab5059e08e FIR Completion: Rename FIR completion classes to be more uniform 2020-09-02 14:32:52 +03:00
Leonid Startsev
c881347110 Use correct return type for constructor call when creating EnumDescriptor
Previous one was converted using obsolete API, which caused unbound symbols to appear.

#KT-41321 Fixed
2020-09-02 13:22:23 +03:00
Leonid Startsev
8b0bb430e7 Fix multiple serialization plugin problems
Do not use fallback serializer if it is the same (fixes
https://github.com/Kotlin/kotlinx.serialization/issues/957).

Use correct number of serializable KClasses when creating sealed class
serializer (fixes https://github.com/Kotlin/kotlinx.serialization/issues/925).
2020-09-02 13:22:23 +03:00
Ilya Kirillov
106d8e74d4 FIR IDE: unmute passing completion tests 2020-09-02 11:16:20 +03:00
Ilya Kirillov
775dc7b135 FIR IDE: add type parameters support to completion 2020-09-02 11:16:20 +03:00
Ilya Kirillov
6d18bb6ba2 FIR IDE: add type parameters support to scopes 2020-09-02 11:16:19 +03:00
Ilya Kirillov
c0e9f05921 FIR: make FirTypeParameterScope to be name aware 2020-09-02 11:16:18 +03:00
Ilya Kirillov
7a1b1efef3 FIR IDE: register missing Java specific components for libraries session 2020-09-02 11:16:18 +03:00
Ilya Kirillov
162a2ac7b0 FIR IDE: fix lazy resolve for non local declaration without containing class 2020-09-02 11:16:17 +03:00
Ilya Kirillov
87898021a1 FIR IDE: introduce multi module lazy resolve tests 2020-09-02 11:16:17 +03:00
Ilya Kirillov
8714ad575f FIR IDE: move FIR IDE completion tests to idea-fir module 2020-09-02 11:16:16 +03:00
Ilya Kirillov
7cb3f62f51 FIR IDE: remove IGNORE_FIR from passing resolve tests 2020-09-02 11:16:16 +03:00
Ilya Kirillov
31f2c4a857 FIR: add fake source element to implicit function return statement 2020-09-02 11:16:16 +03:00
Ilya Kirillov
1ccf8bfb67 FIR IDE: fix completion in function with expression body 2020-09-02 11:16:15 +03:00
Mikhail Glukhikh
7c0467944d FullPipelineModularizedTest: fix compilation 2020-09-01 21:58:26 +03:00
Mikhail Glukhikh
0324c0d02f FullPipelineModularizedTest: code cleanup 2020-09-01 21:51:49 +03:00
Ilya Goncharov
9f27bc62c0 [Gradle, JS] Args should concat after input file
^KT-41286 fixed
2020-09-01 19:15:13 +03:00
Roman Artemev
fdbc657656 [IR] Fix isFileClass checker 2020-09-01 18:53:17 +03:00
Ivan Gavrilovic
91b99da7a0 KT-41313: Only load .jar files when locating annotation processors
Previously, we'd only check if file exists and try to load it. However,
some compile classpaths may contain .tar.gz files.

Test: ProcessorLoaderTest
2020-09-02 00:48:25 +09:00
Ilya Goncharov
b9bc11d5e0 [Gradle, JS] Consider custom launcher's base
^KT-41475 fixed
2020-09-01 17:47:25 +03:00
Denis Zharkov
02b72e16ef FIR: Temporary weaken required phase in ensureResolvedForCalls
Currently, lazy resolution in IDE immediately starts common body resolution
after STATUS (that lead to loops during recursive resolve)
2020-09-01 17:43:30 +03:00
Denis Zharkov
b0a7960b42 FIR: Call ensureResolved(TYPES) when computing supertypes of a class 2020-09-01 17:43:30 +03:00
Denis Zharkov
8427cc373f FIR: Fix coroutines related IDE exception from TowerResolveManager
Do not try to steal tasks in suspendResolverTask
Otherwise, it might lead to resuming current coroutine through
"resume" methods that is kind of illegal when using suspendCoroutineUninterceptedOrReturn
2020-09-01 17:43:30 +03:00
Denis Zharkov
d532529c30 FIR: Add workaround for recursive contracts in ensureResolvedForCalls 2020-09-01 17:43:30 +03:00
Denis Zharkov
0a1440d80c FIR: Optimize ensureResolvedForCalls for common case 2020-09-01 17:43:30 +03:00
Denis Zharkov
1c0e3b30a2 FIR: Use return type calculator in FirTypeMismatchOnOverrideChecker 2020-09-01 17:43:30 +03:00
Denis Zharkov
992a2d556a FIR: Add ensureResolved calls for types of sub-expressions
These calls resolve a class that a type of expression is built upon
2020-09-01 17:43:30 +03:00
Denis Zharkov
d05e947d25 FIR: Ensure resolved callable symbols came out of the declared scopes
Otherwise, we need to add `ensureResolved` to almost any usage of process*:
- Call resolution need fully resolved callables
- UseSiteScope when binding overrides should ensure resolved for callables from supertypes
- checkers have to make sure they use correct overridden
- SAM resolver
2020-09-01 17:43:30 +03:00
Denis Zharkov
d80caf7dbf FIR: Extract common code in FirPackageMemberScope 2020-09-01 17:43:30 +03:00
Denis Zharkov
b4aef21423 FIR: Simplify API for ensureResolved
Additional `as` casts look redundant, but it's a design issue (see KT-41421)
2020-09-01 17:43:30 +03:00
Denis Zharkov
bb84dc2ed4 FIR: Minor. Extract common parts in FirClassDeclaredMemberScope 2020-09-01 17:43:30 +03:00
Denis Zharkov
1cc68762e1 FIR: Minor. Fix error message 2020-09-01 17:43:30 +03:00
Denis Zharkov
4cdc36abb3 FIR: Drop unused 'phasedFir' callables 2020-09-01 17:43:30 +03:00
Denis Zharkov
c3c8115163 FIR: Use explicit version of 'ensureResolved' 2020-09-01 17:43:30 +03:00
Denis Zharkov
517056e0c6 FIR: Do not require specific phase for super-call receiver class
It's anyway defined in the outer context (outer class) that already
should have proper context
2020-09-01 17:43:30 +03:00
Denis Zharkov
fcc2abcf40 FIR: Fix phase requirement for call resolution 2020-09-01 17:43:30 +03:00
Denis Zharkov
ff182f191e FIR: Fix some contracts resolutions side-effects
- Resolve anonymous objects' contents
- Update phase for constructors
- Do not transform annotations
(while resolving they may refer to other declarations that don't have yet CONTRACTS phase)
2020-09-01 17:43:30 +03:00
Denis Zharkov
67cc85e02b FIR: Avoid redundant calls to ensureResolved during call resolution
Call ensureResolved only once when creating a candidate
2020-09-01 17:43:30 +03:00
Denis Zharkov
bf2fc10cd6 FIR: Extract AbstractFirBasedSymbol::ensureResolved extension 2020-09-01 17:43:30 +03:00
Denis Zharkov
2529f541ba FIR: Prepare refactoring of phasedFir
- Rename PhasedFirFileResolver -> FirPhaseManager
- Move semantically significant parts to a component
2020-09-01 17:43:30 +03:00
Ilya Goncharov
7fe02238ea [Gradle, JS] Add more information on Gradle exception
^KT-41566 fixed
2020-09-01 17:26:02 +03:00
Ilya Goncharov
076045ce54 [Gradle, JS] Add test with library mixed with executable and browser/nodejs
^KT-41566 fixed
2020-09-01 17:26:02 +03:00
Ilya Goncharov
d238483054 [Gradle, JS] Add test with library mixed with executable
^KT-41566 fixed
2020-09-01 17:26:02 +03:00
Ilya Goncharov
4a1bccc1e6 [Gradle, JS] Add test on simple js binary library
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
9f04d353a0 [Gradle, JS] Fix test for IR browser distribution
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
134aa6182e [Gradle, JS] Process resources into kotlin folder
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
06a54c87a0 [Gradle, JS] Compile sync tasks
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
9729554313 [Gradle, JS] Node run task for all binaries
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
7dbde459f0 [Gradle, JS] Run task for library
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
b4baaed87a [Gradle, JS] Different distributions for different binaries
^KT-41566 fixed
2020-09-01 17:26:01 +03:00
Ilya Goncharov
8c74a844f2 [Gradle, JS]] Add custom fields for package.json
^KT-35330 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
2d8b95190e [Gradle, JS] Outputs for distribution tasks as lazy
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
fe72d46fee [Gradle, JS] Add types into public package json
^KT-40753 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
39059c103a [Gradle, JS] Distribution directory as a lazy
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
82ea324cc1 [Gradle, JS] DefaultDistribution
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
53a23169d9 [Gradle, JS] Node js binaries executable filtering
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
73dbf6b846 [Gradle, JS] Add configureLibrary
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
1318517155 [Gradle, JS] Add configureLibrary
^KT-41566 fixed
2020-09-01 17:26:00 +03:00
Ilya Goncharov
c9ca05b477 [Gradle, JS] Add distribute resources tasks for all binaries
^KT-41566 fixed
2020-09-01 17:25:59 +03:00
Ilya Goncharov
cc25660d7d [Gradle, JS] Move distributions tasks into abstract subtarget class
^KT-41566 fixed
2020-09-01 17:25:59 +03:00
Roman Artemev
cae29a5d1c [IR] Clean up WrappedDescriptors API 2020-09-01 17:08:11 +03:00
Roman Artemev
c7b57c0fb3 [IR] Use only empty constructor to create WrappedDescriptor 2020-09-01 17:08:11 +03:00
Roman Artemev
fd88914cf9 [IR] Remove some descriptor usage from Common/JS/JVM backends
- replace descriptor-based builders with pure IR ones
 - fix matchers
 - fix Ir2Js
 - rewrite some inliner-helpers to pure-IR implementations
2020-09-01 17:08:11 +03:00
Dmitry Petrov
8cb8284957 EnhancedNullability annotation in IR
Fixes KT-40115 & KT-40117.

Move FlexibleNullability annotation to 'kotlin.internal.ir'.
2020-09-01 16:06:03 +03:00
Roman Artemev
0bff406a12 [JS IR] Add infra to test compilation with error
- add bunch of tests
 - fix help test
2020-09-01 14:53:08 +03:00
Roman Artemev
e592b3af1d [JS IR] Fix CallsLowering's*
- need to fix dev mode since some methods are not handled
 with intrinsic lowering
2020-09-01 14:53:08 +03:00
Roman Artemev
7a6415dc53 [JS IR] Enable IrError element's lowerings in JS 2020-09-01 14:53:08 +03:00
Roman Artemev
4dca3715fa [JS IR | IR] Implement error element lowering to support compilation with errors 2020-09-01 14:53:08 +03:00
Roman Artemev
14b5424583 [JS IR] Support translation of IrError* elements 2020-09-01 14:53:08 +03:00
Roman Artemev
1fd5c1cc65 [IR] Support IrErrorType & IrErrorDeclaration in ir mangler 2020-09-01 14:53:08 +03:00
Roman Artemev
9c36487077 [IR] Disable mangle checker for IrErrorDeclarations 2020-09-01 14:53:07 +03:00
Roman Artemev
563af709a8 [Psi2Ir] Fix generation of IrError* nodes
- Provide detailed description
 - Support syntax-incorrect statements
 - Generate an error declaration if normal generation has failed
2020-09-01 14:53:07 +03:00
Roman Artemev
a60782f3df [JS IR] Add CLI argument to setup error tolerance policy
-  Make sure dev mode is enabled if code with errors is allowed
2020-09-01 14:53:07 +03:00
Roman Artemev
8a810e2a5e [JS IR] Add runtime API to throw ISE in case of compiled code with errors 2020-09-01 14:53:07 +03:00
Roman Golyshev
b3199d14b8 FIR IDE: Use correct property-by-package index in KtFirPackageScope 2020-09-01 14:50:19 +03:00
Roman Golyshev
5180a65f0b FIR Completion: Use proper types rendering 2020-09-01 14:28:59 +03:00
Roman Golyshev
7649043479 FIR IDE: Set correct source for the function built in the air
- This enables the completion to work in the declaration itself, not
only in body
2020-09-01 10:09:46 +00:00
Roman Golyshev
90c89bddc5 FIR IDE: Add collecting scopes for declarations
- They are required to perform completion in default arguments,
return types, and other declaration parts (except for body)
2020-09-01 10:09:46 +00:00
Roman Golyshev
76eb5d46f4 FIR IDE: Add FirTowerDataContextCollector class
- This class just encapsulates the map that is used to collect scopes
2020-09-01 10:09:45 +00:00
Mikhail Zarechenskiy
9c217e3d99 Reuse revised variables during lambda analysis against type variables
#KT-41400 Fixed
2020-09-01 13:04:53 +03:00
Dmitriy Novozhilov
011bb0924a [FIR-IDE] Introduce FirIdeSessionFactory for creating ide sessions 2020-09-01 12:00:13 +03:00
Dmitriy Novozhilov
cb47e631f8 [FIR] Move extended checkers containers to :compiler:fir:entrypoint 2020-09-01 12:00:13 +03:00
Dmitriy Novozhilov
f14efedc3d [FIR] Fix broken gradle compilation 2020-09-01 12:00:13 +03:00
Dmitriy Novozhilov
c250912ee0 [FIR-TEST] Use FirAnalyzerFacade in BB and Fir2IrText tests 2020-09-01 12:00:13 +03:00
Dmitriy Novozhilov
a4e24ca3dc [FIR] Introduce FirAnalyzerFacade which hides implementation details of running FIR compiler 2020-09-01 12:00:13 +03:00
Dmitriy Novozhilov
6db8c28291 [FIR] Refactor session components initialization
From now all customization of session should perform via DSL which
  declared in FirSessionFactory. Registration or mutation session
  services from other places is prohibited
2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
2819bd3aaf [FIR] Get rid of deprecated extension point registration methods usage 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
cf224b4de9 [FIR] Add createEmptySession to FirSessionFactory for testing purposes 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
a8d23c36f5 [FIR] Introduce module :fir:entrypoint and FirSessionFactory for creating sessions 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
94d58c714a [FIR] Cleanup dependencies for fir modules 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
73e2314f2f [FIR] Get rid of dependency on intellijCore from :compiler:fir:resolve 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
18ad56f7a8 [FIR] Fix creating fake source elements in declarations resolve 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
28e6050551 [FIR] Extract java synthetic names calculation to platform specific component 2020-09-01 12:00:12 +03:00
Dmitriy Novozhilov
375140ebcc [FIR] Extract java class mapping to platform specific component 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
a0b931792e Move annotationsForResolve.kt to :core:compiler.common 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
07c353973d Move requireOrDescribe to :core:compiler.common 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
f010dc533c Move Variance.convertVariance to :core:compiler.common 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
e164c88a14 Move TypeSystemCommonBackendContext to :core:compiler.common 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
3379d9b619 [FIR] Extract java related effective visibility calculation to platform component 2020-09-01 12:00:11 +03:00
Dmitriy Novozhilov
ed4c6a38b6 [FIR] Move deserialization files to module :compiler:fir:fir-deserialization 2020-09-01 12:00:10 +03:00
Dmitriy Novozhilov
ca031f7ace [FIR] Split ResolveUtils.kt from :resolve to separate files 2020-09-01 12:00:10 +03:00
Dmitriy Novozhilov
6ace4164ff [FIR] Split TypeUtils from :resolve to :cones and :tree modules 2020-09-01 12:00:10 +03:00
Dmitriy Novozhilov
92ffa4dea9 [FIR] Replace KotlinScopeProvider with FirScopeProvider in ClassDeserialization
This is needed to remove dependecy on :fir:resolve from serialization
  methods
2020-09-01 12:00:10 +03:00
Mikhail Glukhikh
3aa13362ca [FIR2IR] Replace NPE in setThisReceiver with more detailed exception 2020-09-01 11:40:32 +03:00
Mikhail Glukhikh
65739c50d3 FIR full pipeline test: output build status per-module 2020-09-01 11:40:32 +03:00
Pavel Kirpichenkov
2979c37001 [NI] Fix resolution status for UnstableSmartCastDiagnostic
RESOLVED_WITH_ERROR was initially added for reproducing OI behavior.
The intention was to preserve resolution into unstable smart cast and to keep failing candidate.
However, this idea was abandoned after OI behavior proved inconsistent in cases involving generics.

This commit restores RUNTIME_ERROR status of UnstableSmartCastDiagnostic.

^KT-41357 Fixed
2020-09-01 11:21:13 +03:00
Igor Chevdar
5e71068e61 [IR] Handled degenerate cases of IrStringConcatenation
It is not needed to create StringBuilder if the number of values
being concatenated is 0 or 1
2020-09-01 11:34:17 +05:00
Dmitriy Dolovov
74dce725cc [Commonizer] Tests for missed supertypes in commonized type aliases
^KT-41247
2020-09-01 13:11:33 +07:00
Dmitriy Dolovov
96736b0126 [Commonizer] Add missed supertypes in commonized type aliases
^KT-41247
2020-09-01 13:11:27 +07:00
Dmitriy Dolovov
e21d99334b [Commonizer] Lookup common descriptors that don't participate in commonization (for tests only)
This is necessary to run integration tests with fake declarations from
Kotlin/Native stdlib that are absent in stdlib-common.
2020-09-01 13:11:22 +07:00
Dmitriy Dolovov
ed78169051 [Commonizer] README: Describe the case when target is not available 2020-09-01 13:11:16 +07:00
Nikolay Krasko
56f0fb6c70 Prevent test failures because of Leaked Android SDK
Stop implicit adding additional SDK from environment variables in
GradleSpecificInitializer and AndroidSdkInitializer.
2020-08-31 21:18:26 +03:00
Steven Schäfer
78ab957bfe JVM IR: Fix mangling for suspend functions with inline class params (KT-41374) 2020-08-31 18:43:29 +02:00
Igor Yakovlev
48a3d4b8e0 [ULC] Add recursion guard to getLightClass
Fixed KT-41325
2020-08-31 18:01:37 +03:00
Pavel Kirpichenkov
873224dfbc [NI] Use new type substitutor for known type parameters
Use known type parameters substitutor after substitutor for fresh variables.
The old logic of substituions had the following order:
- replace known type parameters
- replace type parameters with type variables
- complete inference
- replace type variables with inferred types

According to the updated logic, replacement goes as follows:
- replace type parameters with type variables
- replace known type parameters; if they were variables, this will effectively remove them from inference
- complete inference
- replace remaining type variables with inferred types

Support projection substitution in new type substitutor.
It is needed for correct interaction with old type substitutor.
Old type substitutors can contain mappings constructor -> projection
which couldn't be expressed correctly with existing substitutor API in some cases.

^KT-41386 Fixed
2020-08-31 17:53:46 +03:00
Alexander Udalov
c706673de9 Minor, refactor bytecode text tests on when-over-string optimization
- Merge `duplicatingItemsSameHashCode.kt` and
  `duplicatingItemsSameHashCode2.kt` into one test enabled on both
  backends, and rename it to
  `duplicatingItemsSameHashCodeFewBranches.kt`.
- Rename `duplicatingItemsSameHashCode3.kt` to
  `duplicatingItemsSameHashCodeMoreBranches.kt`, and also enable it for
  both backends.
- Use JVM_TEMPLATES/JVM_IR_TEMPLATES to check backend-specific behavior:
    1) JVM IR does not optimize less than 2 branches by design
    2) JVM IR does not generate duplicate branches, also by design

Related to KT-36846.
2020-08-31 16:47:11 +02:00
Alexander Udalov
a639915a34 JVM IR: do not mangle property accessors of unsigned types in annotations
Before this change, we incorrectly mangled the names of annotation
methods (e.g. `getI-pVg5ArA` instead of `i`) because the isSpecial
condition was false.
2020-08-31 14:19:14 +02:00
Mikhail Glukhikh
1e360d9c91 [FIR2IR] Pass type context for type argument conversion properly 2020-08-31 14:31:58 +03:00
Jinseong Jeon
04af6846a7 FIR2IR: handle more vararg spreads for adapted callable references 2020-08-31 14:31:58 +03:00
Mikhail Glukhikh
5efabe063e [FIR] Fix JVM mapped function callable id 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
db815c96c5 [FIR] Substitute copied type parameters in fake override properties 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
dc9306367a FirClassSubstitutionScope: reorder companion functions 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
5ad453d927 [FIR] Substitute copied type parameters in fake override functions 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
458f89ef33 [FIR] Signature composer: return null signature for local declarations 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
02b6f34067 [FIR2IR] Add extension receiver parameter to delegated members 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh
22c63c4e80 [FIR2IR] Add supertypes to delegated member type parameters 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh
9ad55a0ee3 [FIR2IR] Don't create list under the hood in DelegatedMemberGenerator 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh
5384ccf02f [FIR] Introduce & use FirDelegatedMemberScope 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh
f0af930288 [FIR] Eliminate unused FirDelegatedTypeRef 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh
ede910065a [FIR] Add problematic resolve test case with delegated super call 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh
3f5beb77e8 [FIR2IR] Cache delegatable members properly 2020-08-31 14:31:55 +03:00
Alexander Udalov
1e712f8398 IR: remove IrElementVisitorVoidWithContext
It was only used as a superclass in IrInlineReferenceLocator and
LocalDeclarationsLowering. In both cases it's clearer and more optimal
to pass the necessary data via the visitor 'data' variable.
2020-08-31 12:47:54 +02:00
Alexander Udalov
5e48be3d11 Add a fallback flag -Xno-unified-null-checks for KT-22275
#KT-41482 Fixed
2020-08-31 12:43:28 +02:00
Ilya Kirillov
40669350f7 Wizard: navigate to wizard help page when clicking help button 2020-08-31 12:50:01 +03:00
Ilya Kirillov
fa847d758d Wizard: use compileKotlin for groovy instead of direct KotlinCompile task access
#KT-38921 fixed
2020-08-31 12:49:48 +03:00
Ilya Goncharov
e672f5f8e3 [Wizard, JS] Remove duplicating descriptions 2020-08-31 12:19:10 +03:00
Ilya Goncharov
554c67cd1d [Wizard, JS] Add descriptions to wizard options 2020-08-31 12:16:54 +03:00
Nicolay Mitropolsky
af35b6c3c8 Provide icons to Kotlin Light-elements (KT-26235) 2020-08-31 10:54:46 +03:00
Igor Chevdar
527de030fc [box-tests] Turned on some tests for K/N 2020-08-31 12:01:31 +05:00
Igor Chevdar
ab54e43b00 [IR] Commonized SAM equals/hashCode builder 2020-08-31 12:01:29 +05:00
Igor Chevdar
12ddd137bc [IR] Moved isLambda to common IR utils 2020-08-31 12:01:29 +05:00
vldf
b050ef9970 [FIR] Remove print in UnusedChecker 2020-08-30 14:18:01 +03:00
Ilya Gorbunov
9c3ff6828a Export kotlin.test packages with annotations and underlying frameworks
- Add exports for jvm package names used in kotlin.test annotations;

- Export transitively underlying test framework modules
Otherwise "This class does not have a constructor" happens when using
an aliased annotation, e.g. kotlin.test.Test aliased to org.junit.test

KT-41320
2020-08-29 03:33:38 +03:00
Andrey.Lozhkin
ef57c62576 [Gradle, Cocoapods] refactor I/O, improve Up-To-Date
all synthetic tasks are per pod
tasks receive parts of extension as inputs
2020-08-29 01:51:20 +03:00
Andrey.Lozhkin
1888462dc0 [Gradle, Cocoapods] move tasks from per target
podGen now per Family
podSetupBuild and podBuild now per sdk
2020-08-29 01:51:20 +03:00
Andrey Lozhkin
fcf5060907 [Gradle, Cocoapods] implement DSL to support Cocoapods Dependencies from Git or Web
Issue #KT-41367 Fixed
2020-08-29 01:51:20 +03:00
Steven Schäfer
b02f0f0a25 JVM IR: Fix compilation of nested inner classes 2020-08-28 20:03:19 +02:00
Steven Schäfer
02e78bcd76 JVM IR: Use package visibility for fields of captured variables 2020-08-28 20:03:19 +02:00
Roman Artemev
443269af0a [IR] Drop irProviders from stub generator 2020-08-28 18:14:05 +03:00
Roman Artemev
39808789c3 [KLIB] Fix SOE in K/N
- fixes KT-41324
2020-08-28 18:14:04 +03:00
Mikhail Zarechenskiy
23f87d413a Use initial system for completion if common one is effectively empty
Otherwise we can get unsubstituted type variables as expected types and
 then write wrong information for assertions

 #KT-41470 Fixed
2020-08-28 17:47:08 +03:00
Nick
bb18203ae6 [FIR] Various checkers performance fixes 2020-08-28 17:07:35 +03:00
Sergey Igushkin
5c88eb722d Fix transitive deps on MPP with host-specific source sets (KT-41083)
A consumer could not resolve the host-specific metadata artifact
of the transitive dependency because the transitive dependency's parent
in the platform dependencies graph did not include the dependency on it
in the variant that is chosen for host-specific source sets metadata:
the dependencies of that variant were empty.

Export the dependencies of the Kotlin/Native target in the host-specific
metadata variant as well.

Issue #KT-41083 Fixed
2020-08-28 11:09:56 +00:00
Zalim Bashorov
9097d0918c [JS BE] Support passing an array as argument of vararg in named form
#KT-38059 fixed
2020-08-28 13:14:23 +03:00
Zalim Bashorov
606232a584 [JS IR] Don't generate "import" statements for external interfaces
#KT-40964 fixed
2020-08-28 13:14:22 +03:00
Zalim Bashorov
ba846830c9 [JS IR] Support nativeGetter, nativeSetter and nativeInvoke
#KT-41081 fixed
2020-08-28 13:04:18 +03:00
Ilya Kirillov
c804319e65 FIR IDE: fix compilation on AS 2020-08-28 12:51:55 +03:00
Ilya Kirillov
36cc73602e FIR IDE: fix testdata of AbstractFirLazyResolveTest 2020-08-28 12:51:55 +03:00
Ilya Kirillov
3cd445563e FIR IDE: implement KotlinExpressionTypeProvider for FIR 2020-08-28 12:51:55 +03:00
Ilya Kirillov
fcc7db5224 FIR IDE: introduce analyseInModalWindow function 2020-08-28 12:51:23 +03:00
Ilya Kirillov
81be230541 FIR IDE: add validity assertion on analysis session access 2020-08-28 12:15:19 +03:00
Ilya Kirillov
db48884a4e FIR IDE: add check canceled check between diagnostics 2020-08-28 12:15:18 +03:00
Ilya Kirillov
95a96f32bf FIR IDE: log errors on diagnostics, not throw them 2020-08-28 12:15:17 +03:00
Ilya Kirillov
ebafd0fb51 FIR IDE: resolve ambiguity & inapplicable references 2020-08-28 12:15:16 +03:00
Ilya Kirillov
4fa2dd85b4 FIR IDE: move lazy resolve to FirLazyDeclarationResolver 2020-08-28 12:15:15 +03:00
Ilya Kirillov
8faaff00fa FIR IDE: run lazy resolve on declaration when getting phased fir 2020-08-28 12:15:14 +03:00
Ilya Kirillov
78bb1f1076 FIR IDE: fix testdata in idea-frontend-fir 2020-08-28 12:15:13 +03:00
Ilya Kirillov
30ac80a506 FIR IDE: introduce property accessor symbols 2020-08-28 12:15:13 +03:00
Ilya Kirillov
aae56cadac FIR IDE: add ModuleInfo for ide sessions as they are used for getting resolve components 2020-08-28 12:15:12 +03:00
Ilya Kirillov
bc3e98b116 FIR IDE: allow PCE between resolve phases, forbid in other cases 2020-08-28 12:15:11 +03:00
Ilya Kirillov
8363c711e6 FIR IDE: fix lazy resolve for local declarations 2020-08-28 12:15:10 +03:00
Ilya Kirillov
9d237033ad FIR IDE: minor, rename FirIdeModuleLibraryDependenciesSession to FirIdeLibrariesSession 2020-08-28 12:15:09 +03:00
Ilya Kirillov
8b782d5954 FIR IDE: fix session provider implementation as it only provides only 2 sessions 2020-08-28 12:15:07 +03:00
Ilya Kirillov
a07d3f2425 FIR IDE: minor: rename FirIdeJavaModuleBasedSession to FirIdeSourcesSession 2020-08-28 12:15:07 +03:00
Ilya Kirillov
f76b5bbf1b FIR IDE: allow KtFirPackageScope to work without providers 2020-08-28 12:15:06 +03:00
Ilya Kirillov
f4c17dadb3 FIR IDE: remove unused FirIdeModuleLibraryDependenciesSymbolProvider 2020-08-28 12:15:05 +03:00
Ilya Kirillov
a156cca02a FIR: make class FirObjectImportedCallableScope to be name aware 2020-08-28 12:15:04 +03:00
Ilya Kirillov
333213bbb9 Wizard: add descriptions for some settings 2020-08-28 11:46:55 +03:00
Ilya Kirillov
37b869ebc5 Wizard: add descriptions for settings 2020-08-28 11:46:55 +03:00
Dmitriy Novozhilov
09ed0c3e82 [FIR-TEST] Update testdata 2020-08-28 10:59:54 +03:00
Dmitriy Novozhilov
e7b5a88cbd [FIR] Remove dependency on :compiler:frontend from :compiler:fir:resolve 2020-08-28 10:59:54 +03:00
Dmitriy Novozhilov
abeb42ca20 [FIR] Don't use ProjectExtensionDescriptor in FirExtensionRegistrar 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
f09e17a5ae [FIR] Remove unused import 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
e405a02e8e [FIR] Fix contract serialization 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
eaf8af919d [FIR] Use PersistentList instead of guava's ImmutableList in SupertypeResolution 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
148e8fe76e Move FlatSignature to :compiler:resolution.common 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
64766e125c Move common inference classes to :compiler:resolution.common 2020-08-28 10:59:53 +03:00
Dmitriy Novozhilov
068d21635e [NI] Get rid of KotlinType usages in MutableConstraintStorage.kt 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
af0df35623 [NI] Get rid of FE 1.0 types in ConstraintInjector 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
ad039a28bd [NI] Get rid of left FE 1.0 types in NewConstraintSystemImpl 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
6914aba5c2 [NI] Commonize detection of @OnlyInputTypes in NewConstraintSystemImpl 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
64f0ee21c1 Get rid of FE 1.0 classes usage in ConstraintIncorporator 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
1050f7f066 Extract PostponedResolvedAtomMarker to separate file 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
1cadabb099 Extract ResolutionCandidateApplicability to separate file 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
775df6dfc3 [NI] Get rid of FE 1.0 type usages in ResultTypeResolver 2020-08-28 10:59:52 +03:00
Dmitriy Novozhilov
aae1681b76 [NI] Get rid of ResolvedAtom usage in ConstraintSystemCompletionContext 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
11e8552861 [NI] Get rid of PostponedArgumentInputTypesResolver.Context 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
970a2581a1 [NI] Extract PostponedArgumentsAnalyzerContext from PostponedArgumentsAnalyzer 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
b15f847943 [NI] Extract common parts from KotlinConstraintSystemCompleter 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
12fbb93871 [NI] Extract FE 1.0 specific part from NewCommonSuperTypeCalculator 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
b21a0213df [NI] Get rid of FE 1.0 types in AbstractTypeApproximator 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
527c5a771d [NI] Get rid of FE 1.0 types in AbstractTypeCheckerContextForConstraintSystem 2020-08-28 10:59:51 +03:00
Dmitriy Novozhilov
686c17a234 [NI] Rename NewConstraintSystem.diagnostics to errors 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov
59b2cb6393 [NI] Split KotlinCallDiagnostics and inference errors to different hierarchies 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov
fae21d4db3 Introduce frontend independent constraint positions 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov
e5e3d7cab1 Extract FE 1.0 related parts from NewConstraintSystem 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov
be1033a4a7 [FIR] Implement ConeTypeContext.createTypeWithAlternativeForIntersectionResult 2020-08-28 10:59:50 +03:00
Dmitriy Novozhilov
f247cc3165 [NI] Properly detecting suitability of candidate for builder inference
#KT-41430 Fixed
2020-08-28 10:34:18 +03:00
Sergey Bogolepov
b2d9e5be91 [kotlinx-metadata-klib] Drop dependency on descriptors
It's unneeded since all used declarations moved to
:core:compiler.common.
2020-08-28 12:33:46 +07:00
Simon Ogorodnik
7170a23f63 [FIR] Use coroutine intrinsics in tower resolver manager
To remove SafeContinuation overhead
2020-08-28 00:12:17 +03:00
Simon Ogorodnik
7cb5c0a6d8 [FIR] Cleanup hides members condition 2020-08-28 00:12:17 +03:00
Simon Ogorodnik
bf2e17b133 [FIR] Extract invoke processing from TowerLevelHandler 2020-08-28 00:12:17 +03:00
Simon Ogorodnik
96f100381a Use proper manifest for kotlin-reflect in jps build 2020-08-28 00:12:17 +03:00
Simon Ogorodnik
34f5cfbf96 [FIR] Fix integer approximation on safe calls 2020-08-28 00:12:17 +03:00
Simon Ogorodnik
2a4e1a0b99 [FIR] Clarify testData for invokes 2020-08-28 00:12:16 +03:00
Alexander Udalov
74c6d2b951 Do not generate non-standard compareTo as primitive comparison in all backends
Previous changes related to this in the old JVM backend were in
582b1c5e66 and
0482f7e9c5, but they did not affect the
`ProperIeee754Comparisons` mode which became the default in 1.4.0. As a
result, we had a regression here.

Since the `PRIMITIVE_NUMERIC_COMPARISON_INFO` slice is used in psi2ir to
determine how to generate the comparison, this fixes the regression both
in the old JVM backend, and in all IR backends.

 #KT-41426 Fixed
2020-08-27 19:00:11 +02:00
Alexander Udalov
9d81e50128 IR: undeprecate IrUninitializedType
It's no longer a temporary hack, see the comment.
2020-08-27 18:02:04 +02:00
Dmitry Savvinov
5649cbc2e1 Wire KotlinTypeRefiner in areCallableDescriptorsEquivalent
See the issue for details

^KT-41218 Fixed
2020-08-27 18:50:42 +03:00
Dmitry Savvinov
421efaa565 Add test for overload resoultion ambiguity in HMPP
The behaviour is undesired, see the next commit for fix

^KT-41218 In Progress
2020-08-27 18:50:42 +03:00
Dmitry Savvinov
68d931969d Minor: explicitly opt-in for diagnostics messages in MultiplatformAnalysisTests 2020-08-27 18:50:42 +03:00
Dmitriy Novozhilov
9cde42e2bc [NI] Fix shouldRunCompletion for builder inference session
#KT-41308 Fixed
#KT-41363
2020-08-27 16:51:12 +03:00
Dmitriy Novozhilov
e98cbf81cf [NI] Don't always complete builder inference lambda in FULL mode
#KT-41164 Fixed
2020-08-27 16:51:11 +03:00
vldf
6a15e0410f [FIR] Fix CLI tests to prevent non-relevant errors from appearing 2020-08-27 16:07:04 +03:00
vldf
6c2ece9a6e Rename: FirSourceElement.getChildren() -> getChild() + minor fixes 2020-08-27 16:07:04 +03:00
vldf
bf363e8f1a [FIR] Update/add extended checker tests 2020-08-27 16:07:04 +03:00
Oleg Ivanov
acbb67f851 [FIR] Fix collectDataForNode backward traverse 2020-08-27 16:07:03 +03:00
vldf
f9c7cce11d [FIR] Add some helper functions for checkers 2020-08-27 16:07:03 +03:00
vldf
96f24a43be [FIR] Introduce unused variable extended checker 2020-08-27 16:07:03 +03:00
vldf
e718f60833 [FIR] Refactoring extended checkers 2020-08-27 16:07:03 +03:00
vldf
aefb7dc10f [FIR] Add checkerContext parameter to ControlFlowAnalyserCheckers 2020-08-27 16:07:03 +03:00
vldf
14eaa113e0 [FIR] Add new errors for extended checkers (around unused variable) 2020-08-27 16:07:03 +03:00
vldf
58c5d3a6ca [FIR] Fix destructuring declaration creation via light tree 2020-08-27 16:07:03 +03:00
vldf
3428a5434b [FIR] Add methods to access child/children of FirSourceElement 2020-08-27 16:07:02 +03:00
vldf
5e0dc53295 [FIR] Refactor CanBeValChecker 2020-08-27 16:07:02 +03:00
Andrei Klunnyi
5cf76aa950 KT-41425 Project can not be launched with Gradle runner
93a82060 introduced support of "delegate to Gradle" for Gradle-Kotlin.
This commit fixes an issue known as "Could not get unknown property
'sourceSets' for root project".
2020-08-27 14:50:40 +02:00
Nikolay Krasko
f57f920dc0 Mark IdeReplExecutionTest.testOnePlusOne as flaky
Was previously muted on TC.
2020-08-27 14:08:48 +03:00
Nikolay Krasko
866666f3ff Update test data for MultiModuleHighlightingTest.testLanguageVersionsViaFacets
Remove `Reference is not resolved to anything` markers
2020-08-27 14:08:48 +03:00
Nikolay Krasko
4b937f0929 Mute stable CompilerDaemonTest.testParallelDaemonStart
It was previously muted on TC.
2020-08-27 14:08:48 +03:00
Dmitry Gridin
0c0b394cc2 [formatter] fix performance issue
^KT-41314 Fixed
2020-08-27 11:04:34 +00:00
Ilya Goncharov
9818321b46 [JS, Wizard] Use react template in full stack
^KT-41417 fixed
2020-08-27 13:35:17 +03:00
Ilya Goncharov
cd0bdc190b [JS, Wizard] Use IR in gradle.properties and otherwise use as a param
^KT-41418 fixed
2020-08-27 13:34:46 +03:00
Ilya Goncharov
13bf15b403 [JS, Wizard] Set js compiler per module
^KT-41418 fixed
2020-08-27 13:34:46 +03:00
Ilya Kirillov
f824f03fa2 Wizard: fix filtering values in DropDownComponent 2020-08-27 13:34:46 +03:00
Ilya Goncharov
98f98d5856 [JS, Wizard] Add different compilers for JS wizard
^KT-41418 fixed
2020-08-27 13:34:46 +03:00
Ilya Goncharov
c797f3044e [JS, Wizard] Add react template plugin
^KT-41417 fixed
2020-08-27 13:34:45 +03:00
Ilya Goncharov
220ff6c648 [JS, Wizard] Add redux and react router
^KT-41417 fixed
2020-08-27 13:34:30 +03:00
Ilya Goncharov
d5340803bd [JS, Wizard] Add react application template
^KT-41417 fixed
2020-08-27 13:34:15 +03:00
Ilya Goncharov
01064a4e46 [JS, Wizard] Add react application template
^KT-41417 fixed
2020-08-27 13:33:50 +03:00
Ilya Goncharov
96e1b1c0e0 [JS, Wizard] Separate browser application without react
^KT-41417 fixed
2020-08-27 13:33:34 +03:00
Ilya Goncharov
491eb5e366 [JS, Wizard] Move subtarget settings in separate object
^KT-41417 fixed
2020-08-27 13:33:15 +03:00
Ilya Goncharov
94f8a78893 [JS, Wizard] Fix source set name for js wizard
^KT-41417 fixed
2020-08-27 13:30:37 +03:00
Mikhail Zarechenskiy
cba13c3c35 Take into account captured types with variables during fixation
#KT-41202 Fixed
2020-08-27 11:06:14 +03:00
Dmitry Gridin
5dbb6fdf50 [inspections] NamingConversion: add missing space in description
^KT-41395 Fixed
2020-08-27 14:58:33 +07:00
Yunir Salimzyanov
e12c35de5f Traverse all pages of muted tests on Teamcity (KTI-326)
incomplete list of remotely muted tests was causing re-muting of tests
that were not fetched
2020-08-26 19:37:11 +03:00
Mikhail Zarechenskiy
06a592c018 Fix SOE when recursive type argument is used with star projection
#KT-41043 Fixed
2020-08-26 19:23:21 +03:00
Mikhail Zarechenskiy
674e9e455f Fold lower constraints like (T!!..T) and (T..T?) into the latter one
#KT-41149 Fixed
2020-08-26 19:23:20 +03:00
Mikhail Zarechenskiy
e91b378b7d Don't perform unnecessary SAM conversions
#KT-41149 In Progress
2020-08-26 19:23:19 +03:00
Mikhail Zarechenskiy
6a7ed96be5 Consider T <: Nothing! as trivial during constraint incorporation
#KT-41149 In Progress
2020-08-26 19:23:18 +03:00
Mikhail Zarechenskiy
567e6ca9ca Fix OOM when there are several lambdas with extension function types
#KT-41335 Fixed
2020-08-26 19:23:18 +03:00
Jinseong Jeon
085e0dc1de FIR2IR: allow array expression as named argument for vararg 2020-08-26 18:01:21 +03:00
Vladimir Dolzhenko
54d3c5fb0a Pick up script language level from used stdlib in a gradle's classpath
^KT-41283 Fixed
2020-08-26 14:09:58 +00:00
Ilya Kirillov
949c67078d NJ2K: fix testdata of MultiFileTestGenerated.testNullabilityByDFa 2020-08-26 16:17:24 +03:00
Ilya Kirillov
c8ab827fa0 Wizard: fix invalid path in generated buildscript on windows 2020-08-26 16:17:24 +03:00
Nicolay Mitropolsky
c93ae64546 Uast: KotlinClassViaConstructorUSimpleReferenceExpression resolve to PsiClass (KT-41290) 2020-08-26 16:13:13 +03:00
Vladimir Dolzhenko
99924ea5e4 Fix Typo: equals() & hashCode(), toString() are written with the first uppercase letter
^KT-41390 Fixed
2020-08-26 14:59:31 +02:00
Jinseong Jeon
553ae68c96 FIR2IR: convert adapted callable reference with vararg 2020-08-26 14:26:19 +03:00
Igor Yakovlev
48034092e9 Fix SOE on library source based lightclass lookup
Fixed KT-41325
2020-08-26 12:10:09 +03:00
Jinseong Jeon
99286a6ce3 FIR2IR: introduce & use ClassId-based lookup for local class as IrParent 2020-08-26 10:08:16 +03:00
Aurimas Liutikas
777b16e0a3 Fix @Language injection when using named parameters
Start using names of arguments if they are available when fetching
the @Language injection information.

Fixes KT-35859
2020-08-25 23:02:53 +03:00
Alexander Udalov
a9ddf02556 Replace deprecated usages of max/min with maxOrNull/minOrNull 2020-08-25 20:33:59 +02:00
Nikolay Krasko
81dda96ece Mute flaky KotlinFindUsagesWithLibraryTestGenerated.KotlinLibrary 2020-08-25 21:31:11 +03:00
Nikolay Krasko
3a1158b4ef Minor: move mute KotlinFindUsagesWithLibraryTestGenerated to common 2020-08-25 21:31:11 +03:00
Nikolay Krasko
125819f9bf Mute flaky testUsingReadOnlyInterfaces test 2020-08-25 21:31:10 +03:00
Nikolay Krasko
1928390121 Prevent flaky behaviour from MakeOverriddenMemberOpenFix in tests
Several quick fix tests are flaky thanks to MakeOverrideMemberOpenFix
class. Flakiness is probably caused by `myQuickFixInfo: QuickFixInfo`
field. When there's no memory pressure, there's no resolve in dispatch
thread, but value may be invalidated because of soft reference usage
and re-evaluating might cause the test failure.

Caused by: org.jetbrains.kotlin.idea.caches.resolve.KotlinIdeaResolutionException: Kotlin resolution encountered a problem while analyzing KtNamedFunction
  at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeWithDebugInfo.analyze(ResolutionFacadeWithDebugInfo.kt:44)
  at org.jetbrains.kotlin.idea.caches.resolve.ExtendedResolutionApiKt.analyze(extendedResolutionApi.kt:97)
  at org.jetbrains.kotlin.idea.caches.resolve.ExtendedResolutionApiKt.resolveToDescriptorIfAny(extendedResolutionApi.kt:39)
  at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.resolveToDescriptorIfAny(resolutionApi.kt:60)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.computeInfo(MakeOverriddenMemberOpenFix.kt:54)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.access$computeInfo(MakeOverriddenMemberOpenFix.kt:38)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix$myQuickFixInfo$2.invoke(MakeOverriddenMemberOpenFix.kt:41)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix$myQuickFixInfo$2.invoke(MakeOverriddenMemberOpenFix.kt:38)
  at org.jetbrains.kotlin.idea.core.util.CachedValueHelpersKt$sam$com_intellij_psi_util_CachedValueProvider$0.compute(CachedValueHelpers.kt)
  at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
  at com.intellij.util.CachedValueBase.lambda$getValueWithLock$0(CachedValueBase.java:228)
  at com.intellij.util.IdempotenceChecker.applyForRandomCheck(IdempotenceChecker.java:336)
  at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
  at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
  at org.jetbrains.kotlin.idea.core.util.CachedValueHelpersKt.getValue(CachedValueHelpers.kt:25)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getMyQuickFixInfo(MakeOverriddenMemberOpenFix.kt)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getContainingDeclarationsNames(MakeOverriddenMemberOpenFix.kt:45)
  at org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix.getText(MakeOverriddenMemberOpenFix.kt:89)
  at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.getText(IntentionActionWithTextCaching.java:165)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$invokeIntention$52(CodeInsightTestFixtureImpl.java:1933)
  at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
  at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
  at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:322)
  at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
  at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
  at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
  at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
  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:965)
  at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:838)
  at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
  at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:733)
  at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
  at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
  at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:496)
  at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.intellij.util.ui.UIUtil.dispatchAllInvocationEvents(UIUtil.java:1738)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$invokeIntention$53(CodeInsightTestFixtureImpl.java:1939)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.withReadOnlyFile(CodeInsightTestFixtureImpl.java:1960)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.invokeIntention(CodeInsightTestFixtureImpl.java:1929)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$launchAction$14(CodeInsightTestFixtureImpl.java:680)
  at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:18)
  at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:13)
  at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:44)
  at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:18)
  at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
  at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.launchAction(CodeInsightTestFixtureImpl.java:680)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$stubComparisonFailure$1.invoke(AbstractQuickFixTest.kt:176)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$stubComparisonFailure$1.invoke(AbstractQuickFixTest.kt:34)
  at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManager.runWithForceCheckForResolveInDispatchThreadInTests$idea_core(ResolveInDispatchThreadManager.kt:115)
  at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManagerKt.forceCheckForResolveInDispatchThreadInTests(ResolveInDispatchThreadManager.kt:40)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.applyAction(AbstractQuickFixTest.kt:175)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.access$applyAction(AbstractQuickFixTest.kt:34)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doKotlinQuickFixTest$1.run(AbstractQuickFixTest.kt:125)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
  at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.doKotlinQuickFixTest(AbstractQuickFixTest.kt:96)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.access$doKotlinQuickFixTest(AbstractQuickFixTest.kt:34)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doTest$1.invoke(AbstractQuickFixTest.kt:60)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$doTest$1.invoke(AbstractQuickFixTest.kt:34)
  at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseKt.withCustomCompilerOptions(KotlinLightCodeInsightFixtureTestCase.kt:253)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest.doTest(AbstractQuickFixTest.kt:55)
  at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$testWithCustomIgnoreDirective$6(KotlinTestUtils.java:803)
  at org.jetbrains.kotlin.test.MuteWithFileKt$testWithMuteInFile$1.invoke(muteWithFile.kt:41)
  at org.jetbrains.kotlin.test.KotlinTestUtils.runTestImpl(KotlinTestUtils.java:773)
  at org.jetbrains.kotlin.test.KotlinTestUtils.runTest(KotlinTestUtils.java:716)
  at org.jetbrains.kotlin.idea.quickfix.QuickFixTestGenerated$Override.runTest(QuickFixTestGenerated.java:10025)
  at org.jetbrains.kotlin.idea.quickfix.QuickFixTestGenerated$Override.testOverridingDelegatedMethod(QuickFixTestGenerated.java:10074)
  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 junit.framework.TestCase.runTest(TestCase.java:176)
  at com.intellij.testFramework.UsefulTestCase.lambda$runTest$9(UsefulTestCase.java:327)
  at com.intellij.testFramework.UsefulTestCase.lambda$invokeTestRunnable$10(UsefulTestCase.java:364)
  at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:44)
  at com.intellij.testFramework.UsefulTestCase.invokeTestRunnable(UsefulTestCase.java:363)
  at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:346)
  at org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCaseBase.lambda$runTest$0(KotlinLightCodeInsightFixtureTestCaseBase.java:92)
  at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$runTestWithThrowable$4(KotlinTestUtils.java:726)
  ... 36 more
Caused by: org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadException: Resolve is not allowed under the write action for `org.jetbrains.kotlin.idea.quickfix.MakeOverriddenMemberOpenFix`!
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$writeActionResolveHandler$1.invoke(AbstractQuickFixTest.kt:170)
  at org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest$applyAction$writeActionResolveHandler$1.invoke(AbstractQuickFixTest.kt:34)
  at org.jetbrains.kotlin.idea.caches.resolve.ResolveInDispatchThreadManager.assertNoResolveInDispatchThread$idea_core(ResolveInDispatchThreadManager.kt:73)
  at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl.analyze(ModuleResolutionFacadeImpl.kt:60)
  at org.jetbrains.kotlin.idea.caches.resolve.ModuleResolutionFacadeImpl.analyze(ModuleResolutionFacadeImpl.kt:56)
  at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeWithDebugInfo.analyze(ResolutionFacadeWithDebugInfo.kt:45)
  ... 126 more
2020-08-25 21:31:10 +03:00
Mikhail Glukhikh
5702fb3b22 FIR: fix CCE in AttributeArrayOwner 2020-08-25 19:29:59 +03:00
Mikhail Glukhikh
962059a878 Introduce FirProperty.hasBackingField & use it in FIR2IR 2020-08-25 19:29:58 +03:00
Mikhail Glukhikh
c6417696cf FirProperty: return back 'isReferredViaField' attribute 2020-08-25 19:29:58 +03:00
Jinseong Jeon
3e9ac75cfc FIR: record use of backing field symbol to indeed add a backing field 2020-08-25 19:29:58 +03:00
Vyacheslav Gerasimov
0cc3762f9a Build: Fix kotlinx-metadata-klib publication 2020-08-25 17:18:00 +03:00
vldf
36f2f1fcf7 [FIR] Add lightTree support to extended checkers + minor refactorings 2020-08-25 17:08:57 +03:00
vldf
da702992d9 [FIR] Fix null source on destructuring declaration 2020-08-25 16:33:49 +03:00
Ilya Matveev
30d24ed943 Tests, Gradle: Fix broken test for KT-40834 2020-08-25 13:06:40 +00:00
Ilya Matveev
920f1184bd Revert "Revert "CocoaPods: Skip synthetic task on non-mac hosts""
This reverts commit 6040491373.
2020-08-25 13:06:39 +00:00
Nick
fd9bfe44f1 [FIR] Visit class annotations without the class's scope 2020-08-25 15:59:33 +03:00
vldf
3cad88a58c [FIR] Fir Helpers hotfix 2020-08-25 14:49:56 +03:00
vldF
cb627952b2 [FIR] Checkers performance improvement
[FIR] Checkers performance improvement
2020-08-25 14:20:30 +03:00
Ilya Goncharov
d86c81cb38 [JS, Gradle] Fix test on overflow, now throw exception on overflow 2020-08-25 13:44:20 +03:00
Arsen Nagdalian
8b4e8a2c0c Diagnostics: add diagnostic for reporting contract description blocks in old frontend 2020-08-25 12:58:39 +03:00
Arsen Nagdalian
80d7f6b688 Ignore the "contract" keyword in code completion 2020-08-25 12:58:39 +03:00
Arsen Nagdalian
ede1c08a9b [FIR] Add resolution of contracts that are written using the new syntax 2020-08-25 12:58:39 +03:00
Arsen Nagdalian
b8b60864fd [FIR] Add contracts tests and place them in a separate directory 2020-08-25 12:58:39 +03:00
Arsen Nagdalian
86e07cd626 Parser tests: move the contract description blocks tests to a separate folder and add a test for property accessors' contracts 2020-08-25 12:58:38 +03:00
Arsen Nagdalian
66f7250380 [FIR] Add contract description blocks support to "lightTree2FIR" conversion 2020-08-25 12:58:38 +03:00
Arsen Nagdalian
9fd104eec8 [FIR] Add contract description blocks support to RawFirBuilder 2020-08-25 12:58:38 +03:00
Arsen Nagdalian
d53f3b9ba8 [PSI] Add some useful getters to psi nodes 2020-08-25 12:58:37 +03:00
Arsen Nagdalian
a936c6331a [Parser] Add getters' and setters' contracts parsing 2020-08-25 12:58:37 +03:00
Arsen Nagdalian
6c06008b4d [FIR] Add a class representing the old syntax contract description in order to use the previous class for the new syntax 2020-08-25 12:58:37 +03:00
Arsen Nagdalian
b83aa88eff [FIR] Add function for getting ConeEffectDeclaration from FirEffectDeclaration and use it where needed 2020-08-25 12:58:35 +03:00
Arsen Nagdalian
991b18fec4 [FIR] Add a Fir node that wraps a ConeEffectDeclaration 2020-08-25 12:58:35 +03:00
Arsen Nagdalian
32a64b888e [Parser] Add parsing of function's contract either before or after type constraints 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
1b57889773 Clean the code 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
f781a9993b Parser tests: add tests for contract description blocks 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
2e9a898f45 [Parser] Move function's contracts parsing in before type constraints parsing 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
0990434840 [Parser] Modify parser so that it could parse contract description blocks of functions 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
e3fe9c3314 [PSI] Add new Psi nodes representing contract effects list and each individual contract effect in the list 2020-08-25 12:58:34 +03:00
Arsen Nagdalian
4b7d34b537 Add "contract" keyword 2020-08-25 12:58:34 +03:00
Dmitriy Novozhilov
316e0e6609 [FIR] Update testdata 2020-08-25 12:07:59 +03:00
Dmitriy Novozhilov
3ccb72bb1a Shadow :core:compiler.common inside kotlinx.metadata 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
811a2206a5 Fix usages of KotlinBuiltIns after rebase 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
bc1b6d3588 Rename :core:descriptors.common to :core:compiler.common 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
864cf21f03 Merge :core:type-system into :core:descriptors.common 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
5fa80a2f8c Merge :core:deserialization:deserialization.common into :core:descriptors.common 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
bbac270b33 Move OperatorNameConventions to :core.descriptors.common 2020-08-25 10:41:34 +03:00
Dmitriy Novozhilov
2760a187a9 Move FunctionClassKind utils to :core.descriptors.common 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov
2285d3e3cf Move Variance and AnnotationUseSiteTarget to :core.descriptors.common 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov
167f18b738 Move SourceElement and SourceFile to :deserialization.common
Remove dependency on `:core:descriptors` from `:core:deserialization:deserialization.common`
2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov
a764732020 Rename KotlinBuiltInsNames to StandardNames 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov
d032fdfc44 [FIR] Cleanup dependencies in :compiler:fir:raw-fir modules 2020-08-25 10:41:33 +03:00
Dmitriy Novozhilov
b6fd6c3a84 [FIR] Remove dependency on descriptors from :compiler:fir:raw-fir.raw-fir.common module 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
71a517c686 [FIR] Rename :compiler:fir:raw-fir:fir-common to :compiler:fir:raw-fir:raw-fir.common 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
7d4349edc2 [FIR] Remove dependency on descriptors from :compiler:fir:tree module 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
95346f834b [FIR] Fix forgotten dependency to contracts of FE 1.0 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
73ace6d161 Remove dependency to descriptors from :compiler:config module 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
82a9b1492b Move RenderingUtils to :core:descriptors.common module 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
ba6b1c37d0 Move TargetPlatform to :core:descriptors.common module 2020-08-25 10:41:32 +03:00
Dmitriy Novozhilov
d6d2be8e58 Move incremental components to :core:descriptors.common module 2020-08-25 10:41:31 +03:00
Dmitriy Novozhilov
3a48265077 Move ModuleDescriptor.Capability to :core:descriptors.common module 2020-08-25 10:31:37 +03:00
Dmitriy Novozhilov
6f0cd14afa Move common classes to new :core:deserialization:deserialization.common module 2020-08-25 10:31:37 +03:00
Dmitriy Novozhilov
079a2dfe1e Move EventOccurrencesRange class to :core:descriptors.common module 2020-08-25 10:31:37 +03:00
Dmitriy Novozhilov
f7f489537b [FIR] Remove dependency on :core:descriptors from :compiler:fir:tree 2020-08-25 10:31:37 +03:00
Dmitriy Novozhilov
e92caae609 [FIR] Remove dependency on :core:descriptors from :compiler:fir:cones 2020-08-25 10:31:36 +03:00
Dmitriy Novozhilov
45cf221b97 Move util functions from KotlinBuiltIns to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Dmitriy Novozhilov
20a2ad8223 Move FunctionClassDescriptor.Kind to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Dmitriy Novozhilov
7a7fe77b8e Move static constants with builtin names to :core:descriptors.common module 2020-08-25 10:31:36 +03:00
Dmitriy Novozhilov
2e92fe9be9 [FIR2IR] Add fir2ir component for converting fir visibility to FE 1.0 2020-08-25 10:31:36 +03:00
Dmitriy Novozhilov
a02109d857 [FIR] Add FirVisibilityChecker session component
This is needed because we have different visibility rules for different
  platform visibilities (e.g. protected and package private on JVM), so
  we need ability to configure visibility checks for different platforms
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov
18ae593700 [FIR] Rename new visibilities to CamelCase
It's more convenient since they are objects now instead of
  const fields in FE 1.0
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov
43821b681c [FIR] Introduce new Visibility class which not depends on descriptors 2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov
9d9f9c52c0 Extract some classes from descriptors module to :core:common
This is needed to remove dependencies from fir modules to
  `:core:descriptors` module

What was extracted:
- Modality
- ClassKind
- org.jetbrains.kotlin.name package
2020-08-25 10:31:35 +03:00
Dmitriy Novozhilov
41ba9b0a2d [FIR] Add flag to disable transformers required only for plugins 2020-08-25 10:31:34 +03:00
Mikhail Glukhikh
53ad502d2a [FIR2IR] Generate fake overrides earlier and bind them later
Before this commit, we generated fake overrides at last FIR2IR stage,
after having all functions and classes built. This could lead to a
situation when fake override was called before it was generated.
This commit fixes this situation.
2020-08-25 10:00:26 +03:00
Ilya Chernikov
ee9c597767 Build: Remove exclusion of kotlinx-coroutines-core in scripting-compiler
The previous fix was insufficient to fix gradle substitution in MPP
projects (https://github.com/gradle/gradle/issues/14017)
2020-08-24 19:13:16 +02:00
Nikolay Krasko
741f5de0f9 Clean PSI elements in KotlinExpressionMover
Fix report about leaked projects on build server:

via 'com.intellij.psi.impl.PsiManagerImpl.myProject'; Value: 'Project (name=light_temp, containerState=DISPOSE_COMPLETED, componentStore=/mnt/agent/temp/buildTmp/ideaProject_test_1285163057398451250/testRootGW1/unitTest_addPrimaryConstructorParameter/light_temp....' of class com.intellij.openapi.project.impl.ProjectImpl
      via 'com.intellij.psi.impl.source.PsiFileImpl.myManager'; Value: 'com.intellij.psi.impl.PsiManagerImpl@4ecdfe8' of class com.intellij.psi.impl.PsiManagerImpl
      via 'com.intellij.psi.impl.source.tree.CompositeElement.myWrapper'; Value: 'DummyHolder' of class com.intellij.psi.impl.source.JavaDummyHolder
      via 'com.intellij.psi.impl.source.tree.TreeElement.myParent'; Value: 'Element(DUMMY_HOLDER)' of class com.intellij.psi.impl.source.tree.FileElement
      via 'com.intellij.psi.impl.source.SubstrateRef$2.val$node'; Value: 'Element(VALUE_PARAMETER)' of class com.intellij.psi.impl.source.tree.CompositeElement
      via 'com.intellij.extapi.psi.StubBasedPsiElementBase.mySubstrateRef'; Value: 'com.intellij.psi.impl.source.SubstrateRef$2@5d02fa19' of class com.intellij.psi.impl.source.SubstrateRef$2
      via 'kotlin.Pair.first'; Value: 'VALUE_PARAMETER' of class org.jetbrains.kotlin.psi.KtParameter
      via 'org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover.parametersOrArgsToMove'; Value: '(VALUE_PARAMETER, VALUE_PARAMETER)' of class kotlin.Pair
      via '?'; Value: 'org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover@7a6f128e' of class org.jetbrains.kotlin.idea.codeInsight.upDownMover.KotlinExpressionMover
      via 'com.intellij.openapi.extensions.impl.ExtensionPointImpl.myExtensionsCacheAsArray'; Value: '[Lcom.intellij.codeInsight.editorActions.moveUpDown.StatementUpDownMover;@276493b6' of class [Lcom.intellij.codeInsight.editorActions.moveUpDown.StatementUpDownMover;
      via 'java.util.concurrent.ConcurrentHashMap$Node.val'; Value: 'com.intellij.statementUpDownMover' of class com.intellij.openapi.extensions.impl.InterfaceExtensionPoint
      via '?'; Value: 'com.intellij.statementUpDownMover=com.intellij.statementUpDownMover' of class java.util.concurrent.ConcurrentHashMap$Node
      via 'java.util.concurrent.ConcurrentHashMap.table'; Value: '[Ljava.util.concurrent.ConcurrentHashMap$Node;@724e0cae' of class [Ljava.util.concurrent.ConcurrentHashMap$Node;
      via 'com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.extensionPoints'; Value: '{com.intellij.embeddedTokenHighlighter=com.intellij.embeddedTokenHighlighter, org.intellij.groovy.expectedTypesContributor=org.intellij.groovy.expectedTypesContributor, org.jetbrains.kotlin.resolveSco...' of class java.util.concurrent.ConcurrentHashMap
      via 'com.intellij.serviceContainer.ComponentManagerImpl.extensionArea'; Value: 'Application (containerState=ACTIVE)  (Unit test) (Internal) (Headless) (Command line)' of class com.intellij.openapi.extensions.impl.ExtensionsAreaImpl
      via '?'; Value: 'Application (containerState=ACTIVE)  (Unit test) (Internal) (Headless) (Command line)' of class com.intellij.openapi.application.impl.ApplicationImpl
       (from ApplicationManager.getApplication())
2020-08-24 19:03:03 +03:00
Nikolay Krasko
18195b3296 Rewrite SmartCompletionMultifileHandlerTest to KotlinFixtureCompletionBaseTestCase
Use light projects as an attempt to fight leaking project errors
2020-08-24 19:03:03 +03:00
Nikolay Krasko
e95c3e2905 Rewrite CompletionMultiFileHandlerTest to KotlinFixtureCompletionBaseTestCase
Use light projects as an attempt to fight leaking project errors
2020-08-24 19:03:03 +03:00
Ilya Goncharov
f92083989a [JS, Wizard] Fix build integrity 2020-08-24 19:01:38 +03:00
Nikolay Krasko
6040491373 Revert "CocoaPods: Skip synthetic task on non-mac hosts"
This reverts commit ce029822
2020-08-24 18:31:32 +03:00
Ilya Goncharov
621c87ee84 Overflowed teamcity messages should failed build
^KT-41133 fixed
2020-08-24 18:22:22 +03:00
Nick
e7b12b9bb1 [FIR] Fix false positive SUPER_NOT_AVAILABLE 2020-08-24 17:23:32 +03:00
Dmitry Petrov
a2dabe11c5 JVM KT-41150: Fix backward compatibility for inline vals in inline class
In 1.3.x, for inline class member inline vals 'getFoo-impl' method was
generated in corresponding inline class.
Since 1.4.0, getters for properties returning inline class values are
mangled (so corresponding getters are named 'getFoo-<mangling_hash>'.
However, to maintain backward compatibility with libraries compiled with
1.3.x, inliner should be able to find 'getFoo-impl' method in the
bytecode.
2020-08-24 16:17:12 +03:00
Vladimir Ilmov
27a22fc1e9 Cleanup Coroutine panel in case connection gets disposed soon after
creation.
2020-08-24 15:09:14 +02:00
Vladimir Ilmov
cb2ab4676b (CoroutineDebugger) Top node added to prevent dumpCoroutine() call
Panel gather information from the agent on each breakpoint hit.
2020-08-24 15:09:13 +02:00
Alexander Udalov
fa45650fd0 JVM IR: specialize ExpressionCodegen.visitFunctionAccess for constructors
This makes the code a bit clearer, and gets rid of some extra type
mapper invocations when generating constructor calls.
2020-08-24 14:51:52 +02:00
Ilya Kirillov
f9bd935ac6 Wizard: fix missing module templates 2020-08-24 15:48:02 +03:00
Kirill Shmakov
5a91dd0439 Update main wizard tests 2020-08-24 15:43:08 +03:00
Kirill Shmakov
147a8c357d Wizard: switch androidx.core -> android.material 2020-08-24 15:43:08 +03:00
Kirill Shmakov
57e9e9a2a1 Wizard: add android.useAndroidX property 2020-08-24 15:43:07 +03:00
Kirill Shmakov
9e88d61be4 Wizard: switch android:allowBackup
Otherwise template could leak sensitive data.
2020-08-24 15:43:06 +03:00
Kirill Shmakov
94ae839d2c Wizard: update Android Appcompat version 2020-08-24 15:43:03 +03:00
Kirill Shmakov
06f9a4e228 Wizard: update Android Gradle plugin version 2020-08-24 15:43:02 +03:00
Roman Artemev
a095909d5c [Plugin API] Provide special context in EP for link-time resolve
- requires to customize declarations from synthetic declarations
2020-08-24 15:37:39 +03:00
Steven Schäfer
ea98062241 JVM IR: Fix compilation of inline functions in anonymous objects...
...in class members. The corresponding classes end up nested in the
class initializer of the surrounding class and we need to take this into
account when creating instances of ClassCodegen.

This fixes KT-40332 on the JVM IR backend.
2020-08-24 14:10:36 +02:00
Ilya Matveev
ce02982226 CocoaPods: Skip synthetic task on non-mac hosts
This patch performs the following changes:

1. Create synthetic tasks even if synthetic projects are
not supported on the current host. This change simplifies
configuring dependencies between these tasks and custom user
tasks at the user side.

2. Disable synthetic tasks if synthetic projects are not supported
on the current host

Issue #KT-40834 Fixed
2020-08-24 12:04:50 +00:00
Alexander Udalov
b10cc6657e Fix loading of builtins resources in kotlin-reflect in Java modular mode
The main change here is that when kotlin-reflect is being run under Java
9+, we use another implementation of BuiltInsResourceLoader (see
libraries/reflect/api/src/java9) which loads .kotlin_builtins files from
the java.lang.Module instance of kotlin-stdlib, instead of the class
loader of kotlin-reflect, which may not have access to those resources.

If the application is being run in the old (classpath) mode, that Module
represents the unnamed module, which contains everything on the
classpath, and everything works as before. But if it's being run in the
modular mode, that Module instance is an encapsulated module for
kotlin-stdlib classes and resources, exactly where .kotlin_builtins
files are located.

This fixes a regression in 1.4.0. Prior to 1.4, kotlin-reflect and
kotlin-stdlib were not named modules (see KT-21266) and were loaded as
_automatic_ modules even if the application was run in the modular mode.
Apparently, they shared the same class loader in that case and looking
up .kotlin_builtins resources worked.

This change was supposed to go alongside
828cc6dbf3, but was overlooked because
adding module-info to standard libraries was postponed at that point.

Also slightly refactor Java9ModulesIntegrationTest to simplify running
compiled code, and add a smoke test on using kotlin-reflect in modular
mode.

 #KT-40842 Fixed
2020-08-24 13:30:00 +02:00
Alexander Udalov
201fa849b8 Workaround problem with log4j warnings in CLI tests
#KTI-166
2020-08-24 13:30:00 +02:00
Nick
05cfb654ba [FIR] Fix removeAtInt test 2020-08-24 13:38:43 +03:00
Nikolay Krasko
2b983b1c20 Mute flaky JavaAgainstKotlinBinariesCheckerTestGenerated.testEnumStaticImportInJava 2020-08-24 13:20:31 +03:00
Ilya Goncharov
2d8643b6ef [Gradle, JS] Add nowarn flag for kotlin2js
^KT-41340 fixed
2020-08-24 13:05:22 +03:00
Nick
aeae898b94 [FIR] Fix issues with properties' fake sources 2020-08-24 11:06:45 +03:00
Nick
61e21dadec [FIR] Add 3 type mismatch diagnostics 2020-08-24 11:06:12 +03:00
Nick
c8f8908a01 [FIR] Add NO_THIS & INSTANCE_ACCESS_BEFORE_SUPER_CALL 2020-08-24 11:06:10 +03:00
Nick
7e1c2cfd36 [FIR] Add diagnostic INAPPLICABLE_LATEINIT_MODIFIER + some builtin types 2020-08-24 11:06:06 +03:00
Nick
091e12c093 [FIR] Add diagnostic CONFLICTING_PROJECTION 2020-08-24 11:06:04 +03:00
Dmitriy Dolovov
d40bca4143 [Commonizer] Short-circuiting of type aliases
^KT-41220
2020-08-24 12:21:12 +07:00
Vyacheslav Gerasimov
8a84af8a6f Build: Fix idea-gradle test task dependency on dist 2020-08-22 14:11:34 +03:00
Mark Punzalan
a9359eb530 RangeContainsLowering: Handle unsigned ranges. 2020-08-21 21:15:27 +02:00
Mark Punzalan
ceba9f231d RangeContainsLowering: Fix bug in additional condition order for
`until` ranges.
2020-08-21 21:15:27 +02:00
Mark Punzalan
60a2f7d03f RangeContainsLowering: Handle Comparable ranges. 2020-08-21 21:15:27 +02:00
Mark Punzalan
1c1b1b4b0f Initial version of RangeContainsLowering, which optimizes calls to
contains() on ClosedRanges.
2020-08-21 21:15:27 +02:00
Jinseong Jeon
ca541337d1 FIR: skip return insertion for lambda w/ Unit return type 2020-08-21 19:16:43 +03:00
Alexander Udalov
f1ce668ede IR: minor, don't store unnecessary fields 2020-08-21 17:52:10 +02:00
Alexander Udalov
26eb51a9f9 Minor, fix generateBuiltins test 2020-08-21 17:51:23 +02:00
Nikolay Krasko
d170f46bfc Mute flaky fun usages tests 2020-08-21 18:28:21 +03:00
Nikolay Krasko
6293842d81 Mute XCoroutinesStackTraceTestGenerated flaky test 2020-08-21 18:28:21 +03:00
Nikolay Krasko
9d300f56cc Mark SubpluginsIT.testKotlinVersionDowngradeInSupbrojectKt39809 as flaky 2020-08-21 18:28:21 +03:00
Nikolay Krasko
8f785f6bb2 Mute flaky tests in ContinuationStackTraceTestGenerated 2020-08-21 18:28:21 +03:00
Nikolay Krasko
fd036c2658 Mute flaky tests in JavaAgainstKotlinBinariesCheckerTestGenerated 2020-08-21 18:28:21 +03:00
Roman Artemev
fcca2c6fa3 [JS IR] fix failing test 2020-08-21 17:44:07 +03:00
pyos
5722f889d8 FIR2IR: scan the entire interface tree for delegatable members 2020-08-21 16:50:23 +03:00
Mikhail Glukhikh
99d2fd7c4d [FIR] Handle open in interface correctly during status resolve 2020-08-21 16:50:23 +03:00
Mikhail Glukhikh
8e2c5bf4fe [FIR] Fix exposed visibility checking for enum entries 2020-08-21 16:50:22 +03:00
Mikhail Glukhikh
e15e87fded [FIR] Expand aliased type before checking for exposure 2020-08-21 16:50:22 +03:00
Denis Zharkov
cb6fbc329a FIR: Simplify FirQualifiedAccess hiearchy
Mostly, it's getting rid of FirQualifiedAccessWithoutCallee and FirModifiableQualifiedAccess
The latter was only used during FIR building to set explicit receiver
that might be done by replace call on explicit receiver

The problem with replaceExplicitReceiver is that for FirComponentCall
explicitReceiver should be not null, so it's needed to perform those tricks
at the generatot
2020-08-21 16:34:46 +03:00
Dmitriy Novozhilov
e6837a5b8c [FIR] Unify implementations of toSymbol and getSymbolByLookupTag 2020-08-21 15:28:34 +03:00
Dmitriy Novozhilov
d1f6e45b08 [FIR] Cleanup signature of getNestedClassifierScope 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov
ffdc68b68d [FIR] Get rid of AbstractFirSymbolProviderWithCache 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov
111b8c0169 [FIR] Cleanup caching symbol in ConeClassLikeLookupTagImpl
Type of `boundSymbol` replaced to OneElementWeakMap
`FirSymbolProvider.getSymbolByLookupTag` moved to extensions
2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov
9032234e1d [FIR] Get rid of FirSymbolProvider.getNestedClassifierScope 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov
77f52a9ddb [FIR] Add special inline class for caches which are used in symbol providers 2020-08-21 15:27:55 +03:00
Dmitriy Novozhilov
4b6193159c [FIR] Get rid of JavaSymbolProvider.getJavaTopLevelClasses 2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
d7cfb2fb13 [FIR] Get rid of FirSymbolProvider.getClassNamesInPackage
There was one non-removable usage of those function in FirJavaElementFinder
  and three non-trivial implementation
- `FirProvider.SymbolProvider`
- `KotlinDeserializedJvmSymbolsProvider`
- `FirBuiltinSymbolProvider`

First implementation was moved to `FirProvider` and other two was
  deleted, because in FirJavaElementFinder we need lookup only in
  classes from source code, so such methods in library providers are
  useless

#KT-41048
2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
b31f80aee3 [FIR] Get rid of FirSymbolProvider.getAllCallableNamesInPackage
#KT-41048
2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
f32a0fe7ad [FIR-TEST] Unify AbstractFirLoadCompiledKotlin and BuiltInsDeserializationForFirTestCase 2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
913ea9b56d [FIR-TEST] Get rid of deprecated methods usage in AbstractFirLoadCompiledKotlin
Now complied declaration names are collected via ModuleDescriptor,
  so tests pass more correctly. Before this change tests didn't render
  compiled typealiases and properties.
Also some testdata was changed because of new order of declaration
2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
41aa90ad71 [FIR-TEST] Add flag to take memory dumps in modularized test 2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
cb0b25ea39 [FIR] Replace Deprecated with PrivateForInline in ScopeSession 2020-08-21 15:27:54 +03:00
Dmitriy Novozhilov
b4dc7955b4 [FIR] Avoid collections copying in FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov
ce36ae64a1 [FIR] Deprecate questionable methods of FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov
d5bb87cd1f [FIR] Replace inheritance with delegation for FirProvider and FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov
ad9e41b828 [FIR] Mark JavaSymbolProvider.getJavaTopLevelClasses as @TestOnly 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov
1d26ce4a4e [FIR] Get rid of useless methods in FirSymbolProvider 2020-08-21 15:27:53 +03:00
Dmitriy Novozhilov
f0d05a321d [FIR-IDE] Use symbolProvider instead of firProvider in KtFirPackageScope 2020-08-21 15:27:53 +03:00
vldf
0d6b363179 [FIR] Refactoring for extended checkers 2020-08-21 15:09:05 +03:00
vldf
e2016499f3 [FIR] Fixed CFA bug 2020-08-21 15:08:37 +03:00
vldf
ac07438489 [FIR] Speed up CFA-checkers 2020-08-21 15:08:37 +03:00
vldf
638a0d3b82 [FIR] Checkers performance improvement and some refactoring 2020-08-21 15:08:36 +03:00
Kirill Shmakov
5a45cc7290 Update wizard tests 2020-08-21 13:06:56 +03:00
Denis Zharkov
cee72023fa Remove TypeSystemContext::mayBeTypeVariable optimization
It doesn't work now since anyway it's required to obtain type
constructor
At the same time, now it's not very expensive to obtain the constructor
since it's just a lookup tag
2020-08-21 12:50:33 +03:00
Denis Zharkov
9ac5dd2bce FIR: Use lookup tags for as type constructors instead of symbols
It may help to avoid redundant symbols lookups
2020-08-21 12:50:33 +03:00
Vladimir Ilmov
34b55dbeb3 (CoroutineDebugger) Disable agent for MPP projects
#KT-39412 fixed
2020-08-21 10:35:39 +02:00
Vladimir Dolzhenko
1e96088cc6 Check unique symbols in Goto*Tests 2020-08-21 10:04:36 +02:00
Dmitry Gridin
5f584691a6 [inspections] disable "Redundant inner modifier" inspection
^KT-41264 Fixed
2020-08-21 09:28:37 +07:00
Vladimir Dolzhenko
ec253862c6 Check unique symbols in Goto*Tests 2020-08-20 23:50:26 +02:00
Kirill Shmakov
62be688eb7 Wizard: add missing test dependency 2020-08-20 22:33:14 +03:00
Roman Artemev
e7f22bcfbc [JS IR] Add test for cross module export 2020-08-20 22:16:20 +03:00
Anton Bannykh
136d86e552 [JS IR] Fix cross-module import/export in case per-module splitting 2020-08-20 22:13:39 +03:00
Roman Artemev
8d61e9ba21 [KLIB] Load @JsExport annotated declarations explicitly 2020-08-20 22:13:39 +03:00
Roman Artemev
1a0e3a1d83 [KLIB] Refactor file serializer a bit
- Support explicitly exported on files and properties
2020-08-20 22:13:38 +03:00
Alexander Udalov
12e900ef3c Minor, do not capitalize words in generated Gradle options docs
To make this output correspond to the actual table at
https://github.com/JetBrains/kotlin-web-site/blob/master/pages/docs/reference/using-gradle.md
2020-08-20 20:30:55 +02:00
Alexander Udalov
0ef4b22cf3 Remove deprecated usages of ContainerUtil 2020-08-20 20:30:34 +02:00
Alexander Udalov
2428c180c2 Suppress warning on usage of old MPP in kotlin-stdlib 2020-08-20 20:30:34 +02:00
Alexander Udalov
da6d904c6e Suppress code warnings in kotlin-stdlib 2020-08-20 20:30:34 +02:00
Nikolay Krasko
5ef4f7df5a Mute more tests 2020-08-20 16:06:11 +03:00
Nikolay Krasko
44a95a4105 Stop running failed AndroidRunner tests 2020-08-20 16:06:11 +03:00
Nikolay Krasko
7f91ed6997 Support mute tests in kotlin-gradle-plugin-integration-tests (KTI-234)
#KTI-234 Fixed
2020-08-20 16:06:11 +03:00
Mikhail Glukhikh
07bddbe4d0 [FIR CLI] Don't run generation if some errors are found 2020-08-20 16:04:07 +03:00
Mikhail Glukhikh
85c1505689 [FIR2IR] Copy type parameters for trivial fake overrides 2020-08-20 16:04:02 +03:00
Alexander Udalov
bf0bb9e946 JVM IR: remove obsolete code for duplicate signature diagnostics 2020-08-20 14:58:36 +02:00
Alexander Udalov
425b192a5f Fix warnings in build-common/daemon code 2020-08-20 14:58:11 +02:00
Alexander Udalov
1d15a5547d Suppress deprecation warnings related to scripting 2020-08-20 14:58:11 +02:00
Alexander Udalov
549ee84687 Fix some compiler warnings in FIR modules 2020-08-20 14:57:54 +02:00
Mikhail Zarechenskiy
ced151f3af Add test for KT-41254
It was fixed along with #KT-41005
2020-08-20 15:45:32 +03:00
Mads Ager
a6f301e84a [JVM_IR] Rebase constructor stepping tests that are working as intended.
JVM_IR has consistent stepping behavior for secondary constructors
and init blocks. This change fixes the expectations for tests that
expect the less consistent JVM backend behavior.
2020-08-20 13:12:22 +02:00
Mads Ager
2c6b5c8847 [JVM_IR] Give temporary variable loads meaningful offsets.
Temporary variable loads in when expressions had the offsets
of the variable declaration. That leads to hacks during codegen
for line number generation.

Instead of those hacks, give the variable loads the offsets of
the context in which they occur. That avoids the codegen hacks
and fixes stepping behavior for more when expressions.
2020-08-20 13:12:22 +02:00
Sergey Igushkin
413d02621b Add a link to docs in MPP stability warning; add a flag that hides it 2020-08-20 10:44:59 +00:00
Mikhail Glukhikh
02e5f140f4 Fir2IrLazyProperty: generate overridden symbols via FirTypeScope 2020-08-20 11:47:35 +03:00
Mikhail Glukhikh
25efad2fd7 [FIR2IR] Extract generateOverriddenAccessorSymbols 2020-08-20 11:47:35 +03:00
Roman Golyshev
539d2bc01f FIR Completion: Fix completion with error type as receiver
- When type is error, the completion should not show anything; instead,
it was showing as if the explicit receiver was not there
2020-08-20 11:33:23 +03:00
Roman Golyshev
bca9754a7b FIR Completion: Move completion from available scopes to separate class 2020-08-20 11:33:23 +03:00
Denis Zharkov
7f3f0faa1a FIR: Rework overridden members processing in FirTypeScope
Now, FirTypeScope returns only direct overridden and a base scope
where a client might look for deeper overridden

It's necessary to make the API fast and simple
when only direct overridden are needed

At the same time, while this API looks a bit complicated for most of the clients
there are simple extension helpers that obtain just the direct or all overridden
2020-08-20 11:18:59 +03:00
Toshiaki Kameyama
8ce9b2d061 KT-34572 Convert to block body action improperly works with suppress annotations (#2969)
* Convert to block body: place @Suppress annotation before return expression

#KT-34572 Fixed

* Convert to block body: place annotations before return expression
2020-08-20 11:15:00 +03:00
Ilya Kirillov
9e0bb4ce8e FIR: save resolvePhase of declaration when creating it fake override copy 2020-08-20 11:07:09 +03:00
Ilya Kirillov
b1d3ab04c2 FIR [IDE]: provide correct node phase when necessary 2020-08-20 09:48:33 +03:00
Mads Ager
119302b016 [JVM_IR] Run KotlinSteppingTests with the JVM_IR backend.
Implement support for supressing failures by backend.
2020-08-20 05:48:54 +02:00
Nikolay Krasko
01f7da66c6 Mute ProjectTemplateNewWizardProjectImportTestGenerated.**.testMultiplatformApplication 2020-08-19 23:35:23 +03:00
Nikolay Krasko
9d18279ec9 Mute ReferenceResolveTestGenerated.DelegatedPropertyAccessors.InStandardLibrary.testNotNull 2020-08-19 23:01:09 +03:00
Nikolay Krasko
d87d42348b Mute flaky GotoWithMultipleLibrariesTest
Tests are flaky after e2a12602a3
2020-08-19 23:01:09 +03:00
Nikolay Krasko
179bd1cc3d Mute KotlinUastTypesTest.testEa101715 2020-08-19 23:01:09 +03:00
Nikolay Krasko
950b139804 Mute CreateFunction.Invoke.testLambdaArgument 2020-08-19 23:01:09 +03:00
Nikolay Krasko
496ede7587 Mute KotlinUastTypesTest.testEa101715 2020-08-19 23:01:08 +03:00
Nikolay Krasko
4135240cc0 Mute testFunctionBreakpointInStdlib in AS41 2020-08-19 23:01:08 +03:00
Nikolay Krasko
7982283007 Copy mutes for AS41 from 201 2020-08-19 23:01:08 +03:00
Nikolay Krasko
a3c8427cb2 Mute GradleScriptListenerTest tests 2020-08-19 23:01:08 +03:00
Nikolay Krasko
7de5368b4d Fix AbstractGradleBuildRootsLocatorTest tests 2020-08-19 23:01:08 +03:00
Nikolay Krasko
0b2fcd2c4d Remove mutes for navigation tests 2020-08-19 23:01:08 +03:00
Yunir Salimzyanov
ebe0489a74 Fix joined lines in .bunch 2020-08-19 19:51:51 +03:00
Yunir Salimzyanov
70cda1b113 Refactor and fix files previously affected by 192 patchset (KTI-315) 2020-08-19 19:40:02 +03:00
Yunir Salimzyanov
42da9e62db Cleanup 192 patchset files (KTI-315) 2020-08-19 19:40:02 +03:00
Yunir Salimzyanov
73aa21aab6 Refactor and fix files previously affected by as36 patchset (KTI-315) 2020-08-19 19:40:00 +03:00
Yunir Salimzyanov
27b2e16141 Cleanup as36 patchset files (KTI-315) 2020-08-19 19:40:00 +03:00
Ilya Chernikov
0a9089bc72 Set correct base classloader for REPL evaluation
the contributed partial fix of KT-35925 set it to the system classloader
which brought in many cases the compiler CP into the evaluation and lead
to the problems like KT-40898. This fix set it to the extension/platform
classloader, which preserves (partial) fix of the KT-35925 and do not
bring the compiler jar into the REPL evaluation classpath.

#KT-40898 fixed
2020-08-19 15:17:07 +02:00
Ilya Chernikov
f713e8ad36 Set context classloader before REPL evaluation
#KT-35925 fixed
2020-08-19 15:17:06 +02:00
Vladimir Dolzhenko
d0366d3bcb Failed test clean up
Relates to ^KT-40960
2020-08-19 15:06:53 +02:00
alexjuca
4794297640 used string template instead of concatenation 2020-08-19 13:58:58 +02:00
Kirill Shmakov
f88e492d11 Support hmpp in template
Explained in KMM-332
2020-08-19 14:46:49 +03:00
Toshiaki Kameyama
11044a3ab5 Surround with null check: fix incorrect check for 'in' expression
#KT-31749 Fixed
2020-08-19 14:37:24 +03:00
Toshiaki Kameyama
1188f4617a Change file's package to match directory: add space after package keyword if needed
#KT-39604 Fixed
2020-08-19 14:04:18 +03:00
Kirill Shmakov
1ce39222e3 Build KMM plugin for AS 4.2 2020-08-19 13:02:39 +03:00
Mikhail Zarechenskiy
6ed13ef1b6 Fix unresolved reference to catch parameter from lambda expression
#KT-41140 Fixed
2020-08-19 12:52:16 +03:00
Mikhail Zarechenskiy
f2fba8a469 Fix delegated property resolve when provideDelegate has this as argument
#KT-41135 Fixed
2020-08-19 12:52:16 +03:00
Toshiaki Kameyama
f3be3f449a Scope function conversion: do not suggest when invoked without receiver
#KT-35525 Fixed
2020-08-19 12:27:41 +03:00
Toshiaki Kameyama
8ba5548a0f "Eliminate argument of 'when'": do not suggest if 'when' is used as expression and it has no 'else' branch (#2898)
#KT-35526 Fixed
2020-08-19 12:24:58 +03:00
Toshiaki Kameyama
d965ad0a98 IfThenToSafeAccessInspection: do not report if condition is SENSELESS_COMPARISON/USELESS_IS_CHECK (#3007)
#KT-36051 Fixed
2020-08-19 12:22:10 +03:00
Toshiaki Kameyama
122bba9102 UnnecessaryVariableInspection: don't report for overriding property
#KT-39263 Fixed
2020-08-19 12:16:37 +03:00
Igor Yakovlev
c29dbee65e Cover move method refactoring with registry key (disabled by default) 2020-08-19 12:11:53 +03:00
aleksandrina-streltsova
ed67517fb9 Move: make minor refactorings and add GUI form for MoveKotlinMethodDialog 2020-08-19 12:11:53 +03:00
aleksandrina-streltsova
5515465760 Move: Support method moving 2020-08-19 12:11:53 +03:00
Alex Chmyr
a5368e443c KT-20421 fixing code generation for the case when "object" extends "class". It should look like: "object: class()". 2020-08-19 11:46:29 +03:00
Anton Yalyshev
26ca205f7e Fix a broken hyperlink to Whatsnew at the plugin change-notes 2020-08-19 11:41:13 +03:00
Ilya Kirillov
ccf285a284 FIR IDE: do not recreate analysis session for tests now 2020-08-19 11:35:42 +03:00
Ilya Kirillov
c191373a6b FIR IDE: always pass ValidityToken to KtAnalysisSessionComponent 2020-08-19 11:35:41 +03:00
Ilya Kirillov
2290d2fcc0 FIR IDE: make FirScopeRegistry belong to a KtFirScopeProvider 2020-08-19 11:35:40 +03:00
Roman Golyshev
7d58588f06 FIR IDE: Fix KtFirPropertySymbol::receiverType 2020-08-19 11:23:56 +03:00
Dmitry Petrov
8f0aecce58 JVM_IR: KT-40330 Unify field names for captured 'this' with JVM
NB some cases such as captured extension receiver for an extension
lambda are not supported yet; to be discussed, to what extent should we
actually follow JVM code shape here.
2020-08-19 11:07:41 +03:00
Dmitriy Dolovov
24bfc155af IDE perf tests for K/N: Use Gradle 6.6 2020-08-19 12:45:16 +07:00
Dmitriy Dolovov
6a95317f73 IDE perf tests for K/N: Switch to 1.4.0 2020-08-19 12:45:09 +07:00
Mikhail Glukhikh
f7cb165fb9 Introduce Fir2IrBuiltIns & move extension function type inside 2020-08-18 21:54:05 +03:00
Simon Ogorodnik
97b10b5ab3 [FIR2IR] Hack-in setting of extension function type annotation 2020-08-18 21:53:55 +03:00
Mikhail Glukhikh
b1c36feef4 Minor: regenerate FIR diagnostic tests 2020-08-18 21:53:35 +03:00
Jinseong Jeon
7e22de1e24 FIR2IR: insert coerce-to-unit expressions in statement containers 2020-08-18 21:53:08 +03:00
pyos
1b3ab53e16 FIR2IR: set superQualifierSymbol for setters too 2020-08-18 21:53:08 +03:00
Jinseong Jeon
e9659d9c8a FIR2IR: make the scope of body of do-while loop transparent 2020-08-18 21:53:07 +03:00
Jinseong Jeon
1b6c4329d2 FIR2IR: handle unbound reference with adapted arguments 2020-08-18 21:53:07 +03:00
vldf
a26eeb6ee8 [FIR] Add CLI flag for running extended checkers 2020-08-18 21:53:07 +03:00
vldf
2bf1d3fee8 [FIR] Add messages for extended checkers' warnings 2020-08-18 21:53:06 +03:00
Ilya Kirillov
08e2dd3dea NJ2K: fix implicit type cast in binary expressions
#KT-37298 fixed
2020-08-18 17:38:07 +03:00
Ilya Kirillov
d5d57f84e0 NJ2K: preserve annotations while converting class to object
#KT-38879 fixed
2020-08-18 17:38:07 +03:00
Ilya Kirillov
3d517c3656 NJ2K: fix retrieving resolutionFacade on empty context elements list 2020-08-18 17:38:07 +03:00
Ilya Kirillov
de0c216cfa NJ2K: fix NPE in JavaObjectEqualsToEqOperatorProcessing 2020-08-18 17:38:06 +03:00
Simon Ogorodnik
38477be484 [FIR] Make test fail if profiling requested, but misconfigured 2020-08-18 16:21:48 +03:00
Simon Ogorodnik
15d4333e81 [FIR] Add per-pass profiling support to modularized test 2020-08-18 16:21:48 +03:00
Simon Ogorodnik
83ded9badf [FIR] Add pass argument to beforePass of modularized test 2020-08-18 16:21:48 +03:00
Roman Artemev
716c3668d6 [IR] Properly resolve type parameters in case of property accessor
- fix KT-41006
2020-08-18 11:48:06 +03:00
Alexander Udalov
a810dbb41b IR: fix compiler warnings 2020-08-18 10:33:25 +02:00
Vladimir Dolzhenko
be53467bee Flaky and muted navigation tests clean up
Relates to #KT-40960
2020-08-18 08:23:02 +00:00
Vladimir Dolzhenko
e2a12602a3 Fixed getPsiMethodWrappers for KtLightMethodForDecompiledDeclaration
#KT-40960 Fixed
2020-08-18 08:23:01 +00:00
Vladimir Dolzhenko
ee0250bd35 Reformat file
Relates to #KT-40960
2020-08-18 08:23:00 +00:00
Vladimir Dolzhenko
5c7054a5ab Fixed src path for mock library
Relates to #KT-40960
2020-08-18 08:23:00 +00:00
Natalia Selezneva
7b80be5c9d Temporary workaround for gradle issue: wrong navigation for included plugin source code
https://github.com/gradle/gradle/issues/13783
^KT-39522
2020-08-17 23:12:51 +03:00
Alexander Udalov
7dd687cf00 IR: minor, use lazy instead of lazyVar for readonly value 2020-08-17 21:19:53 +02:00
Alexander Udalov
a21f273570 Fix compiler warnings in compiler code 2020-08-17 21:18:20 +02:00
Alexander Udalov
9b94e073af Fix warnings related to OptIn/UseExperimental 2020-08-17 21:18:19 +02:00
Alexander Udalov
256f4449ce IR: annotate obsolete API in IrPluginContext with ObsoleteDescriptorBasedAPI 2020-08-17 21:18:19 +02:00
Alexander Udalov
9961bd1fe1 IR: remove unneeded casts after making IrCall's symbol a simple function 2020-08-17 21:18:17 +02:00
Alexander Udalov
3bdbfc1e73 Output total codegen statistics after IR translation/generation 2020-08-17 19:29:58 +02:00
Alexander Udalov
c3cbcf6d7f Slightly improve performance measurements rendering
Report the input module name and size once before any measurements
instead of duplicating it in all of them. Also, render measurements in a
table to improve readability.

Before:

info: PERF: INIT: Compiler initialized in 467 ms
info: PERF: ANALYZE: 1 files (2 lines) target main-java-production in 277 ms - 7.220 loc/s
info: PERF: IR: Translation 1 files (2 lines) target main-java-production in 291 ms - 6.873 loc/s
info: PERF: GENERATE: 1 files (2 lines) target main-java-production in 513 ms - 3.899 loc/s
info: PERF: IR: Generation 1 files (2 lines) target main-java-production in 142 ms - 14.085 loc/s

After:

info: PERF: main-java-production, 1 files (2 lines)
info: PERF: INIT: Compiler initialized in 421 ms
info: PERF:         ANALYZE     342 ms       5.848 loc/s
info: PERF:  IR TRANSLATION     296 ms       6.757 loc/s
info: PERF:        GENERATE     453 ms       4.415 loc/s
info: PERF:   IR GENERATION     137 ms      14.599 loc/s
2020-08-17 19:29:57 +02:00
Simon Ogorodnik
0045b501d5 FIR IDE: Fix memory leak in thread locals 2020-08-17 20:05:52 +03:00
Ilya Kirillov
76b078b561 FIR IDE: resolve KtFirLocalVariableSymbol only to IMPLICIT_TYPES_BODY_RESOLVE 2020-08-17 20:05:52 +03:00
Ilya Kirillov
b8920114f8 FIR: set resolvePhase to BODY_RESOLVE in deserialized Kotlin declarations 2020-08-17 20:05:52 +03:00
Simon Ogorodnik
c7d6a79c25 FIR IDE: Fix completion in case of function with parameters 2020-08-17 20:05:52 +03:00
Nikolay Krasko
863de52f7a Minor: better name for file walking with excludes 2020-08-17 20:02:47 +03:00
Nikolay Krasko
c30910130e Remove minor optimization in CodeConformanceTest 2020-08-17 20:02:46 +03:00
Nikolay Krasko
01f3bdfc69 Exclude kotlin-ultimate/ide/common-cidr-native from author check 2020-08-17 20:02:46 +03:00
Nikolay Krasko
31ed803ada More excludes 2020-08-17 19:40:49 +03:00
Nikolay Krasko
713dbc225e Other repositories monitoring 2020-08-17 19:40:48 +03:00
Nikolay Krasko
fad15b6627 Rewrite testThirdPartyCopyrights test 2020-08-17 19:40:48 +03:00
Nikolay Krasko
bb0ea56d63 Extract traversing through directories to the common code 2020-08-17 19:40:48 +03:00
Nikolay Krasko
8db588c7f0 Optimize testNoBadSubstringsInProjectCode test
Don't visit ignored directories
2020-08-17 19:40:48 +03:00
Nikolay Krasko
2655d9dab3 Optimize testForgottenBunchDirectivesAndFiles test
Don't step through the ignored directories.
2020-08-17 19:40:48 +03:00
Nikolay Krasko
3eb89d6dfd Use own allow list for each repository 2020-08-17 19:40:48 +03:00
Nikolay Krasko
8445c8f4a5 Update copyright conformance excludes 2020-08-17 19:40:47 +03:00
Nikolay Krasko
04a1e572a8 Monitor new usages of kotlin-eap repository 2020-08-17 19:40:47 +03:00
Nikolay Krasko
d2bf5587d6 Monitor new usages of kotlin-dev repository 2020-08-17 19:40:47 +03:00
Nikolay Krasko
50d85b92da Remove more kotlin-dev usages 2020-08-17 19:40:47 +03:00
Nikolay Krasko
be2badc6ed Remove kotlin-dev from gradle migrate test 2020-08-17 19:40:47 +03:00
Nikolay Krasko
0c27e87eb9 Remove kotlin-dev from gradle configurator tests 2020-08-17 19:40:46 +03:00
Dmitriy Dolovov
3dc3c19c02 [Commonizer] Fix ImportAndCheckNavigation IT 2020-08-17 21:52:40 +07:00
Georgy Bronnikov
df8b819a55 JVM_IR: restore dumping for IrLowering phase 2020-08-17 15:57:12 +03:00
Ilya Goncharov
c70759673c [Gradle, JS] Update npm versions
^KT-41125 fixed
2020-08-17 15:22:30 +03:00
Steven Schäfer
6100166185 JVM IR: Fix special bridge generation with external Kotlin dependencies 2020-08-17 13:42:32 +02:00
Ilya Kirillov
730e07c52a Wizard: fix ExpectedFileTest.kt 2020-08-17 12:22:38 +03:00
Toshiaki Kameyama
35459d2ca7 "Add not-null asserted (!!) call": add '!!' to receiver of function reference
#KT-37841 Fixed
2020-08-17 12:05:45 +03:00
Ilya Kirillov
5e5e19f482 FIR IDE: temporary disable AddFunctionReturnTypeIntention 2020-08-17 11:38:05 +03:00
Ilya Kirillov
b79deafbc7 FIR IDE: fix testdata 2020-08-17 11:38:04 +03:00
Ilya Kirillov
27c045d035 FIR IDE: move all all symbol markers to markers package 2020-08-17 11:38:02 +03:00
Ilya Kirillov
052e8e5069 FIR IDE: make a symbol hierarchy a sealed one 2020-08-17 11:38:01 +03:00
Ilya Kirillov
018dd673b3 FIR IDE: simplify containing declaration provider 2020-08-17 11:38:00 +03:00
Ilya Kirillov
37ac654444 FIR IDE: rework high level API
Make analysis session to always be a receiver parameter
2020-08-17 11:37:58 +03:00
Ilya Kirillov
cadf99ca1e FIR IDE: introduce containingDeclarationProvider for symbols 2020-08-17 11:37:57 +03:00
Ilya Kirillov
b5a4e4c409 FIR IDE: introduce applicable computation & -based inspection 2020-08-17 11:37:56 +03:00
Ilya Kirillov
c8ab0766c9 FIR IDE: Implement symbol restoring for member symbols 2020-08-17 11:37:55 +03:00
Ilya Kirillov
e4995175a4 FIR IDE: fix idea-frontend-fir testdata 2020-08-17 11:37:53 +03:00
Ilya Kirillov
5f20910c79 FIR IDE: always try to find symbol origin in overridden symbols 2020-08-17 11:37:52 +03:00
Ilya Kirillov
a700d1fccb FIR IDE: resolve kt symbols only to the phase they actually need 2020-08-17 11:37:51 +03:00
Dmitriy Dolovov
75be9cf31f [Commonizer] Tests on rewriting callables names to succeed commonization
^KT-34602
2020-08-17 09:31:28 +07:00
Dmitriy Dolovov
de0b6e06cf [Commonizer] Keep parameters names hash in approximation keys for ObjC callables
^KT-34602
2020-08-17 09:31:21 +07:00
Dmitriy Dolovov
3b901a28d5 [Commonizer] More compact approximation keys
^KT-34602
2020-08-17 09:31:12 +07:00
Dmitriy Dolovov
4418dc85ca [Commonizer] Allow rewriting callables names to succeed commonization
^KT-34602
2020-08-17 09:31:03 +07:00
Dmitriy Dolovov
8904f5652b [Commonizer] Allow extended lookup for classifiers in test mode
Only for commonizer tests!

Allow to look up classifiers from the standard Kotlin packages (kotlin, kotlinx)
both in the default built-ins module and in test data sources. This is necessary
to write tests that refer to C-interop classifiers that are not available without
Kotlin/Native distribution.

^KT-34602
2020-08-17 09:30:57 +07:00
Dmitriy Dolovov
3b398ed57f [Commonizer] Small clean-up in IllegalCommonizerStateException 2020-08-17 09:30:47 +07:00
Dmitriy Dolovov
494fb39399 [Commonizer] CLI: Report duration even if it's 0ms long 2020-08-17 09:30:42 +07:00
Dmitriy Dolovov
9ef727747b [Commonizer] Use Array instead of List in AbstractListCommonizer 2020-08-17 09:30:36 +07:00
Igor Chevdar
e468a347b5 [box-tests] Tests on field init optimization
Added tests on all primitive types and a test when the field's type is an inline class
2020-08-15 12:16:33 +05:00
Steven Schäfer
0328fcaf5d JVM IR: Avoid IMPLICIT_NOTNULL checks on special bridge methods
...with dynamic type checks, except for the `@PlatformDependent`
methods, for which the JVM backend adds null checks.
2020-08-14 21:59:33 +02:00
Steven Schäfer
9026f89ba5 JVM IR: Avoid CHECKCASTs on type operators (KT-39520)
The type information coming from Java or Kotlin generics may be wrong
due to type erasure and a CHECKCAST instruction could throw an
exception.
2020-08-14 21:58:47 +02:00
Alexander Udalov
469b164555 IR: minor optimizations to IR validation 2020-08-14 21:55:37 +02:00
Alexander Udalov
7468518f35 JVM IR: minor, optimize forceSingleValueParameterBoxing
In JVM IR, both `valueParameters` and `isFromJavaOrBuiltins` take
noticeable time (1% of all compilation) because the logic for these in
IrBasedDescriptors is not trivial.
2020-08-14 21:55:37 +02:00
Alexander Udalov
35cace2540 JVM IR: collect potentialBridgeTargets in a list, then create bridges for all of them
This takes BridgeLowering time percentage from 1.3% to 1.0% of all
compiler time on a sample project, perhaps due to better data locality.
In addition, it simplifies stack traces by effectively merging all
bridge generation call sites into one, helping in future performance
investigations.
2020-08-14 21:55:37 +02:00
Alexander Udalov
9607414cf1 IR: make allOverridden return Set instead of Sequence, move to IrUtils
This doesn't hurt performance, but improves stack traces, in particular
in JVM's BridgeLowering.
2020-08-14 21:55:37 +02:00
Alexander Udalov
adcfbdec24 JVM IR: optimize special method / signature computation in BridgeLowering
First of all, put method signature caches of BridgeLowering into
JvmBackendContext. Since method hierarchies can span several files, and
a new instance of BridgeLowering is created to lower each file, keeping
them cached for the whole module makes BridgeLowering faster.

Also, do not attempt to compute special bridges if the method is
irrelevant, which can be deduced by its name. With this optimization,
the special method cache is no longer needed.

This brings BridgeLowering time from 3.8% down to 1.5% of all compiler
time on a sample project.
2020-08-14 21:55:37 +02:00
Alexander Udalov
0727e9055b JVM IR: use a simpler way to check if class is local 2020-08-14 21:55:37 +02:00
Alexander Udalov
6db5ad7310 IR: remove cast to IrStatement in IrDeclarationBase.transform
Default implementation of `IrStatement.transform` contained a cast to
`IrStatement`. Since almost all IR elements inherit from IrStatement,
this implementation was used in many subclasses. However, checkcast to
interface is slow and this place was indeed noticeable in the profiler
snapshot. Since not that many places really expected to get IrStatement
out of IrStatement.transform, introduce a new method
`transformStatement` that does this cast, and use it in all those
places. Meanwhile, most implementations will use the IrElement's
implementation of `transform` which merely invokes `accept` without
casts.
2020-08-14 21:55:37 +02:00
Alexander Udalov
fb8e39a621 IR: optimize transformation of declarations/statements lists in-place
Also, inherit IrDeclarationBase from IrElementBase to be able to use a
cast to IrElementBase, which is faster than a cast to IrElement or
IrDeclaration.
2020-08-14 21:55:36 +02:00
Alexander Udalov
4f0585950e IR: inline some transformChildren calls in IrElementTransformer{,Void}
IrElementTransformer.visitDeclaration/visitExpression are very prominent
hotspots, and it seems that HotSpot doesn't optimize the inlined Kotlin
bytecode there well enough. Reduce the bytecode in these and similar
methods by inlining calls to also/apply/transformChildrenVoid.
2020-08-14 21:55:36 +02:00
Nikolay Krasko
3a883e1236 Replace bintray bootstrap with space bootstrap repo 2020-08-14 17:31:13 +03:00
Nikolay Krasko
f484ceec80 Use GPG agent for signing in PublishedKotlinModule (KTI-314) 2020-08-14 17:31:13 +03:00
Nikolay Krasko
bbf8b12c65 Sign with GnuPG agent (KTI-314) 2020-08-14 17:31:13 +03:00
Nikolay Krasko
635ffcd53b Update maven signing for working with gpg 2 (KTI-314)
Update to maven-gpg-plugin 1.6 and add workaround for https://issues.apache.org/jira/browse/MGPG-59
2020-08-14 17:31:13 +03:00
Ilya Matveev
a121ec1e39 Update Kotlin/Native: 1.4.20-dev-16314 2020-08-14 09:41:47 +00:00
Roman Artemev
fa2c49a311 [Plugin API] Add extension point to contribute synthetic properties
- needs to fix KT_41006
2020-08-14 11:59:37 +03:00
Denis Zharkov
5ede37d6ab Report warnings on safe call + nullable extension operator
^KT-41034 In Progress
2020-08-14 11:12:34 +03:00
Roman Golyshev
852d22470e Revert "FIR Completion: Add idea-fir dependency to run completion tests"
This reverts commit 7d883f18
2020-08-13 23:12:34 +03:00
Toshiaki Kameyama
89cc5777ce Put parameters on line: don't suggest if parameters has end-of-line comments
#KT-35214 Fixed
2020-08-13 19:53:46 +03:00
Toshiaki Kameyama
efa981db36 "Create class from usage": add visibility to primary constructor if needed
#KT-29844 Fixed
2020-08-13 19:51:01 +03:00
Toshiaki Kameyama
b1e8238ea2 "Convert reference to lambda" intention: handle extension function reference with extension function call
#KT-35558 Fixed
2020-08-13 19:48:07 +03:00
Toshiaki Kameyama
9ff7539ff0 "Merge 'if's" intention: do not remove nested comments
#KT-33258 Fixed
#KT-39552 Fixed
2020-08-13 19:43:39 +03:00
Toshiaki Kameyama
f6e70cfed8 Wrap with let: fix it works correctly for invoking function type
#KT-39182 Fixed
2020-08-13 19:30:34 +03:00
Ilya Goncharov
babdeacdaf [Gradle, JS] Add resolution configuration method
^KT-41054 fixed
2020-08-13 18:04:44 +03:00
Ilya Goncharov
85f23d8c6e [Gradle, JS] Fix test with new API
^KT-41054 fixed
2020-08-13 18:04:44 +03:00
Ilya Goncharov
5eda8e95bf [Gradle, JS] Revert kotlinTargets
^KT-41054 fixed
2020-08-13 18:04:44 +03:00
Ilya Goncharov
855554ac38 [Gradle, JS] Move yarn resolutions from dependency constraints
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
fecda8548b [Gradle, JS] Override maven and ivy publishing aware context
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
58284c8b08 [Gradle, JS] Add yarn resolution gradle integration test
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
9df604cb3d [Gradle, JS] Migrate on set for npm ranges
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
1dd92f011c [Gradle, JS] Compare range lists as sets
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
50ccb522b9 [Gradle, JS] Add intersect tests
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
bd01ac52af [Gradle, JS] Add union test with fixed issue in union method
^KT-41054 fixed
2020-08-13 18:04:43 +03:00
Ilya Goncharov
7aaa1cf556 [Gradle, JS] Add invert test
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
9b8a64ef7b [Gradle, JS] Add hasIntersection test
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
814c0b73e3 [Gradle, JS] Add doc into NpmRange
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
dc7d7135f8 [Gradle, JS] Add min start, max end, min end tests
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
c25bcb4028 [Gradle, JS] Add max start test
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
42090e4839 [Gradle, JS] Add failing test
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
d4524e4050 [Gradle, JS] Small refactoring
^KT-41054 fixed
2020-08-13 18:04:42 +03:00
Ilya Goncharov
b95eb66032 [Gradle, JS] RejectAll => reject wildcard
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
d4c0d62eeb [Gradle, JS] Require version use caret
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
3ed42d394b [Gradle, JS] Support hyphenated range
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
a4de85da13 [Gradle, JS] Right wildcard range
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
f848b7cbeb [Gradle, JS] Right equals and hashCode for npm range
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
68880e6f47 [Gradle, JS] NpmRangeVisitor without nulls
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
7f3a2ac953 [Gradle, JS] Renames
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
fec8c6c0ae [Gradle, JS] Min and max are not nullable
^KT-41054 fixed
2020-08-13 18:04:41 +03:00
Ilya Goncharov
966c9dae68 [Gradle, JS] Use not inverted visitor but straightforward visitor
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
9bb49ac370 [Gradle, JS] Union of Npm Ranges
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
14fac83e2b [Gradle, JS] Intersect of NpmRange
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
90bee78dda [Gradle, JS] None range instead of none version
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
f1b8c62231 [Gradle, JS] Use rejected versions
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
d232e2ceb3 [Gradle, JS] Add ANTLR visitor for inverting of npm versions
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
768b9a0340 [Gradle, JS] Use NpmVersionConstraint
^KT-41054 fixed
2020-08-13 18:04:40 +03:00
Ilya Goncharov
bb569f36b1 [Gradle, JS] Implement reason and other methods beside version
^KT-41054 fixed
2020-08-13 18:04:39 +03:00
Ilya Goncharov
30f78847b1 [Gradle, JS] Not publish npm dependency constraints in metadata
^KT-41054 fixed
2020-08-13 18:04:39 +03:00
Ilya Goncharov
0473648b0e [Gradle, JS] Use gradle dependency constraints for yarn resolutions
^KT-41054 fixed
2020-08-13 18:04:39 +03:00
Roman Golyshev
7d883f1806 FIR Completion: Add idea-fir dependency to run completion tests
- Without this dependency, FIR plugin completion tests fail because the
fir completion contributor is not available
2020-08-13 17:29:45 +03:00
Ilmir Usmanov
31e4ddafd1 Minor. Add test with boolean parameter 2020-08-13 15:52:53 +02:00
Ilmir Usmanov
bcbb050326 Use fields for spilled variables for lambda parameters as well
In other words, do not generate p$ fields if we can use L$ fields,
which are being cleaned up.
 #KT-16222 Fixed
2020-08-13 15:52:51 +02:00
Ilya Goncharov
f5ab3a445f [Gradle, JS] Fix abstract task on default
^KT-40865 fixed
2020-08-13 15:39:02 +03:00
Yunir Salimzyanov
9ecf416a8a Parse multiple buildTypeIds for one bunch and synchronize muted tests
Cause: split Ide plugin tests in 4 parts
2020-08-13 12:57:09 +03:00
Mikhail Zarechenskiy
aafe41cf7a Do not force coercion to Unit for nullable lambda return type
#KT-41005 Fixed
2020-08-13 10:40:51 +03:00
Vyacheslav Gerasimov
d9bac4d5e4 Build: Warn about empty directories in sources 2020-08-12 21:40:04 +03:00
Vyacheslav Gerasimov
27578e6056 Build: Upgrade gradle to 6.6 2020-08-12 20:24:12 +03:00
Roman Golyshev
166b6db764 Make keyword lookup objects correctly comparable
- This is done to fix the problem with duplicated keyword items in
CodeWithMe plugin (see https://youtrack.jetbrains.com/issue/CWM-438)
2020-08-12 14:41:59 +00:00
Georgy Bronnikov
18ae665d41 IR: make IrCall take IrSimpleFunctionSymbol 2020-08-12 16:31:31 +03:00
Toshiaki Kameyama
4901cdb11f ConvertCallChainIntoSequence: support functions added in Kotlin 1.4
#KT-40448 Fixed
2020-08-12 16:28:29 +03:00
Toshiaki Kameyama
5e91ffb156 Move to class body: don't suggest on data class
#KT-40558 Fixed
2020-08-12 16:10:33 +03:00
Nick
28700ed64c [FIR] Supertype and inheritance checkers group 2020-08-12 15:38:29 +03:00
Oleg Ivanov
252eb1ad23 [FIR] Fix typo in FirDataFlowAnalyzer 2020-08-12 15:00:54 +03:00
Anton Yalyshev
e3bbc54e85 Add change-notes for 1.4 2020-08-12 14:36:47 +03:00
Oleg Ivanov
21b8679799 [FIR] Add ReturnsImplies effect analyzer 2020-08-12 11:06:07 +03:00
Oleg Ivanov
3454ae7ca4 [FIR] Add VariableStorage and flow on nodes into CFG reference 2020-08-12 11:06:07 +03:00
Oleg Ivanov
15598b62c9 [FIR] Add replaceControlFlowGraphReference function for FirFunction 2020-08-12 11:06:07 +03:00
Oleg Ivanov
7da94cc299 [FIR] Fix wrong ConstantReference for returnsNotNull in EffectExtractor 2020-08-12 11:06:07 +03:00
Anton Yalyshev
f6f3787b51 Disable FUS for Code Completion in 1.4.20 2020-08-12 10:22:29 +03:00
Andrey Uskov
20371b874a Configuration caching - register listener only once per project
To many listeners cause performance issues in Gradle.
2020-08-12 00:40:18 +03:00
Georgy Bronnikov
d2fda2a07c Fir2Ir: bug fix 2020-08-12 00:31:33 +03:00
Ilmir Usmanov
8a098545e6 Minor. Add test 2020-08-11 22:10:51 +02:00
Ilmir Usmanov
00bf07fc41 Force boxing kotlin.Result return type of suspend functions
#KT-40843 Fixed
2020-08-11 22:10:47 +02:00
Ilmir Usmanov
b06218c456 Minor. Update test data 2020-08-11 20:27:00 +02:00
Georgy Bronnikov
f21d8a4c5b JVM_IR, minor: use vals instead of objects 2020-08-11 18:44:47 +03:00
Vladimir Dolzhenko
6e016ce041 ktFile has to return script declaration from stub as well 2020-08-11 14:31:18 +00:00
Oleg Ivanov
4367d6631f [FIR] Add CallsInPlace contract analyzer 2020-08-11 16:17:01 +03:00
Oleg Ivanov
cc9c5b9e3c [FIR] Add CFG nodes, add multiple subGraphs for CFGOwner 2020-08-11 16:17:01 +03:00
Oleg Ivanov
128075e780 [FIR] Add fir source saving in resolved contract description 2020-08-11 16:17:01 +03:00
Oleg Ivanov
f467dccc68 [FIR] Rename confusing variable in CFGTraverser 2020-08-11 16:17:00 +03:00
Alexander Udalov
bcf1ee3907 Minor, fix test data for kotlinx.serialization bytecode text test 2020-08-11 15:14:06 +02:00
Steven Schäfer
53fe30eb45 JVM IR: Don't produce CHECKCASTs on null constants (KT-36650) 2020-08-11 15:13:40 +02:00
Alexander Udalov
7503f134c2 IR: use IdSignature to compare classes in FqNameEqualityChecker
This is both simpler and a lot more performant.
2020-08-11 14:41:57 +02:00
Alexander Udalov
36a1a65d98 IR: make IrBranch/IrCatch/IrSpreadElement/IrModuleFragment/IrPackageFragment classes 2020-08-11 14:41:57 +02:00
Alexander Udalov
08a35f0674 IR: make IrBody and subtypes classes 2020-08-11 14:41:57 +02:00
Alexander Udalov
4351f5235b IR: make IrExpression and subtypes classes 2020-08-11 14:41:56 +02:00
Alexander Udalov
ba7ff36274 IR: make IrDeclarationReference and subtypes classes 2020-08-11 14:41:56 +02:00
Alexander Udalov
ee904a975a IR: make IrMemberAccessExpression and subtypes classes
Merge IrMemberAccessExpressionBase into IrMemberAccessExpression, and
IrCallWithIndexedArgumentsBase into IrFunctionAccessExpression (extract
the latter into a separate file).
2020-08-11 14:41:56 +02:00
Alexander Udalov
fde7314aaf IR: do not inherit IrExpressionWithCopy from IrExpression 2020-08-11 14:41:55 +02:00
Alexander Udalov
9aa7da44e2 IR: remove IrTerminalExpressionBase, Ir{Terminal,}DeclarationReferenceBase
Implement no-op acceptChildren/transformChildren in the base class
IrExpressionBase instead. This doesn't change behavior because all other
implementations of acceptChildren/transformChildren are not affected.
2020-08-11 14:41:55 +02:00
Alexander Udalov
868018f51f IR: do not inherit IrFunctionReferenceImpl from IrCallWithIndexedArgumentsBase 2020-08-11 14:41:55 +02:00
Alexander Udalov
e3dfd5fb49 IR: push down implementations of startOffset/endOffset/type/...
Do not store these as properties in IrElementBase, IrExpressionBase and
similar classes. This helps to reduce boilerplate in implementations
(just "override val" in the constructor, instead of taking a parameter
and passing it to the superclass), and also slightly optimizes memory in
cases where the value is trivial (UNDEFINED_OFFSET, 0, etc) and thus
does not need to be stored.
2020-08-11 14:41:54 +02:00
Roman Golyshev
03f804b1c5 FIR Completion: Move completion files to idea-fir module 2020-08-11 15:38:07 +03:00
Ilmir Usmanov
d861373c6d Hack attributes for continuation of suspend function in SAM-adapter 2020-08-11 11:58:20 +02:00
Mikhail Zarechenskiy
2e131b870a Add tests for obsolete issues
#KT-38804 Obsolete
 #KT-38801 Obsolete
 #KT-38835 Obsolete
 #KT-38737 Obsolete
 #KT-38664 Obsolete
 #KT-38549 Obsolete
 #KT-38766 Obsolete
 #KT-38714 Obsolete
2020-08-11 12:34:02 +03:00
Georgy Bronnikov
7f4df19dd1 JVM_IR: reorganize throw... functions in Symbols 2020-08-11 10:54:29 +03:00
Denis Zharkov
6a16d6a246 FIR: Simplify delegating constructors call resolution 2020-08-11 10:14:02 +03:00
Denis Zharkov
8b71f5e558 FIR: Do not leave cyclic upper bounds of type parameters 2020-08-11 10:14:02 +03:00
Denis Zharkov
a5a93d00a7 FIR: Rework delegation constructor calls resolution
Make it work independently of being called for inner class (as in FE 1.0)
2020-08-11 10:14:02 +03:00
Denis Zharkov
db93b9052b FIR: Fix incorrect optimization for integer literals 2020-08-11 10:14:02 +03:00
Vyacheslav Gerasimov
ad8709b2dc Build: Remove exclusion of kotlinx-coroutines-core in scripting-common
It breaks available-at feature used in MPP
2020-08-11 00:39:04 +03:00
Vladimir Dolzhenko
8540f47c15 Fixed FindUsages case on look up implementation getter/setters via property names
#KT-40788 Fixed
#KT-24616 Fixed

back-port from kotlin-ide commit aa5580bb5a7e96b209cdaa1c82f4e485ee001ae8
2020-08-10 22:04:06 +02:00
Mikhail Zarechenskiy
e49cdf0ca2 Prohibit using suspend functions as SAM in fun interfaces
#KT-40978 Fixed
2020-08-10 22:04:16 +03:00
Mikhael Bogdanov
607f99ed3c Don't generate implicit overrides delegating to Java defaults
#KT-40920 Fixed
2020-08-10 20:03:23 +02:00
Sergey Igushkin
07aee8831e Fix stdlib-by-default with non-compiled source sets (KT-40559)
When a `variantFilter { ... }` is used in Android projects, AGP does not
creates some variants but still creates the source sets which would be
related to those variants.

For source sets that are not included into any compilation, the stdlib
module added by default was kotlin-stdlib-common, and it was added to
the `api` scope.

But AGP checks the `androidTest*Api` configurations and
if it detects any dependencies in them, it reports deprecation warnings.

However, we have plans to prohibit unused source sets at all as they
have no reasonable use cases. So the fix is not to add the stdlib by
default to source sets that participate in no compilations.

Issue #KT-40559 Fixed
2020-08-10 20:08:22 +04:00
Roman Golyshev
6e2887e083 FIR Completion: Add insertion handling for functions with lambdas
- The support is not complete
2020-08-10 18:25:34 +03:00
Roman Golyshev
b3a674abee FIR IDE: Add parameter's and type's properties required for completion 2020-08-10 18:25:34 +03:00
Roman Golyshev
67ed33367f FIR Completion: Add function insert handler
- It is a specialized copy from `KotlinFunctionInsertHandler.Normal`
2020-08-10 18:25:34 +03:00
Roman Golyshev
b547feb00d FIR Completion: Render vararg modifier in lookups 2020-08-10 18:25:33 +03:00
Roman Golyshev
582b00f5b2 FIR Completion: Add UniqueLookupElement to the lookup elements
- It is done to differentiate overloads of the same function
2020-08-10 18:25:33 +03:00
Roman Golyshev
b6ee478190 FIR Completion: Add psi element to the lookups
- May be a performance problem later
2020-08-10 18:25:33 +03:00
Roman Golyshev
53180e707e FIR Completion: Fix invalid isAbstract condition 2020-08-10 18:25:33 +03:00
Roman Golyshev
ef461260b0 FIR Completion: Add simple insertion handler to lookup elements
- The `QuotedNamesAwareInsertionHandler` is just a copy of
`BaseDeclarationInsertHandler`
2020-08-10 18:25:33 +03:00
Roman Golyshev
10598ee98e FIR Completion: Add simple lookup decorating with icon and parameters 2020-08-10 18:25:32 +03:00
Roman Golyshev
64187b40c9 FIR Completion: Prevent immediate completion in number literals
- This is copied from the original KotlinCompletionContributor
2020-08-10 18:25:32 +03:00
Alexey Trilis
d86c14243e Add @SinceKotlin to kotlinx.browser and kotlinx.dom packages
Add @DeprecatedSinceKotlin to kotlin.browser and kotlin.dom packages
2020-08-10 18:08:19 +03:00
Dmitriy Novozhilov
0e53d11dd4 Disable AllowResultInReturnType feature
#KT-40843
2020-08-10 17:57:53 +03:00
Valeriy.Vyrva
30ff886754 Improve docs for createTempDir/createTempFile
#KT-35218
2020-08-10 17:29:25 +03:00
Vladimir Ilmov
4fe6880489 Cyrillic 'c' fix in inspectionLikeProcessings.kt 2020-08-10 14:42:46 +02:00
Nick
0a2f113a24 [FIR] Fix slow string conversions in FirEffectiveVisibilityResolver 2020-08-10 13:46:15 +03:00
Alexander Dudinsky
e67518c349 Update gradle plugin version in GradleFacetImportTest
Also drop legacy tests for 1_1_2
2020-08-10 13:14:01 +03:00
Pavel Kirpichenkov
f431da2a66 Reapply "Introduce @FrontendInternals annotation""
This reverts commit 9ca4717d11.
^KT-39643 Fixed
2020-08-10 12:22:55 +03:00
Yan Zhulanow
5e8e60a399 Move back the 'KotlinStructureViewElement.isPublic' property used externally
Reasoning: Method com.gmail.blueboxware.extsee.kotlin.ExtSeeKotlinStructureViewModel.Companion.PublicElementsFilter.isVisible(com.intellij.ide.util.treeView.smartTree.TreeElement treeNode) : boolean contains an *invokevirtual* instruction referencing an unresolved method org.jetbrains.kotlin.idea.structureView.KotlinStructureViewElement.isPublic()
2020-08-10 18:18:37 +09:00
Alexander Dudinsky
aec87744f2 Run ImportAndCheckNavigation tests only vs the master version of plugin
Also error "Could not find org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable"
was fixed by adding ":native:kotlin-klib-commonizer-embeddable:install"
in dependencies for the kotlin-plugin install
2020-08-10 12:13:21 +03:00
Alexander Dudinsky
2042db598a Mute GradleNativeLibrariesInIDENamingTest.testLibrariesNaming in 192, 193
After updating version of gradle-plugin this tests started to fail on
the old version of IDE. After discussion we decided just mute it in
the old bunches
2020-08-10 12:04:51 +03:00
Sergey Igushkin
988480d649 Fix source JARs missing in Kotlin/Native targets with HMPP (KT-39051)
With HMPP, a separate implementation of `kotlinComponents` is used which
accidentally ignored the parent's logic for source artifacts.

As a simple fix, copy the parent's logic for source artifacts.

Issue #KT-39051 Fixed
2020-08-10 13:02:17 +04:00
Nataliya Valtman
a766369e72 KT-33908 Make Kotlin Gradle plugin compatible with configuration cache
#KT-33908 Fixed
2020-08-10 11:17:30 +03:00
Georgy Bronnikov
ea57b4cccb IR: add and unmute tests 2020-08-10 10:16:24 +03:00
Georgy Bronnikov
85ba170217 JVM_IR: use IrBasedDescriptors across codegen 2020-08-10 10:16:23 +03:00
Georgy Bronnikov
0b4c43083d IR: add IrBasedDescriptors 2020-08-10 10:16:23 +03:00
Georgy Bronnikov
dafcdc527d IR: propagate original declaration info via attributeOwnerId
For IrProperty, IrSimpleFunction we need to pass information about
original declaration to JVM_IR codegen. Instead of descriptors, use
the attributeOwnerId field.
2020-08-10 10:16:23 +03:00
Georgy Bronnikov
04d93dfbce IR: move containerSource from descriptor to IrFunction, IrProperty 2020-08-10 10:16:23 +03:00
Nick
4669e019d1 [FIR] Add diagnostic CONFLICTING_OVERLOADS & REDECLARATION 2020-08-10 10:09:37 +03:00
kvirolainen
36984009e9 Add samples for flatten, unzip functions 2020-08-10 03:40:13 +03:00
Elijah Verdoorn
41d5615608 Add samples for mapNotNull, find, getOrNull functions 2020-08-10 03:39:49 +03:00
Ilya Kirillov
62df2b3195 FIR IDE: run SUPER_TYPES & BODY_RESOLVE phases under global lock 2020-08-09 12:05:20 +03:00
Ilya Kirillov
7fb408ecd7 FIR IDE: enable new project wizard to FIR IDE 2020-08-09 12:05:13 +03:00
Ilya Kirillov
db7119f04d FIR IDE: fix ability to create new Kotlin files 2020-08-09 12:05:11 +03:00
Ilya Kirillov
054d196ec5 FIR IDE: temporary ignore failing tests 2020-08-09 12:05:02 +03:00
Ilya Kirillov
683ec2beff FIR IDE: make KtScopeProvider thread local 2020-08-09 12:04:53 +03:00
Ilya Kirillov
f62204fff1 FIR: move getCallableNames/getClassifierNames from scope to FirContainingNamesAwareScope 2020-08-09 12:04:52 +03:00
Ilya Kirillov
36a161080f FIR IDE: introduce KtType rendering 2020-08-09 12:04:44 +03:00
Ilya Kirillov
9f33d0147c FIR IDE: add info about nullability to KtType 2020-08-09 12:04:43 +03:00
Ilya Kirillov
16d22ae7e3 FIR IDE: correctly build FIR for qualified expressions 2020-08-09 12:04:43 +03:00
Ilya Kirillov
66f6fe18d6 FIR IDE: replace javax threadsafe annotations with custom ones
javax.annotation.concurrent may not be present for some JDKs
2020-08-09 12:04:35 +03:00
Ilya Kirillov
4595ee2cc0 FIR IDE: create read only copy of symbol builder only for completion 2020-08-09 12:04:34 +03:00
Ilya Kirillov
ccf232eaab FIR IDE: forbid analysis session to be stored in a variable 2020-08-09 12:04:34 +03:00
Ilya Kirillov
b41a5f9f34 FIR: make TypeRegistry thread safe 2020-08-09 12:04:26 +03:00
Ilya Kirillov
5f424ed1ec FIR IDE: rewrite low level API
- Cache ModuleResolveState for module till the world changes
- Resolve every file under a lock
- All creation of raw fir files and resolve of them happens in FirFileBuilder
- Lazy resolve of fir elements happens in FirElementBuilder

Caching works like the following:
- FirModuleResolveState holds PsiToFirCache & DiagnosticsCollector & FileCacheForModuleProvider
- FileCacheForModuleProvider holds a mapping from ModuleInfo to ModuleFileCache
- ModuleFileCache caches
    - KtFile -> FirFile mapping
    - ClassId -> FirClassLikeDeclaration, CallableId -> FirCallableSymbol
        which used in corresponding FirProvider
    - mapping from declaration to it's file
        which used in corresponding FirProvider
    - locks for fir file resolving
- PsiToFirCache provides mapping from KtElement to  FirElement
- DiagnosticsCollector collects diagnostics for file and caches them
2020-08-09 12:04:11 +03:00
Ilya Kirillov
1957be8757 FIR IDE: fix testdata of tests which now pass 2020-08-09 12:04:03 +03:00
Ilya Kirillov
34aa848b15 FIR: do not allow getting PSI text in RawFirBuilder in stub mode 2020-08-09 12:04:03 +03:00
Ilya Kirillov
cfc46b0cc8 FIR IDE: introduce FirIdeAllSourceDependenciesSymbolProvider
Co-authored-by: Simon Ogorodnik <simon.ogorodnik@jetbrains.com>
2020-08-09 12:03:56 +03:00
Ilya Kirillov
7d8ef5c7a2 FIR IDE: introduce KtFirConstructorDelegationReference 2020-08-09 12:03:54 +03:00
Ilya Kirillov
0870ded054 FIR IDE: introduce KtFirArrayAccessReference 2020-08-09 12:03:47 +03:00
Ilya Kirillov
22054c8507 FIR IDE: use non-fake override fir elements when finding psi for fir 2020-08-09 12:03:40 +03:00
Ilya Kirillov
d10e3f91fa FIR IDE: store FirScope strong references only in KtFirAnalysisSession 2020-08-09 12:03:33 +03:00
Ilya Kirillov
7033be588c FIR IDE: regenerate member scope test 2020-08-09 12:03:27 +03:00
Ilya Kirillov
ea3b2d8310 KT IDE: fix fully-qualified type resolving 2020-08-09 12:03:26 +03:00
Ilya Kirillov
50951fdfc3 KT IDE: use proper package symbol PSI to fix invalidated access exception 2020-08-09 12:03:14 +03:00
Ilya Kirillov
9f9ce6ba61 Fix compilation of KtFirDelegatingScope 2020-08-09 12:03:07 +03:00
Ilya Kirillov
1c195ea2bb FIR IDE: add kdoc for KtAnalysisSession 2020-08-09 12:03:07 +03:00
Ilya Kirillov
b8caefa0c4 FIR IDE: always recreate analysis session in tests to avoid breaking its contract 2020-08-09 12:03:06 +03:00
Ilya Kirillov
19efd19c6c FIR IDE: fix AbstractSymbolByFqNameTest after rebase 2020-08-09 12:03:01 +03:00
Ilya Kirillov
94b62e2ac6 FIR IDE: make context-dependent analysis session to use original cache on read-only mode 2020-08-09 12:03:00 +03:00
Ilya Kirillov
c0f5c90231 FIR IDE: separate ValidityOwner to ValidityTokenOwner & ValidityToken 2020-08-09 12:02:49 +03:00
Ilya Kirillov
6a6580dd97 FIR IDE: introduce KtConstructorSymbol.ownerClassId
Will be needed for completion
2020-08-09 12:02:48 +03:00
Ilya Kirillov
4653cdf794 FIR IDE: make KtFirDelegatingScope caching a thread safe 2020-08-09 12:02:42 +03:00
Roman Golyshev
ebf20c9706 Add multi-file tests for primitive completion
- This is required to test/debug correct completion from imports
2020-08-09 12:02:40 +03:00
Roman Golyshev
1b3a1a662f Add simple completion of class-like symbols 2020-08-09 12:02:34 +03:00
Roman Golyshev
20c627ea47 Implement collecting class-like names in KtFirStarImportingScope 2020-08-09 12:02:28 +03:00
Roman Golyshev
29ee233bb9 Remove repeating scopes collected by buildCompletionContextForFunction
- This is certainly a bug, we would have to fix it later
2020-08-09 12:02:27 +03:00
Roman Golyshev
e3778d62e3 Simplify canBeCalledWith function 2020-08-09 12:02:21 +03:00
Roman Golyshev
b90503decb Move PackageIndexHelper to KtFirStarImportingScope.kt 2020-08-09 12:02:16 +03:00
Roman Golyshev
d2fbd8e338 Remove KotlinFirCompletionProvider
- We should strive to use only high-level API for completion from now on
2020-08-09 12:02:16 +03:00
Ilya Kirillov
dee58e1d86 FIR IDE: handle importing scopes in completion in HL API
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com>
2020-08-09 12:02:11 +03:00
Ilya Kirillov
7aa26944d7 FIR IDE: rename utils.kt to psiUtils.kt
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com>
2020-08-09 12:02:00 +03:00
Ilya Kirillov
902b42ae1d FIR IDE: fix typo in completion testdata
Co-authored-by: Roman Golyshev <roman.golyshev@jetbrains.com>
2020-08-09 12:01:59 +03:00
Roman Golyshev
c3a3ab9e89 Implement the completion using high-level API only
- The indecies are not yet used

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:59 +03:00
Roman Golyshev
a6dd84a7e4 FIR IDE: Modify KtFirAnalysisSession for completion
- This is WIP solution for having a specialized `KtFirAnalysisSession`
for the completion

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:54 +03:00
Roman Golyshev
54946a793a Fix FirCompletionContext for safe access elements
- `towerDataContextForStatement` may contain safe access (?.) fir
elements as keys; however, `state.getCachedMapping(current)` would
never return those since they are considered as sugar fir elements

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:49 +03:00
Roman Golyshev
a2cf01162e Fix bug with member extensions with explicit receiver
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:48 +03:00
Roman Golyshev
df03e31b86 FIR IDE: Add KtCallableSymbol abstraction
- It should incapsulate callable symbols like functions, properties
and constructors

Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:44 +03:00
Roman Golyshev
a4a2d92c08 FIR IDE: Make KtFirReference implement KtSymbolBasedReference
Co-authored-by: Ilya Kirillov <ilya.kirillov@jetbrains.com>
2020-08-09 12:01:35 +03:00
Roman Golyshev
2eb439899e Use index to get symbols from importing scopes 2020-08-09 12:01:25 +03:00
Dmitriy Novozhilov
cefecdef25 fixup! Iterate on symbols, not on scopes 2020-08-09 12:01:23 +03:00
Roman Golyshev
e7f5594ffe Use more correct check for the constructor symbol
- add test for extension function receiver
2020-08-09 12:01:23 +03:00
Roman Golyshev
a3da1ea1a0 Iterate on symbols, not on scopes
- This way it is easier to get the correct results
2020-08-09 12:01:15 +03:00
Roman Golyshev
708c54f4d2 Refactor the collecting of callable symbols from scopes 2020-08-09 12:01:07 +03:00
Roman Golyshev
81f60bf252 Add test for smartcast 2020-08-09 12:01:07 +03:00
Roman Golyshev
ffb907150a Use information about receivers in completion
- Found few problems during resolving a single functon; disabled
assertions and marked them with TODO
- Add simple completion tests to simplify development
2020-08-09 12:01:00 +03:00
Roman Golyshev
0f5fc1fa99 Add FirSymbolProvider::getAllCallableNamesInPackage function
- Also, fix implementation of `getCallableNames` in few cases
2020-08-09 12:00:59 +03:00
Denis Zharkov
97d4918ed3 Expose local scopes to use in completion 2020-08-09 12:00:52 +03:00
Roman Golyshev
6129f4bcef Partial raw FIR building 2020-08-09 12:00:45 +03:00
Roman Golyshev
a1b621d987 Completion with FIR (prototype, work-in-progress) 2020-08-09 12:00:44 +03:00
Ilya Kirillov
2a495c1135 FIR IDE: introduce composite scopes 2020-08-09 12:00:38 +03:00
Ilya Kirillov
9092b33755 FIR IDE: Introduce module resolve state for completion 2020-08-09 12:00:31 +03:00
Ilya Kirillov
1d92fbaa7f FIR IDE: correctly set symbol origin for fake overridden ones 2020-08-09 12:00:24 +03:00
Ilya Kirillov
88548d988a FIR IDE: implement getCallableNames/getClassifierNames in more scopes 2020-08-09 12:00:18 +03:00
Ilya Kirillov
138f11ee27 FIR IDE: introduce member scope tests 2020-08-09 12:00:11 +03:00
Ilya Kirillov
f709e6acf3 FIR IDE: introduce scopes for HL API 2020-08-09 12:00:05 +03:00
Dmitriy Novozhilov
6596dc359b fixup! Completion with FIR (prototype, work-in-progress) 2020-08-09 12:00:04 +03:00
Ilya Kirillov
d62500531b FIR: add getClassifierNames for FirScope 2020-08-09 11:59:57 +03:00
Roman Golyshev
656086f90a Add FirScope::getCallableNames function 2020-08-09 11:59:50 +03:00
Ilya Kirillov
1f3add49f4 FIR IDE: move trailing comma related registry keys to ide-frontend-independent.xml 2020-08-09 11:59:49 +03:00
Ilya Kirillov
055b975699 FIR IDE: add tests which failing with exceptions inside FIR 2020-08-09 11:59:49 +03:00
Ilya Kirillov
9cf4fdfb71 FIR IDE: add reference info on reference resolve 2020-08-09 11:59:44 +03:00
Ilya Kirillov
5c6d636d02 Minor: reformat fir ide part of GenerateTests.kt 2020-08-09 11:59:38 +03:00
Ilya Kirillov
45e01a8b3d FIR IDE: precalculate DuplicatedFirSourceElementsException error message
It may be called from non-read action
2020-08-09 11:59:33 +03:00
Ilya Kirillov
964becf138 FIR IDE: allow the same entity to be accessed from different threads 2020-08-09 11:59:23 +03:00
Ilya Kirillov
4c08dfb238 Add invoke reference resolve test without errors in test data 2020-08-09 11:59:17 +03:00
Ilya Kirillov
15ecfd84b4 FIR IDE: cache KtAnalysisSession for modules 2020-08-09 11:59:15 +03:00
Ilya Kirillov
8c0197e081 FIR IDE: introduce KtAnalysisSessionProvider & helping functions for working with analysis session 2020-08-09 11:59:10 +03:00
Ilya Kirillov
acb8546583 FIR IDE: fix ReadOnlyWeakRef error message 2020-08-09 11:59:05 +03:00
Ilya Kirillov
b09358fe17 FIR IDE: rename KtFieldSymbol -> KtFirJavaFieldSymbol 2020-08-09 11:59:04 +03:00
Ilya Kirillov
f98ff2c25e FIR IDE: always pass resolve state as parameter when getting fir by psi 2020-08-09 11:59:04 +03:00
Mikhail Zarechenskiy
0c13a7f89a Fix accessibility check for experimental declarations from default scope
#KT-40919 Fixed
2020-08-07 17:49:15 +03:00
Ilmir Usmanov
b403b63f48 Ease field initialization check
Since there is already VAL_REASSIGNMENT diagnostics, we can safely only
for direct assignments.
 #KT-40893 Fixed
2020-08-07 14:22:18 +02:00
Nick
6c0abe7e48 [FIR] Fix CliTestGenerated$Jvm.testFirError 2020-08-07 13:27:29 +03:00
Pavel Kirpichenkov
9ca4717d11 Revert "Introduce @FrontendInternals annotation"
Revert due to Mobile IDE Trunk IJ TC configuration
This reverts commits:
ffc3d8bdfc
c0e713980b

^KT-39643 In Progress
2020-08-07 12:10:03 +03:00
Mads Ager
7f2efabe6a [JVM_IR]: Improve stepping for when.
Additionally, use the line number of the class for default interface
dispatch methods.
2020-08-07 09:16:01 +02:00
Dat Trieu
1009a240f2 KT-20357: Add samples for filter functions 2020-08-06 23:41:12 +03:00
Steven Schäfer
ca6e430e89 JVM IR: Handle nested classes in DelegatedPropertyOptimizer 2020-08-06 21:01:59 +02:00
Steven Schäfer
da9bff40f0 JVM IR: Don't remove stores to visible locals in DelegatedPropertyOptimizer 2020-08-06 21:01:59 +02:00
Ilya Kirillov
983c84d6a6 Wizard: fix default template compilation when using JS IR
#KT-39904 fixed
2020-08-06 21:46:50 +03:00
Alexander Udalov
e4cd7cdbcf IR: remove unused code, cleanup 2020-08-06 17:08:04 +02:00
Alexander Udalov
b30b2e0179 IR: minor, render duplicate IR node in checker 2020-08-06 17:08:04 +02:00
Alexander Udalov
8db1c3611b IR: introduce abstract class IrDeclarationBase
The main purpose of this class is to improve performance of IR visitors
and transformers. `IrElementVisitor.visitDeclaration` now takes
IrDeclarationBase as a parameter, and therefore the call to `accept`
there is now a virtual class call, instead of an interface call.
2020-08-06 17:08:04 +02:00
Alexander Udalov
771e7574f4 IR: make subtypes of IrDeclaration classes 2020-08-06 17:08:03 +02:00
Alexander Udalov
3cecf81176 IR: transform base classes of lazy IR to interfaces 2020-08-06 17:08:02 +02:00
Alexander Udalov
b02653a524 IR: remove base classes IrDeclarationBase and IrFunctionBase
They introduce a diamond class hierarchy which prevents IR element
hierarchy from being transformed to classes.
2020-08-06 16:46:26 +02:00
Alexander Udalov
9152df4702 PIR: transform base implementation classes to interfaces
Unfortunately this requires a lot of boilerplate, but is a requirement
for transforming the main IR element hierarchy interfaces
(IrDeclaration, IrClass, ...) to classes.
2020-08-06 16:46:26 +02:00
Ilya Goncharov
13766d5075 [Gradle, JS] Update test data
^KT-40884 fixed
2020-08-06 15:33:21 +03:00
Ilya Goncharov
52110a08d9 [Gradle, JS] Update versions
^KT-40884 fixed
2020-08-06 15:33:06 +03:00
Sergey Igushkin
f6356199d3 Fix typealias usage nullability and annotations lost in deserialization
Issue #KT-40824 Fixed
2020-08-06 15:46:54 +04:00
Alexander Dudinsky
4063aba677 Remade launch of NativeRunConfigurationTest against master version of gradle plugin 2020-08-06 14:06:05 +03:00
Konstantin Tskhovrebov
69ce6bd952 Add tests for setup native run gutters. 2020-08-06 14:06:04 +03:00
Sergey Igushkin
b5d4e4c44c Enable compatibility metadata variant by default in HMPP
This by default ensures that libraries published with HMPP are
compatible with non-HMPP consumers (which is the default in 1.4.0).
2020-08-06 14:08:51 +04:00
Mikhail Zarechenskiy
2eb17df962 Do not compute SamType too eagerly as it can force member resolution
Internally, during creation of `SamType` the compiler checks if a
 parameter is really can be used as a SAM, so this check involves
 lookup for abstract members, which can force additional computation of
 member scopes. This is totally fine for BE but it can be dangerous
 for light classes computation when not all scopes are processed.

 Note that this issue appeared quite recently after 16f175612e

 #KT-40869 Fixed
2020-08-06 09:20:56 +03:00
Vladimir Dolzhenko
6ec0e9546b Fix 192 compilation for UI for standalone gradle scripts
Relates to #KT-39790
2020-08-05 23:39:34 +02:00
Konstantin Tskhovrebov
66c1bd8c89 Revert "Update KMM plugin user texts."
This reverts commit 5edbc75d
2020-08-05 21:54:01 +03:00
Pavel Kirpichenkov
c0e713980b Add helpers for getting commonly used services without an opt-in
These services are LanguageVersionSettings, DataFlowValueFactory
#KT-39643 Fixed
2020-08-05 21:44:47 +03:00
Pavel Kirpichenkov
ffc3d8bdfc Introduce @FrontendInternals annotation
#KT-39643
2020-08-05 21:44:47 +03:00
Sergey Igushkin
eff5839369 "Kotlin Multiplatform Projects are an ~experimental~ Alpha feature." 2020-08-05 22:01:12 +04:00
Ilmir Usmanov
6c475e614a Minor. Update debugger tests 2020-08-05 19:47:55 +02:00
Ilmir Usmanov
68342a1f72 Initialize fake inliner variables on resume path
Otherwise, this will cause R8 to complain.
2020-08-05 19:47:55 +02:00
Ilmir Usmanov
bb5a99ec18 Do not put $completion to LVT if is dead 2020-08-05 19:47:54 +02:00
Florian Kistner
9925866293 203: Fix compilation 2020-08-05 19:36:43 +02:00
Florian Kistner
c792092410 Bump fastutil version to match 203 2020-08-05 19:36:42 +02:00
Nikita Bobko
c5398e8317 Move 'radixPrefix' from compiler modules to IDE modules
`radixPrefix` is used only in IDE now. So let's put it into IDE modules.

This commit is done in order to be able to use code dependent on
`radixPrefix` in `kotlin-ide` repo, because `kotlin-ide` depends on
1.4.0 artifacts of compiler. And `radixPrefix` isn't presented in
those artifacts
2020-08-05 20:17:17 +03:00
Sergey Igushkin
093d4b3108 Revert "Fix typealias usage nullability and annotations lost in deserialization"
This reverts commit 070848a1
2020-08-05 20:17:49 +04:00
Konstantin Tskhovrebov
5edbc75d7b Update KMM plugin user texts.
#Fixed KMM-324
2020-08-05 18:37:27 +03:00
Jinseong Jeon
b57794d96e IR util: IrExpression.isSafeToUseWithoutCopying 2020-08-05 17:07:27 +03:00
Jinseong Jeon
7ef1c74bbf FIR2IR: apply adapted reference conversion to coercion-to-unit 2020-08-05 17:07:27 +03:00
Mikhail Glukhikh
5f80bfd5d4 [FIR] Don't report UNINITIALIZED_VARIABLE on lateinit local variable 2020-08-05 16:47:51 +03:00
Natalia Selezneva
54d96a2dd7 UI for standalone gradle scripts
^KT-39790 Fixed
2020-08-05 15:22:22 +02:00
Mikhail Glukhikh
fc874e72b1 [FIR2IR] Initialize components a bit earlier to prevent lateinit errors 2020-08-05 12:11:34 +03:00
Mikhail Glukhikh
17b289fa00 [FIR] Code cleanup: get rid of FirClass.buildUseSiteMemberScope() 2020-08-05 12:11:34 +03:00
Mikhail Glukhikh
8bb5488a26 [FIR] look at intersectionOverride during override processing
This commit fixes some BB tests broken by previous commit
2020-08-05 12:11:34 +03:00
Mikhail Glukhikh
f1356a809e Fir2IrLazySimpleFunction: generate overridden symbols via FirTypeScope 2020-08-05 12:11:33 +03:00
Alexander Dudinsky
52c01abb83 Increase Xmx size after investigation OOM problem in KMM-316 2020-08-05 10:45:16 +03:00
Alexander Dudinsky
d012cd3272 Add kotlin-test-junit:install in dependencies for the kotlin-plugin install 2020-08-05 10:45:16 +03:00
Alexander Dudinsky
ea0099aa39 Fix testPlatformToCommonExpByInComposite.
In 9d362875da build started fail if mpp
or js targets not configured.
The test testPlatformToCommonExpByInComposite was fixed due it.
2020-08-05 10:45:16 +03:00
Alexander Dudinsky
05d6217f78 Changed gradle-plugin version in Gradle tests.
When 6.5.1 Gradle version was added, more tests have began to fail
because of legacy gradle-plugin versions (1.1., 1.2.) which are not
compatible with the new version of Gradle. This commit updates the used
version of the Gradle plugin to the latest stable (1.3.72) and makes it
configurable from tests.
2020-08-05 10:45:15 +03:00
Alexander Dudinsky
6652a7072c Fix testData due to KT-40551.
Starting from version 1.3.60, unnecessary dependencies with runtime
scopes have been added for modules jvmTest and jsTest. After updating
the plugin version in tests from 1.3.50 to 1.3.72 and master,
tests began to fail because of this. In order not to stop other checks
in tests, they were redone for the current behavior with unnecessary
dependencies.
After fixing bug KT-40551, the old behavior in tests will be returned.
2020-08-05 10:45:15 +03:00
Alexander Dudinsky
0298795b18 Add gradle.properties with kotlin.stdlib.default.dependency=false for tests
In the master version of plugin dependencies on stdlibs are enabled
by default. It is not expected for some tests.
Flag kotlin.stdlib.default.dependency=false fixed it.
2020-08-05 10:45:15 +03:00
Alexander Dudinsky
bc623e97ec Add Gradle version 6.5.1 for tests. 2020-08-05 10:45:15 +03:00
Alexander Dudinsky
1da05c54be Change gradle-plugin versions for tests from 1.3.50 to 1.3.72 2020-08-05 10:45:14 +03:00
Nick
f15f5bccc8 [FIR] Add more diagnostic messages 2020-08-05 10:41:06 +03:00
Victor Petukhov
f45de9d8fb NI: approximate not top-level captured types during code generation
^KT-40693 Fixed
2020-08-05 10:36:36 +03:00
Ilya Matveev
f6d7e7c52a CocoaPods: Fix setting custom framework name
The main scheme of a synthetic project generated for
pod import has the same name as the podspec generated
for the kotlin module (== Gradle project name). But
when starting an Xcode build, we specify the -scheme
argument to a framework name instead of project.name.

By default they are the same, but if a custom framework
name is specified, xcodebuild fails.

Issue #KT-40801 fixed
2020-08-05 06:46:53 +00:00
Mikhail Zarechenskiy
a45f73867a Add compatibility resolve when SAM conversion was applied partially
#KT-40646 Fixed
2020-08-05 00:03:33 +03:00
Sergey Igushkin
070848a1c1 Fix typealias usage nullability and annotations lost in deserialization
This fixes a regression introduced by the commit 4b0da0688a which made
deserializer expand typealiases but didn't take nullability and use site
annotations into account.

Issue #KT-40824 Fixed
2020-08-05 00:19:52 +04:00
Nick
ec4f04095c [FIR] Rearrange FirErrors.kt 2020-08-04 22:40:09 +03:00
Nick
207027b84c [FIR] Fix light tree's supertype FirDelegatedConstructorCall source 2020-08-04 22:37:43 +03:00
Nick
a59cedcd39 [FIR] Fix non-fake sources for constructor delegates 2020-08-04 22:37:42 +03:00
Nick
f74eb07203 [FIR] Fix incorrect diagnostic behaviour + several enum diagnostics 2020-08-04 22:28:49 +03:00
Nick
b76f757d47 [FIR] Add diagnostic for missing primary constructor 2020-08-04 22:28:49 +03:00
Nick
0f213e58db [FIR] Add diagnostic for primary constructor not called 2020-08-04 22:28:48 +03:00
Nick
bb0e1b7390 [FIR] Add diagnostic for constructor delegation cycles 2020-08-04 22:28:48 +03:00
Mikhail Glukhikh
e841b3a77b [FIR] Add diagnostic collection to KotlinToJVMBytecodeCompiler 2020-08-04 22:27:18 +03:00
Mikhail Glukhikh
9c3b8484b9 [FIR TEST] Add CLI test with should-be-error (not yet) 2020-08-04 22:27:18 +03:00
Ilmir Usmanov
824991a9dd Minor. Add tests. 2020-08-04 15:42:38 +02:00
Ilmir Usmanov
bbd4c21595 Cleanup spilled variables
#KT-16222
2020-08-04 15:42:37 +02:00
Ilmir Usmanov
999b41068b Minor. Refactor variables spilling
Split information collection and method node mutation.
2020-08-04 15:42:37 +02:00
Ilmir Usmanov
405c9743ef Do not spill dispatch receiver of suspend functions if it is not used
#KT-20571
2020-08-04 15:42:36 +02:00
Jinseong Jeon
5db7957230 FIR2IR: use type arguments from fully expanded type 2020-08-04 14:44:38 +03:00
Ilya Kirillov
606dc2f723 Fix binary compatibility problems in ImportInsertHelper & ShortenReferences 2020-08-04 12:46:13 +03:00
Victor Petukhov
af48f08f9c NI: take into account flexible types during capturing arguments from expression
^KT-40544 Fixed
2020-08-04 12:38:04 +03:00
vldf
65ebd02a39 [FIR] Fix for CanBeReplacedWithOperatorAssignment Checker 2020-08-04 11:20:42 +03:00
Mikhail Glukhikh
6f3df6faf4 [FIR] Regenerate extended checker tests 2020-08-04 09:35:36 +03:00
Mikhail Glukhikh
181a8bb79e [FIR TEST] Mute failing BB test with Byte/Short.and usage 2020-08-04 08:59:16 +03:00
Jinseong Jeon
47c47be3d3 FIR serializer: serialize annotations on FirTypeRef, not ConeKotlinType 2020-08-04 08:59:16 +03:00
Ivan Kylchik
0a28e5e031 Add argument unwrapping for case when argument is named 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
2e2099afae [FIR] Introduce NOT_AN_ANNOTATION_CLASS diagnostic 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
8fd087a964 [FIR] Don't report duplicated UNRESOLVED_REFERENCE on annotation entries 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
a6e811a67a [FIR] Add status to Java annotation constructor (fix after rebase) 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
8379b3794a [FIR2IR] Return fallback mode for annotation resolved placeholder 2020-08-04 08:59:15 +03:00
Dmitriy Novozhilov
b63257345b [FIR] Map Class to KClass in java annotations 2020-08-04 08:59:15 +03:00
Mikhail Glukhikh
282a295d43 [FIR] Enable arrayOf transformer in completion (inside annotations) 2020-08-04 08:59:14 +03:00
Dmitriy Novozhilov
721b9b4d8c [FIR] Resolve annotations as calls 2020-08-04 08:59:14 +03:00
Dmitriy Novozhilov
bc1fa8ed7f [FIR] Add constructor for java annotations 2020-08-04 08:59:14 +03:00
Dmitriy Novozhilov
644e9843f9 [FIR] Add initialization of calleeReference for FirAnnotationCall 2020-08-04 08:59:14 +03:00
Dmitriy Novozhilov
614291b2cc [FIR] Make FirAnnotationCall resolvable 2020-08-04 08:59:14 +03:00
Dmitriy Novozhilov
ffd30566be [FIR] Add FirErrorResolvedQualifier for qualifiers with resolve diagnostic 2020-08-04 08:59:14 +03:00
Dmitry Gridin
a5e9401a0a [configuration] change updater number to 1.4.* and 1.5.*
#KT-40639 Fixed
2020-08-04 11:13:30 +07:00
Julian Kotrba
88f508446a Make repeat example more expressive
This commit adds the zero-based index of current iteration from the passed HOF "action" of the repeat function to its associated code sample.

KT-20357
2020-08-04 00:48:06 +03:00
Ilya Gorbunov
a5178bb826 Minor: fix toJavaDuration docs 2020-08-04 00:34:15 +03:00
Ilya Gorbunov
99eb7f391b Fix doc wording around covariance/invariance 2020-08-04 00:33:05 +03:00
Roman Artemev
4f73e08704 [KLIB] Make fake override resolver garbage free as much as possible
- reduce memory pollution during FO resolve
2020-08-03 19:22:07 +03:00
Roman Artemev
876ee265f2 [KLIB] Fix memory leak in fake override resolver 2020-08-03 19:22:07 +03:00
Roman Artemev
e189cb1895 [KLIB] Fix memory leak in linker through haveSeen set 2020-08-03 19:22:06 +03:00
Roman Artemev
19b5fda750 [KLIB] Do not duplicate origin mapping per file 2020-08-03 19:22:06 +03:00
Roman Artemev
c253042948 [KLIB] Reduce amount of descriptors loaded during desc-idSig resolution 2020-08-03 19:22:06 +03:00
Roman Artemev
851c287105 [KLIB] Use SoftReference to hold proto memory
- fix metadata memory leak for KT-40345
2020-08-03 19:22:06 +03:00
Roman Artemev
add0ad6733 [KLIB] Change KLIB IO API
- Use ReadBuffer instead of native java buffer
 - Use Weak buffers for File IO
 - fix klib memory leak for KT-40345
2020-08-03 19:22:06 +03:00
Jinseong Jeon
0e54f98b79 FIR: support adapted callable reference with vararg 2020-08-03 16:37:36 +03:00
Mikhail Glukhikh
4332e95b8a [FIR] Don't transform setter parameter type if it's given explicitly 2020-08-03 16:37:30 +03:00
vldf
8813ebd950 [FIR] Add RedundantSetterParameterType Checker 2020-08-03 16:37:24 +03:00
vldf
a6c9d869fb [FIR] Move RedundantCallOfConversionMethod to extended checkers 2020-08-03 16:31:49 +03:00
vldf
3349739d1e [FIR] Fixes for RedundantReturnUnitType checker 2020-08-03 11:42:19 +03:00
vladislavf7@gmail.com
2384afdd93 [FIR] refactoring for running extended checkers 2020-08-03 11:42:19 +03:00
vldf
cfc09048c6 [FIR] Add RedundantCallOfConversionMethod checker 2020-08-03 10:41:19 +03:00
Mikhail Glukhikh
39d4b79324 [FIR TEST] Fix FE 1.0 / FIR test data for nested / local type alias case 2020-08-02 18:19:47 +03:00
Mikhail Glukhikh
7724d060ff [FIR] Don't compare SYNTAX diagnostics in light tree diagnostic test 2020-08-02 18:19:47 +03:00
Mikhail Glukhikh
4e4fe9f719 [FIR] Support some kinds of fake sources in light builder 2020-08-02 18:19:47 +03:00
Mikhail Glukhikh
951aa8185e [FIR] Avoid duplicate diagnostics on expression.typeRef 2020-08-02 18:19:47 +03:00
Mikhail Glukhikh
dc46d51d9a [FIR TEST] Update diagnostic spec test data 2020-08-02 18:19:47 +03:00
Mikhail Glukhikh
6eab6f2f87 [FIR TEST] Replace OTHER_ERROR with UNRESOLVED_REFERENCE in test data 2020-08-02 18:19:47 +03:00
Nick
c55cdf1935 [FIR] Fix missing ErrorTypeRef for QA and clean DiagnosticCollector 2020-08-02 18:19:46 +03:00
Nick
7086b0cbf3 [FIR] Don't report duplicated errors in component calls typeRefs 2020-08-02 18:19:46 +03:00
Nick
4ceae8dc5e [FIR] Don't report duplicated errors in function calls typeRefs 2020-08-02 18:19:46 +03:00
Nick
6f85a07290 [FIR] Don't report duplicated errors in property declarations 2020-08-02 18:19:46 +03:00
Nick
889324e972 [FIR] Ignore failing test, improve DiagnosticKind, fix UPPER_BOUND 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
9335e09149 [FIR] Don't report duplicated errors in implicit properties / parameters 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
ceaffb1e8b [FIR] Don't report duplicated errors in implicit primary constructors 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
749346b73b [FIR] Don't report duplicated errors on default accessor error type refs 2020-08-02 18:19:45 +03:00
Mikhail Glukhikh
e0d25876b0 [FIR] Don't report simple diagnostics on fake sources 2020-08-02 18:19:44 +03:00
Mikhail Glukhikh
551bdd267d [FIR] Introduce WRONG_NUMBER_OF_TYPE_ARGUMENTS diagnostic 2020-08-02 18:19:44 +03:00
Mikhail Glukhikh
0804c6a0f3 [FIR] Introduce TYPE_ARGUMENTS_NOT_ALLOWED & some other type errors
This commit introduces several different things, in particular:
- check type arguments in expressions
- new TypeArgumentList node to deal with diagnostic source
- ConeDiagnostic was moved to fir:cones
- ConeIntermediateDiagnostic to use in inference (?) without reporting
- detailed diagnostics on error type
2020-08-02 18:19:44 +03:00
Jinseong Jeon
c744dfba9c FIR: distinguish anonymous object as enum entry when scoping
so that `this` reference with the enum entry name as label can be
resolved
2020-08-02 18:06:15 +03:00
Jinseong Jeon
52631b7abd FIR2IR: make local storage track scopes, including anonymous init 2020-08-02 18:05:09 +03:00
Nick
26e3a111d6 [FIR] Add diagnostics for object related problems 2020-07-31 19:34:55 +03:00
Nick
694d3cad4e [FIR] Exposed visibility checker: optimize checks for local visibility 2020-07-31 19:28:10 +03:00
Nick
60462bea1c FirEffectiveVisibilityResolver: search parent in containingDeclarations
When determining effective visibility of 'something',
we use containing declarations from the context to find 'something'
parent, to avoid calling getClassSymbolByFqName for all cases.
2020-07-31 19:28:04 +03:00
Nick
7145caca40 [FIR] Refactor effective visibility calculation
Before this commit, we had effective visibility as a part of FIR status,
so it was integrated into the full pipeline. In this commit,
we introduced "effective visibility as a service" which is now used
only by exposed visibility checker. This allows us to make the thing
universal for all FIR nodes, including nodes for Java / deserialized.
2020-07-31 19:27:58 +03:00
Steven Schäfer
b15e32936e JVM IR: Optimize delegated properties (KT-36814) 2020-07-31 19:00:27 +03:00
vldf
8724efbe8a [FIR] Add empty range checker 2020-07-31 16:28:37 +03:00
vldf
b10defdbab [FIR] Add redundant single string expression template checker 2020-07-31 16:28:37 +03:00
vldf
95e0ba3d5c [FIR] Add ArrayEqualityOpCanBeReplacedWithEquals checker 2020-07-31 16:28:37 +03:00
Ilmir Usmanov
4d21a496fe Minor. Update tests 2020-07-31 14:33:52 +02:00
Dmitry Petrov
e11c90f26c JVM_IR: KT-40293 Box return type for DefaultImpls methods if required 2020-07-31 14:48:12 +03:00
Ilya Chernikov
034d5a948c Add JvmDefault to the new EP method for compatibility with older impls 2020-07-31 12:07:10 +02:00
Ilmir Usmanov
fa8c6deb18 Support restricted suspend lambdas in JVM_IR
#KT-40135 Fixed
2020-07-30 20:40:37 +02:00
Ilmir Usmanov
2c205410fa Check whether the field is indeed being initialized
in checkFieldInExactlyOnceLambdaInitialization
 #KT-40691 Fixed
2020-07-30 19:04:54 +02:00
Nikolay Krasko
d8b76f5b26 Register additional repository id 2020-07-30 19:33:58 +03:00
Vladimir Ilmov
7eca13569b (CoroutineDebugger) Enable agent for versions 1.3.8.*
Gradle artifact name gets changed from 'kotlinx-coroutines-core' to
'kotlinx-coroutines-core-jvm'. So it should support both.
2020-07-30 17:54:35 +02:00
Toshiaki Kameyama
c91858d470 Convert member to extension: do not suggest for delegated properties
#KT-35128 Fixed
2020-07-30 17:32:31 +03:00
Dmitry Petrov
46fccae7d1 PSI2IR: KT-40499 Fix delegated property desugaring
No type arguments were provided for property reference inside delegated
property accessors.
2020-07-30 13:18:36 +03:00
Jinseong Jeon
bff36e0199 FIR2IR: convert annotations on FirTypeRef 2020-07-30 11:25:36 +03:00
Georgy Bronnikov
4ca98041cd IR: update test data 2020-07-30 11:24:08 +03:00
Georgy Bronnikov
a27d63f58f JVM_IR: flexible nullability as annotation
We carry information about flexible nullability of IrType as an
annotation, so there is no need to look at its underlying KotlinType.
2020-07-30 11:24:07 +03:00
Georgy Bronnikov
a2e9521ad5 Make DescriptorlessExternalPackageFragmentSymbol public 2020-07-30 11:24:07 +03:00
Georgy Bronnikov
c2ead0303b IR: remove more descriptor usage 2020-07-30 11:24:07 +03:00
Alexander Gorshenev
9a717e9ecf Don't copy default value parameters for fake overrides 2020-07-29 22:15:10 +03:00
Mark Punzalan
2cfd776092 ForLoopsLowering: Assume step == 1 for *Range (e.g., IntRange) and
handle accordingly (e.g., do not read `step` property).
2020-07-29 20:44:51 +02:00
Dmitry Petrov
09e47fff7b Fix KotlinGradleIT.testCustomCompilerFile
Referencing org.jetbrains.annotations.{Nullable, NotNull} classes in
static initializer causes ClassNotFoundError in testCustomCompilerFile.
2020-07-29 20:33:17 +03:00
Dmitry Petrov
dae358c792 JVM: KT-40664 disable optimization for 'ULong in range of UInt' case 2020-07-29 20:33:17 +03:00
Dmitry Petrov
f2493d0950 JVM: KT-40665 more exact check for intrinsified range 'contains' 2020-07-29 20:33:17 +03:00
Roman Artemev
0559e192ee [JS IR] Support external delegation in case of JS in psi2ir
- fix FE delegation resolver
 - fix critical KT-40650
2020-07-29 19:57:05 +03:00
Nicolay Mitropolsky
c254651ed3 Uast: handling annotations on the property receiver (KT-40539) 2020-07-29 19:42:22 +03:00
Yaroslav Chernyshev
325ad56dcd Populate Kotlin source set roots with KotlinSourceRootTypes
By default Kotlin source root is populated with JavaSourceRootType and
changed during import only if real source folder exists.
Now Kotlin source roots has valid source type right after creation

#KT-37106 Fixed
2020-07-29 19:24:44 +03:00
Ilmir Usmanov
fec845365a Minor. No longer ignore obsolete PRE_RELEASE_CLASS diagnostic
in coroutine tests.
2020-07-29 17:52:01 +02:00
Simon Ogorodnik
ebfcd7e074 J2K: Improve presentation of conversions 2020-07-29 17:56:03 +03:00
Simon Ogorodnik
5c745facf4 J2K: Improve error message in case of incorrect detach 2020-07-29 17:56:02 +03:00
Simon Ogorodnik
dc963e4ff6 Improve J2K progress reporting 2020-07-29 17:56:02 +03:00
Simon Ogorodnik
8bcf1000f6 J2K: Fix java 9 try-with-resources 2020-07-29 17:56:02 +03:00
Simon Ogorodnik
c5005f8695 J2K: Speed-up add imports 2020-07-29 17:56:01 +03:00
Simon Ogorodnik
cd0c644654 J2K: Fix incorrect early detaching of elements in for conversion 2020-07-29 17:56:00 +03:00
Simon Ogorodnik
8c2dd876b5 J2K: Fix incorrect argument remapping when introducing defaults 2020-07-29 17:56:00 +03:00
Simon Ogorodnik
cd7ac55091 J2K: Show converted/total file counts 2020-07-29 17:55:59 +03:00
Simon Ogorodnik
468af0bb85 J2K: Fix type parameters in LHS of callable reference 2020-07-29 17:50:10 +03:00
Leonid Startsev
96d0b1c47a Update serialization runtime and fix test data
Revert "Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests"
2020-07-29 14:20:33 +03:00
Nikolay Krasko
a6a22d1cde Revert "Populate Kotlin source set roots with KotlinSourceRootTypes"
This reverts commit e2634190
2020-07-29 12:05:42 +03:00
Yaroslav Chernyshev
e263419088 Populate Kotlin source set roots with KotlinSourceRootTypes
By default Kotlin source root is populated with JavaSourceRootType and
changed during import only if real source folder exists.
Now Kotlin source roots has valid source type right after creation

#KT-37106 Fixed
2020-07-29 10:26:42 +03:00
Ilmir Usmanov
4fb5f8603a Keep $continuation in LVT
in case of suspend functions and `this` is case of lambdas, since they
are used in async stack trace generation.
Update tests.
 #KT-40661 Open
2020-07-29 00:01:12 +02:00
Ilmir Usmanov
db40808186 Minor. Remove unused SourceFrames 2020-07-29 00:01:11 +02:00
Ilmir Usmanov
70e91bd5db Shrink and split LVT records of variables according to their liveness
Otherwise, debugger will show uninitialized values of dead variables
after resume.
 #KT-16222
 #KT-28016 Fixed
 #KT-20571 Fixed
2020-07-29 00:01:10 +02:00
Ilmir Usmanov
e5995f0c12 Update R8
Because old version throws assertion error if parameter's LVT record
does no span the whole function.
2020-07-29 00:01:10 +02:00
Ilmir Usmanov
60875f96b4 Do not take LVT into account when calculating liveness of variables 2020-07-29 00:01:09 +02:00
Alexander Udalov
687d13a320 IR: cleanup expression implementations
Remove unused constructors with descriptors, minimize usages of
secondary constructors and make some properties non-lateinit, fix some
inspections.
2020-07-28 20:05:58 +02:00
Alexander Udalov
e36d3ba4f6 IR: remove IrNoArgumentsCallableReferenceBase
To simplify transformation of IR element hierarchy to classes.
2020-07-28 20:05:57 +02:00
Dmitriy Novozhilov
f270cd8d6e [FIR] Update testdata due to lack of callee reference in FirResolvedQualifier 2020-07-28 20:47:07 +03:00
Dmitriy Novozhilov
f283f2db43 [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible
Also introduce few new diagnostics:
- NONE_APPLICABLE more many inapplicable candidates
- HIDDEN for visible candidates
2020-07-28 20:46:56 +03:00
anastasiia.spaseeva
5c0528b61e [Spec tests] Add tests for primary constructors declaration 2020-07-28 20:26:33 +03:00
anastasiia.spaseeva
0488dc985f [Spec tests] Add tests for intersection and OR 2020-07-28 20:26:32 +03:00
anastasiia.spaseeva
46774fb6d6 [Spec tests] Add call without an explicit receiver tests for top-level non-extension functions 2020-07-28 20:26:32 +03:00
anastasiia.spaseeva
bef59055cd [Spec tests] Fix test cases structure 2020-07-28 20:26:31 +03:00
anastasiia.spaseeva
4ad3847224 [Spec tests] Add tests for subtyping rules for simple classifier type 2020-07-28 20:26:30 +03:00
anastasiia.spaseeva
1801344c76 [Spec tests] Add tests for inner-and-nested-type-contexts section 2020-07-28 20:26:29 +03:00
anastasiia.spaseeva
d5ddb26180 [Spec tests] Add overload resolution tests for plus assign operator call 2020-07-28 20:26:28 +03:00
anastasiia.spaseeva
1d83c59e80 [Spec tests] Actualize test for callable reference section 2020-07-28 20:26:27 +03:00
anastasiia.spaseeva
4db209648d [Spec tests] Update spec version 2020-07-28 20:26:26 +03:00
anastasiia.spaseeva
3f862830f2 [Spec tests] Add tests for resolving callable references and some co-tests 2020-07-28 20:26:24 +03:00
anastasiia.spaseeva
cfbfec77a5 [Spec tests] Add tests for Algorithm of MSC selection 2020-07-28 20:26:23 +03:00
anastasiia.spaseeva
73850e97d7 [Spec tests] Add test for Coercion to Unit error diagnostics absence 2020-07-28 20:26:22 +03:00
anastasiia.spaseeva
26ac87d9be [Spec tests] Update spec testData 2020-07-28 20:26:21 +03:00
Alexander Udalov
f240d51d2c IR: do not inherit IrFakeOverride* from IrFunction/IrProperty
This will help to reduce boilerplate after making the latter classes.

Without this change, IrFunctionCommonImpl would not be able to be a
class because it would introduce a diamond class hierarchy, and thus
that would require copying all its contents to IrFunctionImpl and
IrFakeOverrideFunctionImpl.
2020-07-28 19:05:12 +02:00
Alexander Udalov
4892737cc9 Use IrFactory in kotlin-serialization-compiler 2020-07-28 19:04:44 +02:00
Alexander Udalov
0909894a96 PIR: make most implementations and carriers internal 2020-07-28 19:04:44 +02:00
Alexander Udalov
cce55f1609 IR: add module ir.tree.impl, move main IR implementation there 2020-07-28 19:04:44 +02:00
Alexander Udalov
77247deb23 IR: add module ir.tree.persistent, copy PIR implementation there
Use PersistentIrFactory in JS IR compiler entry points.
2020-07-28 19:04:43 +02:00
Alexander Udalov
9aed92d2dd Partially revert "Persistent IR implementation"
This partially reverts commit f437da8ee5.
Changes related to carriers and others are still there. They will be
moved out to a separate module in a subsequent commit.
2020-07-28 19:04:43 +02:00
Dmitry Petrov
980b91d082 JVM: generate 'Deprecated' on method as runtime-visible annotation
We generate @java.lang.Deprecated annotation on methods of $DefaultImpls
classes in compatibility mode. This annotation has RUNTIME retention and
should be visible.

Also, get rid of representing annotations as Class'es (yes we know that
these annotations are in compiler CLASSPATH, but we should not rely on
such classes and associated information).
2020-07-28 18:19:20 +03:00
Dmitry Petrov
4fdccb3b35 JVM_IR: don't generate repeated ElementType values in @Target 2020-07-28 18:19:20 +03:00
Ilya Goncharov
c065210b56 [Gradle, JS] Reuse task requirements
^KT-39825 fixed
2020-07-28 18:17:05 +03:00
Ilya Goncharov
9a3ae4f4fa [Gradle, JS] Common webpack configuration
^KT-39825 fixed
2020-07-28 18:16:51 +03:00
vldf
a2b26c00a1 Uncommented ControlFlowAnalysisBenchmark 2020-07-28 17:10:02 +03:00
vldf
fca0b7fedd [FIR] Add CFA benchmark 2020-07-28 14:30:40 +03:00
vldf
d7b3a86f5e [FIR] Add "can be val" extended checker 2020-07-28 14:17:38 +03:00
Jinseong Jeon
da6e96f4f1 FIR2IR: don't declare dispatch receiver for local functions 2020-07-28 13:43:10 +03:00
Jinseong Jeon
5a3367e09c FIR: initial support of suspend conversion for function reference 2020-07-28 13:37:05 +03:00
Alexander Udalov
b9243aad24 Minor, fix test data in bytecodeListing/specialBridges 2020-07-28 12:12:39 +02:00
Alexander Udalov
df324d5a08 IR: pull up common accept/transform implementations to interfaces
To avoid duplicating them among the main, persisting, lazy, and
fir2ir-lazy implementations.

Also reformat a bit, and avoid storing descriptor in a field in some
places.
2020-07-28 12:05:24 +02:00
Alexander Udalov
12d2a02d22 JS IR: drop JsIrDeclarationBuilder
Move buildValueParameter back to JsIrBuilder, and use common IR builders
directly where buildFunction was called.
2020-07-28 12:05:24 +02:00
Alexander Udalov
0d605a6b7f IR: create IrBlockBody via IrFactory 2020-07-28 12:05:24 +02:00
Alexander Udalov
9ad4a754ce IR: create IrExpressionBody via IrFactory 2020-07-28 12:05:24 +02:00
Alexander Udalov
d1dc938a5d IR: use IrFactory in IR builders 2020-07-28 12:05:24 +02:00
Alexander Udalov
898dd20a9e IR: use IrFactory in misc utils 2020-07-28 12:05:23 +02:00
Alexander Udalov
f359f36ed9 IR: add IrFactory to IrDeclaration, use in deep copy 2020-07-28 12:05:23 +02:00
Alexander Udalov
305288aa82 IR: use IrFactory in psi2ir 2020-07-28 12:05:23 +02:00
Alexander Udalov
8c41ba8ee4 IR: use IrFactory in fir2ir 2020-07-28 12:05:23 +02:00
Alexander Udalov
9356f87f28 IR: use IrFactory in linker 2020-07-28 12:05:23 +02:00
Alexander Udalov
db4cbe7103 IR: use IrFactory in SymbolTable 2020-07-28 12:05:23 +02:00
Alexander Udalov
c6a127e87e IR: introduce IrFactory
This is needed to refactor IrPersistingElementBase-based implementations
into another module, to use it in JS IR.
2020-07-28 12:05:23 +02:00
Kirill Shmakov
96968cd9c9 Fix build after rebasing 2020-07-28 12:55:38 +03:00
Kirill Shmakov
96160cbb55 Adapt AS wizard to changes in main wizard 2020-07-28 12:26:19 +03:00
Kirill Shmakov
5c8833f608 Wizard: improve mobile app template 2020-07-28 12:26:19 +03:00
Ilya Kirillov
63fa6674a3 Wizard: temporary add ios shortcut target
Temporary as it will not be needed when HMPP wizard will be ready
2020-07-28 12:26:19 +03:00
Ilya Kirillov
f330cd3697 Wizard: relocate AndroidManifest.xml for MPP module 2020-07-28 12:26:19 +03:00
Ilya Kirillov
b3d48cda8c Wizard: add common tests for iOS/Android template 2020-07-28 12:26:19 +03:00
Ilya Kirillov
5ffcaf6508 Wizard: add shared code for iOS/Android template
fix android
2020-07-28 12:26:19 +03:00
Ilya Kirillov
66c756ad0f Wizard: add ability for wizard to generate expected/actual declarations in MPP module 2020-07-28 12:26:18 +03:00
Ilya Kirillov
7d1036ee7e Wizard: use property for storing module dependency 2020-07-28 12:26:18 +03:00
Ilya Kirillov
dbc43b66bf Wizard: introduce ModuleConfiguratorProperty 2020-07-28 12:26:18 +03:00
Ilya Kirillov
74d6919c7c Wizard: wrap property into PluginProperty for plugin properties 2020-07-28 12:26:18 +03:00
Ilya Kirillov
3c3ba361e8 Wizard: specify path for plugin entities in one place 2020-07-28 12:26:18 +03:00
Ilya Kirillov
c05c72387e Wizard: fix node js templates 2020-07-28 12:26:18 +03:00
aleksandrina-streltsova
63e2d771b3 Get rid of reflection in new project wizard core: manually specify properties in plugins 2020-07-28 12:26:17 +03:00
Ilya Kirillov
cc35529b9a Wizard: get rid of reflection: specify plugin path by hand 2020-07-28 12:23:57 +03:00
Ilya Kirillov
3ed11c0491 Wizard: get rid of reflection: force plugins to specify settings & tasks directly 2020-07-28 12:23:57 +03:00
vldf
eadd3f00f2 [FIR] Add CanBeReplacedWithOperatorAssignmentChecker 2020-07-28 10:13:28 +03:00
Kevin Bierhoff
fa8c6e7fb6 Uast: KT-40578: resolve Kotlin property writes to setters (#3597)
* KT-40578: resolve Kotlin property writes to setters

* limit to non-constructor properties

* Uast: `KotlinIDERenderLogTest.testConstructors` fix

Co-authored-by: Nicolay Mitropolsky <nicolay.mitropolsky@jetbrains.com>
2020-07-28 10:03:22 +03:00
Sergey Bogolepov
5851a7dea0 [kotlinx-metadata-klib] Proper support for nullable enum entry fields 2020-07-28 11:59:17 +07:00
Sergey Rostov
45f0328f21 scripting: preload scripting support plugins 2020-07-27 19:44:03 +00:00
Sergey Rostov
b5e04378ed scripting, ucache: don't init caches at start up
init it in async instead. all usages will be updated thanks to
highlighting/reindexing that is called after cache is constructed.

#KT-40242 Fixed
2020-07-27 19:44:03 +00:00
Dmitry Petrov
43fcb2330e JVM_IR: fix source file name for mutlifile class facades 2020-07-27 19:13:37 +03:00
Dmitry Petrov
89a0b3e944 Check class source in bytecode listing tests 2020-07-27 19:13:37 +03:00
Dmitriy Dolovov
b47946cbba Report interop functions with non-stable parameter names
^KT-34602
2020-07-27 23:11:36 +07:00
Dmitriy Dolovov
3d9093583f Metadata: 'non-stable parameter names' flag for callables
^KT-34602
2020-07-27 23:11:30 +07:00
Ilya Goncharov
8cace2bab4 [Gradle, JS] Add tests on kotlin/js module with js files 2020-07-27 19:00:12 +03:00
Ilya Goncharov
0b88f457e8 [Gradle, JS] Use .meta.js as source of "name" and "main" fields
^KT-40342 fixed
2020-07-27 19:00:12 +03:00
Victor Petukhov
cca64b8fab NI: use the inferred type to check of nullable array for vararg
^KT-40555 Fixed
2020-07-27 18:24:31 +03:00
Steven Schäfer
9d63412b3e JVM IR: Produce correct generic signatures for special bridge methods 2020-07-27 17:02:24 +02:00
Steven Schäfer
c16b548dff JVM IR: Don't produce annotations on builtin stub, toArray, and bridge methods 2020-07-27 17:02:24 +02:00
Andrei Klunnyi
f661b7604b KT-40557 Scratch: .kt files are treated as Kotlin scratches, opening fails
https://ea.jetbrains.com/browser/ea_problems/224367
2020-07-27 15:36:02 +02:00
Andrei Klunnyi
0e46a980f6 EA- 235760 // additional logging
https://ea.jetbrains.com/browser/ea_problems/235760
2020-07-27 15:36:00 +02:00
Andrei Klunnyi
c27453632e EA-235769 // StringIndexOutOfBoundsException
https://ea.jetbrains.com/browser/ea_problems/235769
2020-07-27 15:35:59 +02:00
Andrei Klunnyi
4afa50e081 EA-235759 // NPE fix
https://ea.jetbrains.com/browser/ea_problems/235759
2020-07-27 15:35:58 +02:00
Andrei Klunnyi
29281fd0bf EA-235761 // NPE fix
https://ea.jetbrains.com/browser/ea_problems/235761
2020-07-27 15:35:57 +02:00
Andrei Klunnyi
e63951c38c EA-235765 // NPE at refactoring suggestion
Fixed exception:
java.lang.NullPointerException: null cannot be cast to non-null type
org.jetbrains.kotlin.descriptors.CallableDescriptor

More info: https://ea.jetbrains.com/browser/ea_problems/235765
2020-07-27 15:35:55 +02:00
Dmitry Gridin
e8fd69fde1 [formatter] fix infinite recursion
Already exists in the new repo: original-hash e7ea6926a8a414ab6082299d99239ad167ab75a2

#KT-40636 Fixed
2020-07-27 19:56:19 +07:00
Ryan Nett
b1173317c5 Change scripting Severity enums to order from DEBUG to FATAL.
#KT-39502 fixed
2020-07-27 14:29:30 +02:00
Konstantin Tskhovrebov
59f6c0c273 Add flag for avoid double MPP gradle module resolve. 2020-07-27 15:11:48 +03:00
Ilya Goncharov
5444ffaf4b [Gradle, JS] Deprecate produceExecutable
^KT-40568 fixed
2020-07-27 14:44:47 +03:00
Ilya Goncharov
d9c269ed6b [Gradle, JS] Disable binaries.executable by default in wizard
^KT-40461 fixed
2020-07-27 14:35:45 +03:00
Natalia Selezneva
8d1f9df802 Do not show warning when multiple Gradle Definitions are loaded
This will happen when there are multiple gradle project linked to one IDEA project
andthey have different gradle versions
2020-07-27 13:08:01 +03:00
Ilya Matveev
a62f65940d Gradle, CocoaPods: Use synthetic dir as a working dir for pod gen
'Pod gen' creates an empty folder named 'Pods' in a directory where it
is executed. Earlier, 'pod gen' was executed in a project root
directory, so this `Pods` folder was created in a VCS-controlled
place. This patch fixes this issue by running 'pod gen' in a directory
where the synthetic project is located.
2020-07-27 10:02:07 +00:00
Ilya Matveev
7c3eda31fa Gradle, CocoaPods: Fix non-compilable dummy header
Issue #KT-39999 fixed
2020-07-27 10:02:07 +00:00
Ilya Matveev
85908713b1 Gradle, CocoaPods: Support pods with dashes in names
See https://github.com/JetBrains/kotlin-native/issues/2884
2020-07-27 10:02:06 +00:00
Zalim Bashorov
635869f15a Rewrite className helper to fix tests on android
Since android tests preprocess test data and
(at least) replace package for files and fix package usages
it's preferred to use fqnames explicitly
instead of assembly them from parts, as it was before.
2020-07-25 15:28:36 +03:00
Mikhail Glukhikh
0ded1d7006 FirBasedSignatureComposer: generate better error messages 2020-07-24 19:47:28 +03:00
Mikhail Glukhikh
40256aa43d Fir2IrLazyClass: generate enum values() / valueOf() properly 2020-07-24 19:47:28 +03:00
Mikhail Glukhikh
8bae0f2d0c [FIR2IR] Handle local visibility around signature composer properly 2020-07-24 19:47:27 +03:00
Mikhail Glukhikh
828524bde4 [FIR2IR] Fix conversion of default vararg arguments for annotations 2020-07-24 19:47:27 +03:00
Mikhail Glukhikh
240baa64a5 Fir2IrConverter: initialize call generator earlier to avoid lateinit err 2020-07-24 19:47:26 +03:00
Mikhail Glukhikh
2b52988f1b [FIR TEST] Add failing BB test with Deprecated annotation 2020-07-24 19:47:19 +03:00
Denis Zharkov
df1719c64c Fix incorrect mixed named/positioned arguments in project code
^KT-40404 Fixed
2020-07-24 13:36:52 +03:00
Denis Zharkov
dc6efa5a61 Fix incorrect handling of mixed named/positional arguments
^KT-40404 Fixed
2020-07-24 13:36:52 +03:00
Mikhail Bogdanov
d083297366 Support additional flags in MPP tests. Add diagnostic tests for defaults 2020-07-24 12:10:04 +02:00
Mikhail Bogdanov
125c72cb8d New default checks for mixed hierarchies
Old and new schemes
2020-07-24 12:10:04 +02:00
Denis Zharkov
de02b31ad7 FIR: Use phasedFir in resolve
^KT-40376 Fixed
2020-07-24 12:32:29 +03:00
Yaroslav Chernyshev
0de29e641d Fixed bug with pureKotlinSourceFolders for common modules 2020-07-24 12:22:00 +03:00
Yaroslav Chernyshev
142bd2e009 Filtering pureKotlinSourceFolders for existing package directories 2020-07-24 12:21:59 +03:00
Yaroslav Chernyshev
e6670d439f Small renaming classifier -> disambiguationClassifier 2020-07-24 12:21:58 +03:00
Yaroslav Chernyshev
96d9dad429 Fixed tests for pureKotlinSourceFolders by extending created facets 2020-07-24 12:21:57 +03:00
Yaroslav Chernyshev
f490085142 Support pureKotlinSourceFolders for MPP projects
#KT-34271 Fixed
#KT-32963 Fixed
2020-07-24 12:21:57 +03:00
nataliya.valtman
fde8a34c32 KT-40058 NPE from mpp gradle plugin on kotlinx.benchmarks 2020-07-24 10:46:45 +03:00
Ivan Kylchik
bc41681a2e Fix gradle import error after introducing new gradle task in benchmarks 2020-07-23 21:18:32 +03:00
Vyacheslav Gerasimov
96ac6e612d Build: Replace androidIdeTest task with kaptIdeTest
We dont run android ide tests anymore
2020-07-23 19:18:18 +03:00
Vyacheslav Gerasimov
803d24cd42 Build: Remove pluginTests task and deduplicate kapt test task 2020-07-23 19:18:17 +03:00
Vyacheslav Gerasimov
ee642e69b0 Build: Introduce mainIdeTests task 2020-07-23 19:18:17 +03:00
Dmitry Petrov
e2a4ca10d6 JVM_IR: fix inner class attributes for private class in interface 2020-07-23 19:13:28 +03:00
Dmitry Petrov
0741781462 Compare inner class access flags in bytecode listing tests 2020-07-23 19:13:28 +03:00
Natalia Selezneva
8d894929ae Minor: unify logging in scripting 2020-07-23 16:31:32 +03:00
Natalia Selezneva
8a6cdcba29 Do not hold a lock during loading script templates from dependencies
^KT-40383 Fixed
2020-07-23 16:24:13 +03:00
Natalia Selezneva
493c287bb0 Minor: fix notification text when script configuration is missing after request 2020-07-23 16:20:57 +03:00
Ivan Kylchik
265873becd Comment out runBenchmark tasks due to gradle import error 2020-07-23 15:20:35 +03:00
Roman Golyshev
be06c51aa7 KT-40363 Handle non-octal int literals in for-loop conversions
- See EA-210233
- ^KT-40363 Fixed
2020-07-23 11:24:48 +00:00
Roman Golyshev
cba671a3ef KT-40359 Catch NumberFormatException during literal conversion
- Instead of failing J2K conversion completely, insert TODO expression
to the resulting code (it is better to have a converted code with TODO
than to have nothing at all)
- See EA-210233 for similar exceptions
- ^KT-40359 Fixed
2020-07-23 11:24:48 +00:00
Roman Golyshev
cc0a787735 Add null-checking to KotlinIdeaResolutionException constructors
- NPE here leads to loosing the actual exception
- EA-235059 Fixed
2020-07-23 11:24:47 +00:00
Nicolay Mitropolsky
f7031e65ba Uast: don't throw exception if can't get a receiver parameter for annotation (KT-40494) 2020-07-23 10:33:44 +03:00
Jinseong Jeon
7872b21914 FIR: handle object invoke via type alias 2020-07-23 09:34:42 +03:00
Svyatoslav Kuzmich
4a803e9d2f [JS IR] Support object declaration export
Fixes KT-39117 and KT-39367
2020-07-23 08:21:59 +03:00
Svyatoslav Kuzmich
4027dae594 [JS] Add js/js.translator/testData/package-lock.json 2020-07-23 08:21:57 +03:00
Natalia Selezneva
be371c9294 Remove optimization in KotlinScriptDependenciesClassFinder
Scope can contains only classes for one script,
but allScriptDependenciesScope contains classes for all scripts
2020-07-23 00:00:51 +03:00
Natalia Selezneva
be8374a1a8 Minor: fix comments 2020-07-23 00:00:50 +03:00
Natalia Selezneva
e708e3f1c5 Do not suggest to load gradle.kts configurations after project reopening
For projects with distributionType=WRAPPED
Workaround for KT-40394

The original problem is that GradleInstallationManager.resolveGradleVersion returns null is case of distributionType=WRAPPED

^KT-40394 Fixed
2020-07-23 00:00:50 +03:00
Natalia Selezneva
300e9581de Fix UI for Kotlin Scripting page
Show 15 items in the list by default
Show hint at the top
Fixed for 201+

^KT-40097 Fixed
2020-07-22 23:49:47 +03:00
Natalia Selezneva
dd20b9062a Completion for script inside module should provide classes from related module
^KT-35825 Fixed
2020-07-22 23:49:47 +03:00
Alexander Udalov
65d3ae6253 JS IR: move declaration creation from IrBuilder to JsIrDeclarationBuilder
This is a temporary class until IrDeclarationFactory is there.
2020-07-22 22:40:08 +02:00
Alexander Udalov
d3a34a8898 Psi2Ir: somewhat simplify Psi2IrTranslator API
Inline some methods only used once, deduplicate usages, rearrange
parameters, etc.
2020-07-22 22:38:21 +02:00
Alexander Udalov
241f82c70f IR: avoid storing unnecessary fields in IrPropertyImpl 2020-07-22 22:38:21 +02:00
Alexander Udalov
3f06f8a6ba IR: avoid storing unnecessary fields in IrFunctionImpl 2020-07-22 22:38:20 +02:00
Alexander Udalov
517c3e1020 IR: introduce IrFakeOverrideFunction, IrFakeOverrideProperty
Use them instead of the implementations. This will allow to refactor
creation to a factory and allow to use other implementations in the
future.
2020-07-22 22:38:20 +02:00
Alexander Udalov
ca5eb40fa5 IR: minor, avoid usages of IrBlockBodyImpl/IrExpressionBodyImpl 2020-07-22 22:38:20 +02:00
Mark Punzalan
174576af61 ForLoopsLowering: Handle Sequence<*>.withIndex(). 2020-07-22 22:32:29 +02:00
Mark Punzalan
132960a695 ForLoopsLowering: Eliminate use of @ObsoleteDescriptorBasedAPI. 2020-07-22 22:32:29 +02:00
Mark Punzalan
b1ce21bc55 ForLoopsLowering: Reduce unnecessary temporary variables for the
"checked step" (check for a positive step arg) and "negated step"
(negate the step arg when the nested step is negative).
2020-07-22 22:32:29 +02:00
Mark Punzalan
291d62f653 ForLoopsLowering: Move handlers to sub-package and separate files. 2020-07-22 22:32:29 +02:00
Ivan Kylchik
44d283eb07 Fix FIR benchmark memory leak 2020-07-22 20:18:26 +03:00
Ivan Kylchik
be4dbf2dcd Create gradle scripts to run and analyze benchmark results 2020-07-22 20:18:25 +03:00
Ivan Kylchik
29d0e3dbb5 Reuse createSession function for FIR in benchmark 2020-07-22 20:18:24 +03:00
Dmitry Petrov
1272162a7f JVM_IR: generate "safe" names for functions in init blocks 2020-07-22 19:49:48 +03:00
Yaroslav Chernyshev
bb8f857809 [Gradle, Import] Added externalSystemId into facet for mpp projects
#KT-39803 Fixed
2020-07-22 19:44:09 +03:00
Ilya Goncharov
e5b0498eb6 Fix tests for Gradle kts and groovy dsl
^KT-40527 fixed
2020-07-22 14:04:57 +03:00
Ilya Goncharov
ae0bedd2ac [Gradle, JS] Different module kind for browser and nodejs
^KT-40527 fixed
2020-07-22 14:04:29 +03:00
Ilya Goncharov
38ec3ffb4a [Gradle, JS] Statically calculated module configurator id
^KT-40527 fixed
2020-07-22 14:04:15 +03:00
Ilya Goncharov
bf1b85343f [Gradle, JS] Remove copyright from template of node.js
^KT-40527 fixed
2020-07-22 14:03:40 +03:00
Ilya Goncharov
2d60d2c0e6 [Gradle, JS] Divide allowSinglePlatform
^KT-40527 fixed
2020-07-22 14:02:02 +03:00
Ilya Goncharov
af367b01ec [Gradle, JS] Add test on node js single platform project
^KT-40527 fixed
2020-07-22 14:01:50 +03:00
Ilya Goncharov
cb60b9e59c [Gradle, JS] singleplatformJs -> singlePlatformJsBrowser
^KT-40527 fixed
2020-07-22 14:01:20 +03:00
Ilya Goncharov
01ec8b5262 [Gradle, JS] Fix typo and add node js module configurator
^KT-40527 fixed
2020-07-22 13:59:46 +03:00
Ilya Goncharov
0d606e1346 [Gradle, JS] Fix id and text in simple js module configurators
^KT-40527 fixed
2020-07-22 13:59:33 +03:00
Ilya Goncharov
4c5cd44e75 [Gradle, JS] Localize Module Type
^KT-40527 fixed
2020-07-22 13:59:15 +03:00
Ilya Goncharov
29e37ee15f [Gradle, JS] Fix test for js single platform
^KT-40527 fixed
2020-07-22 13:58:47 +03:00
Ilya Goncharov
a866e51402 [Gradle, JS] NodeJs template files
^KT-40527 fixed
2020-07-22 13:58:32 +03:00
Ilya Goncharov
95f6669275 [Gradle, JS] Add NodeJs template plugin
^KT-40527 fixed
2020-07-22 13:58:19 +03:00
Ilya Goncharov
6866fdc3e1 [Gradle, JS] Add NodeJs template project
^KT-40527 fixed
2020-07-22 13:57:44 +03:00
Ilya Goncharov
4de31da0f3 [Gradle, JS] Fix typo
^KT-40527 fixed
2020-07-22 13:57:07 +03:00
Ilya Goncharov
e8dfc4dcd0 [Gradle, JS] JsSinglePlatform -> BrowserJsSinglePlatform
^KT-40527 fixed
2020-07-22 13:56:53 +03:00
Ilya Goncharov
b4334a3a3b [Gradle, JS] Fix formatting in Gradle Kotlin/JS wizard
^KT-40149 fixed
2020-07-22 13:23:03 +03:00
Jinseong Jeon
e1abaa9b51 FIR: special visibility handling for monitor{Enter|Exit} 2020-07-22 12:16:32 +03:00
Jinseong Jeon
85f692ab40 FIR2IR: use DescriptorWithContainerSource if container source is available
The use of DescriptorWithContainerSource is the key to trigger the
proper generation of stub facade class as parent.
2020-07-22 12:16:32 +03:00
Alexander Gorshenev
c076d81f0c [IR FAKE OVERRIDES] Properly account for outer class type parameters 2020-07-22 12:02:51 +03:00
Pavel Kirpichenkov
1ef17c6f3a Drop isErrorTypeAllowed flag from type system context
The flag was used exclusively during calculation of common super type.
This change relies on assumption, that common super type is
NOT calculated in IR type system context.
2020-07-22 11:41:42 +03:00
Pavel Kirpichenkov
710659324c [NI] Fix common supertype of types with error supertypes
Enable check for error supertypes during CST calculation in classic type system context.
Cyclic upper bound + known type parameters of superclasses may create non-error types
with error supertypes. Such types don't have common constructors with other normal types
and cause assertion errors during intersection.

^KT-36951 Fixed
2020-07-22 11:41:42 +03:00
Ilya Gorbunov
95cc35f22e Package builtins with jvm reflect into IDEA plugin only
Leave builtins with common reflect for stand-alone compiler.
2020-07-22 11:08:14 +03:00
Stanislav Erokhin
0c094b1719 Serialize jvm reflect into builtIns
Basically this is revert of 427e34fe5a commit
This was done due to the KT-39728.
Also we do pick every file separately, because builtIn serializer
unable to filter expects
2020-07-22 11:08:14 +03:00
Stanislav Erokhin
67090e1afb Move KTypeProjection to separate file 2020-07-22 11:08:14 +03:00
Zalim Bashorov
ee26fd4959 [KJS FE] Change severity of NON_EXPORTABLE_TYPE from error to warning
The change is required to avoid breaking examples using kotlin-wrappers
until we find an acceptable solution for them.

#KT-39873 Fixed
2020-07-22 10:51:41 +03:00
Denis Zharkov
41bd013796 Fix incorrect usages of @NotNull type parameters in project sources
^KT-36770 In progress
2020-07-22 10:16:14 +03:00
Denis Zharkov
037ff2fa52 Fix incorrect handling of @NotNull type parameters
^KT-36770 In progress
^KT-40114 Relates
^KT-28785 Relates
2020-07-22 10:16:14 +03:00
Denis Zharkov
f1c68a9080 Introduce JavaTypeEnhancement component
It's necessary to allow using language version settings in type enancement
2020-07-22 10:16:14 +03:00
Denis Zharkov
240311d9c7 Minor. Reformat JavaNullabilityChecker 2020-07-22 10:16:14 +03:00
Dmitry Petrov
d93885e71c Add tests for deprecated properties 2020-07-21 22:25:44 +03:00
Dmitry Petrov
e84339a0d3 JVM_IR: fields for deprecated enum entries have ACC_DEPRECATED flag
'Deprecated' annotation can't be applied to field itself.
2020-07-21 22:25:44 +03:00
Roman Artemev
edab3e3ba9 [PLUGIN API] Add referenceTypeAlias API to IrPluginContext
- attempt to fix KT-40193
2020-07-21 18:38:33 +03:00
Roman Artemev
c4b4912a71 Revert "[PLUGIN API] Make referenceClass resolve type aliases too" 2020-07-21 18:38:32 +03:00
Anton Bannykh
cb15570d75 [JS IR BE] Fix validation errors (duplicate nodes and incorrect parent) 2020-07-21 18:25:17 +03:00
Vyacheslav Gerasimov
d36d62e226 Add info about -Pteamcity to readme and make warning less annoying 2020-07-21 18:05:21 +03:00
Vyacheslav Gerasimov
a4457ba7ac Build: Setup dependency on dist for :compiler:fir:analysis-tests:test 2020-07-21 17:24:59 +03:00
Vyacheslav Gerasimov
58ee95c8a3 Build: Add root IDE test tasks to split tests in 3 parts 2020-07-21 17:24:59 +03:00
Vyacheslav Gerasimov
036c359993 Build: Make local profile warning more visible 2020-07-21 17:24:58 +03:00
Vyacheslav Gerasimov
d9fbaadb2e Build: Upgrade Gradle Enterprise plugin to 3.3.4 2020-07-21 17:24:58 +03:00
Roman Artemev
d7a0dbfae8 [PLUGIN API] Make referenceClass resolve type aliases too
- fix KT-40193
2020-07-21 15:36:31 +03:00
Leonid Startsev
a0154b9851 Add JarUtil.getJarAttribute to proguard rules
This method is used by serialization plugin to read runtime JAR
manifest.

Maven serialization plugin seems to use proguarded compiler
distribution,
so to use this method, it should be kept.

Size increased for about 2kb.
2020-07-21 15:10:08 +03:00
Leonid Startsev
e3f42721e9 Mute/ignore 'PROVIDED_RUNTIME_TOO_LOW' in tests 2020-07-21 15:10:08 +03:00
Leonid Startsev
df5f38fec8 Implement reading kx.serialization runtime metadata from jar manifest
That allows to check whether current compiler plugin can work with
a given runtime version. Implementation-Version can help to detect whether
runtime version is too low, and Require-Kotlin-Version detects whether
runtime version is too high.

Corresponding diagnostic for Require-Kotlin included.
Implement minimal runtime version check for kotlinx.serialization
plugin.

 #KT-40036 Fixed

Cache result from getVersionsForCurrentModule in BindingTrace.
Hide check in the IDE, because caching in trace does not work there.
2020-07-21 15:10:08 +03:00
Leonid Startsev
7db0bf8195 Add new serialization runtime packages
encoding and descriptors. Rename ContextSerializer to Contextual.
Unify getClassFrom*Package functions.
2020-07-21 15:02:06 +03:00
Ivan Kylchik
8b9fb6a6cd [FIR] Remove FirOperatorCall node from fir tree 2020-07-21 13:54:19 +03:00
Ivan Kylchik
3c01a39846 [FIR] Update test data after introducing new fir nodes 2020-07-21 13:54:17 +03:00
Ivan Kylchik
d77d733244 [FIR] Complement fir rendering with newly created nodes 2020-07-21 13:54:17 +03:00
Ivan Kylchik
9a119a6757 [FIR] Replace all necessary usages of operator call with new ones
#KT-38333 Fixed
2020-07-21 13:54:16 +03:00
Ivan Kylchik
def47bdd9d [FIR] Add new equalityOperatorCall node in control flow graph 2020-07-21 13:54:15 +03:00
Ivan Kylchik
d23e9940ec [FIR] Change fir builder to use newly created nodes 2020-07-21 13:54:15 +03:00
Ivan Kylchik
708c8b8ef3 [FIR] Create additional nodes to replace operator call in some places
1. FirAssignmentOperatorStatement - represent assignment operations
such as =, +=, -=, /=, %=
2. FirEqualityOperatorCall - represent boolean operations such as ==,
!=, ===, !==

#KT-38333 In Progress
2020-07-21 13:54:14 +03:00
Roman Artemev
8c4930da2e [KLIB] Drop API which is no longer used 2020-07-21 13:15:35 +03:00
Roman Artemev
bb20e4759b [KLIB] Use queue to track classes required fake override resolve
- Avoid module visiting to prevent lazy bodies loading
2020-07-21 13:15:35 +03:00
vladislavf7@gmail.com
2b0639d4ad [FIR] Cleanup and refactoring for checkers 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com
fb946a6a3f [FIR] Move extended checkers list 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com
751ed60e42 [FIR] Fix redundant visibility modifier checker 2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com
a8ff5d17dc [FIR] Fix redundant modality modifier checker
Fixed function FirDeclaration.hasBody() and some others improvement
2020-07-21 12:13:10 +03:00
vladislavf7@gmail.com
a988234bbf [FIR] Fix redundant explicit type checker 2020-07-21 12:13:09 +03:00
Pavel Punegov
eecb43d4c9 Ignore test in Native backend 2020-07-21 11:26:57 +03:00
Ilya Gorbunov
bace1b8055 Increase stdlib-js mocha test timeouts to 10s
Some tests often do not fit into the default timeout when running tests
in parallel on CI.
2020-07-21 05:43:38 +03:00
Steven Schäfer
d62a6a2631 JVM IR: Do not create accessors for enum entry constructors 2020-07-20 22:37:49 +02:00
Alexander Udalov
71730696b2 JVM IR: rename JvmDeclarationFactory -> JvmCachedDeclarations 2020-07-20 22:26:11 +02:00
Alexander Udalov
c7f9dc1c40 IR: rename DeclarationFactory to InnerClassesSupport, move out of context
Methods of the common interface DeclarationFactory were only used in
lowerings in InnerClassesLowering, which were used in JVM and JS, not
Native. Therefore, it makes sense to have this as a separate interface
and pass its implementation to these lowerings directly, instead of
declaring it in the common context (which is not going to be implemented
in Native).
2020-07-20 22:26:11 +02:00
Alexander Udalov
cf884fb048 IR: remove JVM-specific methods from DeclarationFactory 2020-07-20 22:26:11 +02:00
Alexander Udalov
6907decd99 Report file name on exception from ASM in BinaryJavaClass
This is useful to diagnose cases like KT-40339
2020-07-20 22:25:55 +02:00
Matthew Gharrity
221d49a995 Set wantsDiagnostics() in AbstractFilteringTrace
report() already delegates to the parentTrace, so
wantsDiagnostics() should delegate to it as well.
2020-07-20 21:12:25 +03:00
Dmitry Petrov
2e31f95554 Update testData 2020-07-20 20:04:32 +03:00
Dmitry Petrov
2b9606becf JVM_IR: field for suspend main parameter is synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov
7be9b18ff4 JVM: field for suspend main parameter is synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov
6bc44a366a JVM_IR: fields for suspend lambda parameters are synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov
bae6037f00 JVM: fields for suspend lambda parameters are synthetic 2020-07-20 20:04:31 +03:00
Dmitry Petrov
fa75518bd7 JVM_IR: don't skip nullability annotations on private fields
Unfortunately, some annotation processors rely on those annotations.
2020-07-20 20:04:31 +03:00
Dmitry Petrov
d30c67db14 JVM: don't skip nullability annotations on private fields
Unfortunately, some annotation processors rely on those annotations.
2020-07-20 20:04:30 +03:00
Victor Petukhov
b0ac046b05 NI: decrease fixation priority for variables which have only incorporated from upper bound constraints
^KT-40045 Fixed
^KT-39633 Fixed
2020-07-20 19:20:18 +03:00
Ilya Goncharov
081248f859 [Gradle, JS] Extract properties provider in KotlinJsTarget 2020-07-20 17:44:12 +03:00
Ilya Goncharov
4917643583 [Gradle, JS] Check if not both compiler 2020-07-20 17:40:52 +03:00
Ilya Goncharov
61b5a738da [Gradle, JS] Rename flag for legacy
^KT-40320 fixed
2020-07-20 16:51:37 +03:00
Ilya Goncharov
e776444459 [Gradle, JS] binaries executable for legacy by default
^KT-40320 fixed
2020-07-20 16:51:22 +03:00
Ilya Goncharov
f7beea10a5 [Gradle, JS] Common configure should be last otherwise user settings can
be overwrote

^KT-40320 fixed
2020-07-20 16:51:08 +03:00
Jim Sproch
814bd48148 Keep members of com.google.common dependencies intact
It is a workaround for KTI-298
#KT-40354 In progress
2020-07-20 15:05:16 +03:00
Dmitriy Novozhilov
236dfe60f1 [FIR] Correctly build scopes for resolve of different parts of constructors
#KT-40409 Fixed
2020-07-20 14:38:17 +03:00
Dmitriy Novozhilov
94ff457e43 [FIR] Handle erroneous situation with type projection in supertype 2020-07-20 14:38:17 +03:00
Dmitriy Novozhilov
c94d583e2e [FIR] Add substitution for inner classes to supertype resolve
KT-38992 Fixed
2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
cf555ef2b6 [FIR] Move FirNestedClassifierScopeWithSubstitution to separate file 2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
07e12f98b5 [FIR] Substitute supertypes in nested classifier scope
KT-38992
2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
cedd1c133e [FIR] Match type in super<type> access with actual supertypes of class 2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
1ce4eca3a6 [FIR] Infer type arguments for captured parameters of inner classes
KT-38992
2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
1c622a5a3f [FIR] Add transformConversionTypeRef to FirTypeOperatorCall 2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
1b78950ebb [FIR] Don't transform property initializers in type resolve 2020-07-20 14:38:16 +03:00
Dmitriy Novozhilov
9e94189852 [FIR] Add transformTypeParameters to FirTypeParameterRefsOwner 2020-07-20 14:38:15 +03:00
Mikhail Zarechenskiy
4083111dab Fix SAM conversion when lambda is the last expression of another lambda
#KT-39691 Fixed
2020-07-20 14:30:40 +03:00
Mikhail Zarechenskiy
a15d3c76b6 Fix references to sam adapted functions, also fix lookup location
#KT-31025 Fixed
2020-07-20 14:30:40 +03:00
Mikhail Zarechenskiy
0c79de1a98 Prohibit adapted reference resolve against reflective types
There are design questions about reflection for adapted references,
 so the current proposal is to prohibit reflection on them and support
 it properly later

 #KT-40406 Fixed
2020-07-20 14:30:39 +03:00
Vladimir Ilmov
d8de37f665 (CoroutineDebugger) using WeakReference as lastObservedFrame
relates to #KT-40073
2020-07-20 11:44:51 +02:00
Vladimir Ilmov
bcf1954860 (CoroutineDebugger) added support for DebugCoroutineInfoImpl in kotlinx-coroutines-core:1.3.8
relates to #KT-40073
2020-07-20 11:44:51 +02:00
Vladimir Ilmov
b43b238030 (CoroutineDebugger) embed agent into gradle JavaExec task
#KT-40417 fixed
2020-07-20 11:44:32 +02:00
Vladimir Ilmov
217428212f (CoroutineDebugger) Refactoring of retrieving BaseContinuationImpl chains 2020-07-20 11:43:23 +02:00
Vladimir Ilmov
14766a3e1a (CoroutineDebugger) lv 'task' added to tests in EventLoopImplBase kotlinx-coroutines-core:1.3.7 2020-07-20 11:38:01 +02:00
Vladimir Ilmov
e49f3b567b (CoroutineDebugger) minimum supported version kotlinx-coroutines-core.1.3.8
Workaround for starting agent on windows removed, version upgraded in tests
 #KT-40073 fixed
2020-07-20 11:38:00 +02:00
Denis Zharkov
cd896ae6c8 FIR: Implement FE 1.0 semantics for super unqualified calls
See original logic at org.jetbrains.kotlin.types.expressions.unqualifiedSuper.UnqualifiedSuperKt#resolveUnqualifiedSuperFromExpressionContext

^KT-39070 Fixed
^KT-39599 Related
2020-07-20 12:24:51 +03:00
Denis Zharkov
dfc75f3447 FIR: Support fake elements for light tree 2020-07-20 12:24:27 +03:00
Denis Zharkov
fea1fb0fc3 FIR: Rename FirSourceElement::withKind to fakeElement
And reinforce its contract
2020-07-20 12:24:27 +03:00
Denis Zharkov
376d3385d0 FIR: Handle super-receiver case in a special way
Before this change, it was resolved independently of containg call
But in fact, the type of `super` depends on the name of the callee
(see KT-39599 and KT-39070)
2020-07-20 12:24:27 +03:00
Jinseong Jeon
628b8b56b7 FIR2IR: convert annotations on type aliases 2020-07-20 09:40:52 +03:00
Jinseong Jeon
4e14f9500f FIR: account for vararg when creating KFunction type for callable reference 2020-07-20 09:39:34 +03:00
Mikhail Zarechenskiy
e5e50eabe9 Update testdata after 41a0cfe002 2020-07-20 07:04:59 +03:00
Yan Zhulanow
b351556b1f Fix testJarsWithDependenciesWithinClasses() compilation after unsuccessful cherry-pick 2020-07-20 06:10:36 +09:00
Anton Yalyshev
64aaeb52f5 Add change notes for 1.4-M1,2,3,RC builds #KT-40311 Fixed 2020-07-19 11:56:06 +03:00
Jim Sproch
a4a398239b Fallback to fileEntry provided by irFile 2020-07-18 11:16:09 +03:00
Georgy Bronnikov
c901e82a55 IR: add IrSimpleFunction.isInfix 2020-07-18 11:03:33 +03:00
Ivan Gavrilovic
8e4bc06b3c Create a valid jar in KaptIncrementalWithIsolatingApt test 2020-07-18 05:06:16 +09:00
Ivan Gavrilovic
77ba9a1bbb KT-34604: Fix race condition in KAPT
KAPT was relying on clearing JarFileFactory to make sure
annotation processing does not hold onto annotation processing
classpath once done. Once KAPT switched to using Gradle workers, multiple
KAPT runs were sharing the same class loader ie. the same version
of JarFileFactory. Clearing the cache resulted in race condition,
as some runs were unable to load processors from jars.

This commit fixes this problem by avoiding the use of ServiceLoader
which was causing the issue. Jars would be added to the cache, but
they would never be removed. That's why JarFileFactory had to be
clearned manually. By loading the processor names manually (simply
exploring the classpath), no file handles leak.

Fixes https://youtrack.jetbrains.com/issue/KT-34604
Test: verified against the test project from the bug
2020-07-18 05:06:15 +09:00
Ivan Gavrilovic
111a2ece72 KAPT: Fix error reporting
When incremental analysis is unable to run, handle
failure gracefully. More info will be provided by
compiler diagnostics.

Fixes KT-36302
2020-07-18 05:06:15 +09:00
Ivan Gavrilovic
11251a93ac KAPT: Fix serialization of class structure data
When serializing ClasspathEntryData, ids assigned to types were
incorrect, resulting in corrupt data when deserializing files. This
happened if there were dependencies between classes.

Fixes KT-39876
Test: ClasspathAnalyzerTest
2020-07-18 05:06:15 +09:00
Jim Sproch
ccbb2eaba9 Make linker visible to compiler plugins 2020-07-17 21:18:07 +03:00
Toshiaki Kameyama
80e4e7939d "Create abstract function" quick fix: don't suggest it if super classes are not writable
#KT-40215 Fixed
2020-07-17 19:35:02 +03:00
Vladimir Ilmov
0c832e30bf (CoroutineDebugger) Memory leak fixed on IDEA quit: 'org.jetbrains.kotlin.idea.debugger.coroutine.view.XCoroutineView
#KT-40386 fixed
2020-07-17 18:01:30 +02:00
Dmitriy Dolovov
6de848a15c [Commonizer] Introduce success marker file in Gradle task
The success marker file is written to the disk only upon successful
commonization. If something goes wrong, this file is not written to
the disk. So the subsequent call of 'runCommonizer' task will be
considered not up-to-date.

^KT-40120
2020-07-17 22:09:08 +07:00
Dmitriy Dolovov
178b5db8de [Commonizer] More precise up-to-date checks in Gradle task
Don't annotate the whole 'distributionDir' with @InputDirectory.
The contents of the distribution directory may grow over time due to
compilation cache and new commonized libraries.

Don't annotate 'baseDestinationDir' with @InputDirectory. The base
destination directory may contain numerous subdirectories with the
libraries produced for different combinations of commonized targets.
This means that the contents of the base directory will grow over time.

Use more precise directory up-to-dateness checks:
* Annotate the directory with the original common libraries
  (i.e. 'stdlib') as @InputDirectory.
* Annotate the directory with the original platform libraries
  (all targets altogether) as @InputDirectory.
* For each combination of commonized targets mark the list of the
  directories with resulting libraries as @OutputDirectories.

^KT-40120
2020-07-17 22:09:08 +07:00
Sergey Igushkin
d3f9f4f3e8 Fix stdlib-by-default failures when configuration has been resolved
Issue #KT-38221
2020-07-17 18:36:08 +04:00
Ilya Kirillov
dccac34282 J2K: do not run runUndoTransparentAction outside EDT
#KT-39739 fixed
2020-07-17 16:02:46 +03:00
Ilya Kirillov
d16f246375 Wizard: do not add stdlib for gradle based projects
#KT-40407 fixed
2020-07-17 16:02:44 +03:00
Ilya Kirillov
d2113766e1 Wizard: do not add NPM dependencies for Kotlin/JS wrappers
Those dependencies are included now into corresponding libraries

#KT-40377 fixed
2020-07-17 16:02:42 +03:00
Ilya Kirillov
9f5dd59d75 Wizard: do not add test task for JS when no test framework is chosen
#KT-40378 fixed
2020-07-17 16:02:40 +03:00
Ilya Kirillov
0208fad057 Wizard: do not allow to choose Frontend Application template & JS Library at the same time
#KT-40371 fixed
2020-07-17 16:02:39 +03:00
Ilya Kirillov
fdc06b2c1c Wizard: fix Android SDK path on Windows
#KT-40232 fixed
2020-07-17 16:02:38 +03:00
Pavel Kirpichenkov
a153e7fe30 Changes after review
#KT-37219
2020-07-17 15:27:37 +03:00
Mikhail Zarechenskiy
10bd3a11b8 Improve message about compatibility warning a bit
Relates to #KT-40111
2020-07-17 14:27:20 +03:00
Mikhail Zarechenskiy
fcf7a55ccc Fix delegated property resolve on number literals and proper types
There is no need to update type of delegate expression if it's already
 resolved correctly (doesn't include non-proper types). In almost all
 cases it was fine except number literals as there we didn't box
 expression in backend and got problems at bytecode verification stage

 #KT-40057 Fixed
2020-07-17 14:27:20 +03:00
Yunir Salimzyanov
e5bca3ce29 Enable execution of muted on database tests marked as FLAKY (KTI-288)
It became possible to do, because all the muted flaky tests are now
synchronized with TeamCity and muted there too
2020-07-17 14:01:23 +03:00
Alexander Dudinsky
27e7116f60 Added the gradle plugin SNAPSHOT version support for some tests.
`ImportAndCheckNavigation` and `GradleMultiplatformHighlightingTest` now
use the SNAPSHOT version of the gradle plugin also.
2020-07-17 13:55:25 +03:00
Mikhail Glukhikh
80022cccd9 [FIR] Introduce & use processOverriddenPropertiesWithDepth 2020-07-17 12:46:02 +03:00
Jinseong Jeon
13ef97e51e FIR2IR: set proper visibility of backing fields with @JvmField 2020-07-17 12:42:11 +03:00
Jinseong Jeon
f3475fd098 FIR2IR: store and convert annotations on enum entry 2020-07-17 09:48:45 +03:00
Vladimir Dolzhenko
a1ffc0b25a Handle standalone gradle scripts before (build|settnings|init).gradle.kts
#KT-39916 Fixed
2020-07-17 05:36:02 +00:00
Mikhail Zarechenskiy
a6e58edfb9 Update test data, unmute test
Now behavior is the same as in OI for these cases.
 The behavior was changed in 100a6f70ca
2020-07-17 07:47:15 +03:00
Abduqodiri Qurbonzoda
a05681001f Mark with @DeprecatedSinceKotlin #KT-22423 and #KT-28753 2020-07-17 02:39:20 +03:00
Ilya Gorbunov
87cb6372a0 Specify DeprecatedSinceKotlin for recently deprecated min/max funs
#KT-38854
2020-07-16 22:58:25 +03:00
Ilya Gorbunov
a9f4479557 Add stdlib-gen DSL support for DeprecatedSinceKotlin annotation 2020-07-16 22:58:25 +03:00
Vladimir Dolzhenko
5eb0242941 Add missed application component PluginStartupComponent for AS40
Relates to #KTI-299
2020-07-16 21:01:26 +02:00
Shagen Ogandzhanian
fa1e3169df Update dukat dependency to 0.5.7 2020-07-16 18:19:36 +02:00
Mikhail Glukhikh
026a6ffab2 FirUpperBoundViolatedChecker: code cleanup 2020-07-16 19:09:33 +03:00
Nick
1ea5678932 [FIR] UPPER_BOUND_VIOLATED optimizations 2020-07-16 19:04:29 +03:00
Nick
41a0cfe002 [FIR] Add diagnostic UPPER_BOUND_VIOLATED 2020-07-16 19:04:22 +03:00
Toshiaki Kameyama
b9a220c624 AddSuspendModifierFix: suggest in inline lambda
#KT-38139 Fixed
2020-07-16 18:49:29 +03:00
Vyacheslav Karpukhin
982f429d6b Moved the IdeaDefaultIdeTargetPlatformKindProvider declaration from jps.xml back to jvm-common.xml 2020-07-16 16:38:56 +02:00
Igor Chevdar
3c4f0d3c9e [box-tests] Added test 2020-07-16 19:23:03 +05:00
Igor Chevdar
8bbbee8ffd [IR] Supported IrFunctionExpression in ClosureAnnotator
It may be encountered during local classes extraction from inline lambdas
2020-07-16 19:23:02 +05:00
Alexander Udalov
c9fdef8233 IR: use buildField where possible 2020-07-16 16:09:31 +02:00
Alexander Udalov
2d723f1c51 IR: use buildClass where possible 2020-07-16 16:09:31 +02:00
Alexander Udalov
5b1193407a IR: use buildConstructor where possible 2020-07-16 16:09:31 +02:00
Alexander Udalov
6aa09f61d4 IR: use buildFun where possible 2020-07-16 16:09:30 +02:00
Alexander Udalov
39e38c7049 IR: introduce buildVariable, use where possible 2020-07-16 16:09:30 +02:00
Alexander Udalov
c3560e5854 IR: use buildTypeParameter, minor cleanup 2020-07-16 16:09:30 +02:00
Alexander Udalov
4b5464c6cc IR: introduce buildReceiverParameter, use where possible 2020-07-16 16:09:30 +02:00
Alexander Udalov
b36a6114aa IR: use buildValueParameter where possible 2020-07-16 16:09:29 +02:00
Vladimir Ilmov
378d0a757a DebuggerClassNameProvider refactoring 2020-07-16 16:05:01 +02:00
Alexander Dudinsky
f6a16c5203 Move some tests from common mute database to platforms specific 2020-07-16 15:43:01 +03:00
Victor Petukhov
e754585e38 NI: add fallback strategy to get lexical scope to checking coroutine call legality
^KT-40247 Fixed
^KT-40337 Fixed
2020-07-16 15:33:27 +03:00
Vladimir Dolzhenko
5951e7500a Register KOTLIN_BUNDLED via application component in 193
#KTI-299 Fixed
2020-07-16 12:32:52 +00:00
Vladimir Dolzhenko
345528d8f5 Use public api to register KOTLIN_BUNDLED macros
Relates to #KT-39968
2020-07-16 12:32:51 +00:00
vladislavf7@gmail.com
ab2128f55d [FIR] extended checkers infrastructure refactoring
Removed strange way to enable Extended Checkers and add new way to do it
2020-07-16 15:11:32 +03:00
vladislavf7@gmail.com
38543ce2a3 [FIR] add way to configure session in Diagnostic Tests 2020-07-16 15:11:32 +03:00
Svyatoslav Kuzmich
609f0ca9bc [JS IR] .d.ts generation for module systems
Support .d.ts generation for UMD, AMD, CommonJS module kinds in
addition to existing "plain" module kind.
2020-07-16 14:02:06 +03:00
nataliya.valtman
ee23e39b3c KT-37720 replace FileSystemLocation with File for TransformAction 2020-07-16 13:39:55 +03:00
Yunir Salimzyanov
63ba883a77 Refactoring of muteWithDatabase
- remove unused function RunNotifier.withMuteFailureListener
- inline some functions (isIgnoredInDatabaseWithLog, etc.)
- change declaration of mutedMessage
- change naming of AutoMute related functions
- extract to separate function isPresentedInDatabaseWithoutFailMarker
2020-07-16 13:16:41 +03:00
Roman Golyshev
fb9b3f96de KT-40301 Add more diagnostics for 'Module is not contained in resolver'
- See [EA-214260](https://ea.jetbrains.com/browser/ea_problems/214260)
2020-07-16 10:14:22 +00:00
Roman Golyshev
8fd16f4a39 Add contract to checkWithAttachment
- This way it is more convenient to use with null checks
2020-07-16 10:14:21 +00:00
Ilya Muradyan
0ff45f1cc4 Merge pull request #3544 from JetBrains/rr/ileasile/scopes-resolver-option
Add dependency scopes option for scripting (Ivy and Maven) resolvers
2020-07-16 13:03:01 +03:00
Vyacheslav Gerasimov
628efcb189 Build: Add kotlin.build.dependencies.iu.enabled property
Alias for intellijUltimateEnabled
2020-07-16 13:00:25 +03:00
Vyacheslav Gerasimov
996e529944 Build: Allow intellijUltimateEnabled without kotlin-ultimate directory
This allows to build against idea ultimate locally
2020-07-16 13:00:24 +03:00
Vyacheslav Gerasimov
34c1316ae0 Build: Enable local build cache with org.gradle.caching=true 2020-07-16 13:00:24 +03:00
Vyacheslav Gerasimov
2e7cb2b829 Build: Enable parallel builds with org.gradle.parallel=true 2020-07-16 13:00:24 +03:00
Jinseong Jeon
50f1f8f0eb FIR: consider more functional types during SAM resolution 2020-07-16 12:56:18 +03:00
Jinseong Jeon
d66c6c7e1e FIR serializer: transform KSuspendFunction types too 2020-07-16 12:56:18 +03:00
Ivan Kylchik
85e822e283 [FIR] Support smartcast after reference equality check
#KT-39000 Fixed
2020-07-16 12:43:55 +03:00
vladislavf7@gmail.com
63f7e95c89 [FIR] Add RedundantExplicitTypeChecker 2020-07-16 12:39:13 +03:00
Yunir Salimzyanov
3c798502c8 Synchronize muted TeamCity tests with database for .bunch configurations 2020-07-16 11:04:59 +03:00
Jinseong Jeon
c7a37eb6b2 FIR deserializer: load annotations on extension receiver parameters 2020-07-16 10:42:51 +03:00
Dmitriy Dolovov
02f08b16d6 [Commonizer] Ignore CallableDescriptor.hasSynthesizedParameterNames attribute 2020-07-16 14:26:37 +07:00
Mikhail Zarechenskiy
100a6f70ca Relax rules about inferring to Nothing for special calls
#KT-37388 Fixed
 #KT-38427 Fixed
 #KT-39953 Fixed
 #KT-38899 Fixed
2020-07-16 09:56:46 +03:00
Anton Bannykh
e45cd02b01 KLIB: add EmptyPackageFragment's to fix ModuleDescritor.getSubPackagesOf 2020-07-15 20:42:23 +03:00
Abduqodiri Qurbonzoda
d2c9fc41f1 Replace @LowPriorityInOverloadResolution with @DeprecatedSinceKotlin #KT-37101 2020-07-15 20:36:57 +03:00
Abduqodiri Qurbonzoda
4ac1b7748a Advance bootstrap to 1.4.20-dev-2133 2020-07-15 20:36:56 +03:00
Roman Artemev
cd9f59325e [KLIB] Fix deserialization of anonymous classes
In case of initializing property or function with anonymous object the
object is being exposed outside its field/function's scope and
accessible on previous level. In this case in `declarations only` mode
we have unbound symbols. Fix is to force body/initializer loading in
such cases.

Make sure it is deserialized in `declarations'only` mode too.

 - Fix KT-40216
 - Add test
2020-07-15 18:23:29 +03:00
Roman Artemev
d31de6c8de [Psi2IR] Improve assertion message 2020-07-15 18:23:28 +03:00
Alexander Dudinsky
d89083cd8c Fixup the tests vs master-gradle-plugin
Defined 4.0 and 1.3.0 as default versions of Gradle and plugin for PluginTargetVersions
Use `{{kotlin_plugin_repositories}}` template in testData of ImportTests
Update "mute" databases for new tests

Add `kotlin.stdlib.default.dependency=false` to some testData
2020-07-15 17:10:36 +03:00
Andrey Uskov
005314ce06 Support running import tests on bootstrap version of gradle plugin 2020-07-15 17:09:36 +03:00
Victor Petukhov
b0c96a61ec Don't try to infer postponed variables on lambdas without BuilderInference annotation
^KT-39618 Fixed
2020-07-15 16:19:43 +03:00
nataliya.valtman
9e737156dd KT-37720 Replace ArtifactTransform with TransformAction 2020-07-15 15:57:54 +03:00
Andrei Klunnyi
b9585dabd4 KT-32368 Rework Inline hints settings // fix QuickFixTestGenerated$AutoImports.testKt17525 2020-07-15 13:25:00 +02:00
Andrei Klunnyi
1639cadbb7 KT-32368 Rework Inline hints settings // remove non-existent ReturnHintLinePainter 2020-07-15 13:00:16 +02:00
Jinseong Jeon
30b91b128a FIR: adjust type of integer operator call as property initializer 2020-07-15 13:56:40 +03:00
Mikhail Glukhikh
ddd26de139 FirTypeIntersectionScope: extract 'createIntersectionOverride' 2020-07-15 13:36:31 +03:00
Mikhail Glukhikh
9934f7d56e [FIR TEST] Add test for KT-40327 2020-07-15 13:36:31 +03:00
Mikhail Glukhikh
92d40c27e2 FirBasedSignatureComposer: build signature even for private classes
FIR2IR assumes that we can build signature for any non-local class.
Later we can drop this assumption.
2020-07-15 13:36:31 +03:00
Mikhail Glukhikh
07b0ffef84 [FIR] Introduce & use remapArgumentsWithVararg 2020-07-15 13:36:30 +03:00
Jinseong Jeon
5c4f978073 FIR: transform arrayOf call with empty arguments 2020-07-15 13:36:30 +03:00
Jinseong Jeon
db9d42c153 IrConstTransformer: handle vararg with spread elements properly 2020-07-15 13:36:30 +03:00
Jinseong Jeon
5600eefea5 FIR: add support for varargs in annotation calls 2020-07-15 13:36:30 +03:00
Jinseong Jeon
4e6bd33eca FIR: create argument mapping for annotation call in general 2020-07-15 13:36:30 +03:00
Jinseong Jeon
1a861b2df9 FIR2IR: don't create synthetic class for enum entry w/o members 2020-07-15 13:36:30 +03:00
Juan Chen
2ea3579281 [FIR] add support for generic cases of delegation by implementation
Add type parameters for generic delegated members and type
substitution when implementing instantiated super interfaces.
2020-07-15 13:36:29 +03:00
Mikhail Glukhikh
93632d2a18 FIR declaration transformer: unwrap synthetic property accessor properly 2020-07-15 13:36:29 +03:00
Mikhail Glukhikh
031f03a903 Introduce FirDeclarationOrigin.INTERSECTION_OVERRIDE 2020-07-15 13:36:29 +03:00
Mikhail Glukhikh
9107944b05 FirSyntheticProperty: take returnTypeRef directly from delegate 2020-07-15 13:36:29 +03:00
Mikhail Glukhikh
e2678149cb FirClassSubstitutionScope: fix overridden symbols traversing 2020-07-15 13:36:29 +03:00
Mikhail Glukhikh
10a1d5c03b FirTypeIntersectionScope: add intersection overrides caching 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
c1d223dbde FirTypeIntersectionScope: enhance support of inherited default parameters 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
c46fac3464 FirTypeIntersectionScope: support inherited default parameters 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
7a2ea49399 FirTypeIntersectionScope: introduce "intersection" fake overrides 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
5a422b5ef6 FirTypeIntersectionScope: optimize/cleanup processOverriddenFunctions 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
1bbed6c4ed [FIR2IR] Use FIR-specific methods to search for overridden functions 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
59cc9d4bc6 [FIR] Introduce FirTypeScope.processOverriddenFunctionWithDepth 2020-07-15 13:36:28 +03:00
Mikhail Glukhikh
8a29021aad [FIR2IR] Make data class synthetic members public API 2020-07-15 13:36:27 +03:00
Mikhail Glukhikh
521901f09a [FIR2IR] Cache type parameters for existing IR classes properly
Before this commit, we just recreated class header
for external IR class found by signature. However, it's not required,
because super-types, type parameters, etc. are already initialized.
So now we just read type parameters and build cache for them.
2020-07-15 13:36:27 +03:00
Victor Petukhov
d2f5fbdd08 Fix failing on AS test with inserting -Xinline-classes to build script 2020-07-15 13:35:16 +03:00
Kirill Shmakov
c8b3e622f1 Fix typo in field name 2020-07-15 10:52:42 +03:00
vladislavf7@gmail.com
d96772444e [FIR] Fix redundant visibility checker 2020-07-15 09:42:30 +03:00
Dmitry Savvinov
9b8128aaa8 Coerce commonTest to common in HMPP
Otherwise, Android import won't add dependency from androidTest to
commoonTest. See KT-38744 for details

^KT-38744 Fixed
2020-07-15 11:18:34 +07:00
Ilya Muradyan
1ac9b4c38f Add dependency scopes option for scripting resolvers 2020-07-14 23:42:00 +03:00
Vyacheslav Gerasimov
742b98bed6 Build: Fix stdlib-js-ir commonMainSources task dependency on version 2020-07-14 20:29:11 +03:00
vladislavf7@gmail.com
fb5fb44993 [FIR] Add RedundantModalityModifierChecker 2020-07-14 19:56:41 +03:00
Vyacheslav Gerasimov
e7c88a4349 Build: Add KotlinVersionCurrentValue to runtime classpath normalization
To avoid cache misses between local and remote build
2020-07-14 17:51:45 +03:00
Vyacheslav Gerasimov
e215d94b7b Build: Fix JavaExec task configuration
Setting some properties is not allowed in doFirst anymore in Gradle 6.5
2020-07-14 17:51:45 +03:00
Victor Petukhov
bf23b39d76 Add using -Xinline-classes by default in IDE intentions
^KT-34209 Fixed
2020-07-14 17:43:44 +03:00
Pavel Kirpichenkov
79d7babb57 Add test checking file annotations resolution
#KT-37219 Fixed
2020-07-14 17:07:42 +03:00
Nikolay Krasko
36a46482c5 Unmute IdeReplCompletionTestGenerated.testDefinedExtension in 202
Lost this line from 16c5ba0988
 during the mute-platform.csv.202 creation.
2020-07-14 17:05:30 +03:00
Natalia Selezneva
5954fe528b gradle.kts: do not return ErrorScriptDefinition into GradleBuildRootManager
In this case script definition is saved into script info,
but only real script definitions should be cached
In case of null script configurations will be reloaded into cache when scriptdefinitions will be ready

^KT-39910 Fixed
2020-07-14 15:30:21 +03:00
Natalia Selezneva
3e3f8aeb93 Mark importing as complete in case of some unexpected behavior
For example in case when script contains some errors gradleHome might be null
Then build root should be marked as updated
Also notification should be updated
2020-07-14 15:30:20 +03:00
Ilya Goncharov
2c67ab924f [Gradle, JS] this globalObject in webpack
^KT-40159 fixed
2020-07-14 14:42:26 +03:00
Andrei Klunnyi
93a82060d4 KT-39788 MPP, Gradle runner: Run does not add resource directory to classpath // gradle runner support
Before this commit "delegate to Gradle" option was not taken into
consideration. Was it MPP or SPP, KotlinRunConfiguration was always
executed by platform runner (as a default one). The reason behind this
was that there was no dedicated class (extension point) responsible for
Gradle-Kotlin pair. Now its KotlinGradleAppEnvProvider.
2020-07-14 11:24:59 +00:00
Andrei Klunnyi
681c2e9492 KT-39788 MPP, Gradle runner: Run does not add resource directory to classpath // classpath fix
The reason of resource directory absence was that it couldn't be loaded
from the project configuration file. Just after the import it remained
in the memory and runner couldn' get it. KotlinOutputPathsDataService as
a pair to KotlinOutputPaths is what was missing. Details are provided
below.
------------------------------------------------------------------------
On a disk configuration represents a binary file containing serialized
graph of external project structure. It contains nodes belonging to both
IDEA and its plugins.

To deserialize a node IDEA tries to load its class using a chain of
class-loaders: its own and those provided by actual set of plugins.
The nuance is how to get plugins' ones. The approach is the following.
There is an association between a node's payload and a service which is
supposed to consume it see KotlinOutputPathsDataService#getTargetDataKey
and DataNode#getKey). Plugin services are guaranteed to be loaded by
plugin class loader.
No association - service - no plugin, node was just skipped.
------------------------------------------------------------------------
2020-07-14 11:24:58 +00:00
Ilya Muradyan
07b566dd02 Add @JvmDefault for getPossibleSyntheticNestedClassNames 2020-07-14 14:17:58 +03:00
Zalim Bashorov
340512e27a [KJS] Throw exception on recursive types provided to typeOf and provide proper support later within KT-40173
#KT-38140 fixed
2020-07-14 14:14:13 +03:00
Zalim Bashorov
c552933459 [Test infra] Take into account transitive compatible targets while checking compatibility. 2020-07-14 14:14:12 +03:00
Zalim Bashorov
ca37c6bfe6 [KJS FE] Allow using typeOf with non-reified type parameters
#KT-38771 fixed
2020-07-14 14:14:11 +03:00
Ilya Goncharov
9d362875da [Gradle, JS] Fail build in case when mpp or js targets not configured
^KT-40210 fixed
^KT-40300 fixed
2020-07-14 13:59:00 +03:00
Sergey Igushkin
62aed1b53a Add kotlin.stdlib.default.dependency=false to avoid stdlib default dep 2020-07-14 14:47:40 +04:00
Sergey Igushkin
ad9d011ed0 Fix stdlib default dependencies with Android
* In Android test-related source sets, add an implementation dependency,
  not an api one, because adding dependencies to the api configurations
  leads to warnings from AGP

* Add the default stdlib dependency only to the Android main source set,
  as duplicating it elsewhere leads to issue with publishing the project
  with the `maven` plugin (duplicate conf2ScopeMappings)
2020-07-14 14:47:16 +04:00
Sergey Igushkin
d83d3304a5 KT-38221: Stdlib by default; KT-40225 Single dependency on kotlin-test
* Add a DSL property `kotlin.coreLibrariesVersion` that is used as the
  default version for all org.jetbrains.kotlin dependencies instead of
  the plugin version used previously – the pluging version is the
  default now.

* Support omitting the `kotlin-stdlib-*` dependencies in all kinds of
  projects. For the JVM source sets, choose the stdlib module by
  checking the jvmTarget in the compilations – if all compilations
  target 8+ then use `kotlin-stdlib-jdk8`.

* Support adding a single dependency on the fake module
  `kotlin-test-multiplatform` that is later expanded into the
  appropriate dependencies on `kotlin-test-*` modules. For JVM source
  sets, detect the test framework by inspecting the test tasks.

* (minor) Fix _executionSource not updated in KotlinJvmTestRun

* (minor) Lazily query `kotlinUsageContext`'s dependency-related
  properties to avoid freezing the configurations

Issue #KT-38221 Fixed
Issue #KT-40225 Fixed
2020-07-14 14:47:13 +04:00
Ilya Goncharov
49c8d99f61 [Gradle, JS] Resolution of compilation's configurations inside NPM conf
^KT-40201 fixed
2020-07-14 13:13:45 +03:00
Ilya Goncharov
40311dbe05 [Gradle, JS] Fix test on public package json with dependencies
^KT-40201 fixed
2020-07-14 13:13:35 +03:00
Ilya Goncharov
c5f89ebc0d [Gradle, JS] Add dev dependencies into public package json
^KT-40201 fixed
2020-07-14 13:13:18 +03:00
Mikhail Zarechenskiy
bb23556ead Don't perform Unit-conversion for functional types with type variables
#KT-40269 Fixed
2020-07-14 13:05:28 +03:00
Mikhail Zarechenskiy
09b44b3189 Fix rewrite at slice exception for callable references inside flatMap
#KT-40254 Fixed
2020-07-14 13:05:28 +03:00
Andrei Klunnyi
1e4c554bcd KT-32368 Rework Inline hints settings // compatibility with earlier IDEA versions 2020-07-14 10:03:51 +00:00
Andrei Klunnyi
604e270a73 KT-32368 Rework Inline hints settings // preview text 2020-07-14 10:03:50 +00:00
Andrei Klunnyi
7a69cf587e KT-32368 Rework Inline hints settings // HintType cleanup 2020-07-14 10:03:50 +00:00
Andrei Klunnyi
d6692a8062 KT-32368 Rework Inline hints settings // flattern parameter name hints menu 2020-07-14 10:03:49 +00:00
Andrei Klunnyi
be0cde1d70 KT-32368 Rework Inline hints settings // remove suspending call hints
Suspending call hints were removed according to KT-30928 and KT-39271.
2020-07-14 10:03:48 +00:00
Andrei Klunnyi
49d4f55c87 KT-32368 Rework Inline hints settings // special case for lambda hints
Lambda hints are placed at the end of a line in such a way that user
can't move the caret behind it. Unfortunately, hint provision
infrastructure doesn't take this detail into account.
As a workaround, KotlinLambdasHintsProvider now returns an empty result
(sink) to the outer infrastructure and accesses editor's inlay model
itself.
2020-07-14 10:03:48 +00:00
Andrei Klunnyi
d1722e3975 KT-32368 Rework Inline hints settings // migrate tests for types
KotlinReferencesTypeHintsProvider which in now responsible for
type hints is not compatible with the existing
InlayTypeHintsTest. Because of that tests were migrated to the new
infrastructure.
2020-07-14 10:03:47 +00:00
Andrei Klunnyi
36f3431559 KT-32368 Rework Inline hints settings // migrate tests for suspending calls
KotlinSuspendingCallHintsProvider which in now responsible for
suspending call hints is not compatible with the existing
SuspendingCallHintsTest. Because of that tests were migrated to the new
infrastructure.
2020-07-14 10:03:47 +00:00
Andrei Klunnyi
b0dece756a KT-32368 Rework Inline hints settings // migrate tests for lambdas
KotlinLambdasHintsProvider which in now responsible for lambda related
hints is not compatible with the existing LambdaReturnValueHintsTest.
Because of that tests were migrated to the new infrastructure.
2020-07-14 10:03:46 +00:00
Andrei Klunnyi
5fe1eaea17 KT-32368 Rework Inline hints settings // remove outdated KotlinCodeHintsPass
Some time ago platform couldn't place hints at the end of a line.
This is how KotlinCodeHintsPass appeared. Class was responsible for
lambda related hints. Now that platform evolved functionality was moved
to KotlinLambdasHintsProvider.
2020-07-14 10:03:45 +00:00
Andrei Klunnyi
533507de25 KT-32368 Rework Inline hints settings // split KotlinInlayParameterHintsProvider
Platform supports 2 interfaces for inlay hints providers:
- InlayParameterHintsProvider [1]
- InlayHintsProvider [2]

KotlinInlayParameterHintsProvider as an implementation of (1) and a
source of "Inlay Hints" menu has the following limitations:
- Platform treats component as a source of "Parameter hints" submenu
that cannot be split. Once can only add or remove its nested checkboxes.
- Only a single instance of (1) can be defined.

To have a separate menu items for "Inlay Hints" existing
KotlinInlayParameterHintsProvider was split. New providers
implementing (2) were extracted from it:
- KotlinReferencesTypeHintsProvider
- KotlinSuspendingCallHintsProvider
- KotlinLambdasHintsProvider

TODO: HintType move as a separate commit
2020-07-14 10:03:45 +00:00
Sergey Igushkin
5ec93fd74c Fixup for the fix of KT-39809
In the original fix for KT-39809, the Kapt plugin was not given a proper
empty implementation stub: it was added to `Kapt3GradleSubplugin`, while
originally the Kapt subplugin's META-INF/services entry pointed to
`Kapt3KotlinGradleSubplugin`.

This commit makes the correct class implement the legacy interface.

Issue #KT-39809 Fixed
2020-07-14 13:09:26 +04:00
Sergey Igushkin
4c273e1fc5 Fix resolving dependency on self in HMPP (KT-39037)
Apply a workaround for grade/gradle#13680

Issue #KT-39037 Fixed
2020-07-14 13:09:24 +04:00
Sergey Igushkin
aebca19fd7 Fix resolving an MPP dependency in custom configurations (KT-32239)
In the `KotlinPlatformType` disambiguation rule, don't prefer `common`
when there's a `jvm` or an `androidJvm` variant, as this would conflict
with disambiguation rules created by the other plugins, such as Gradle's
`java` which will choose `org.gradle.usage=java-api` and lead to
ambiguity.

Issue #KT-32239 Fixed
2020-07-14 13:09:22 +04:00
Mikhail Zarechenskiy
8158ba2be3 Add tests for obsolete issues
#KT-32183 Obsolete
 #KT-31474 Obsolete
 #KT-31853 Obsolete
2020-07-14 11:23:57 +03:00
Ilya Matveev
19dc3f071c Gradle, native: Enable assertions for in process compiler execution
Issue #KT-39764 fixed
2020-07-14 08:18:00 +00:00
vladislavf7@gmail.com
275ce16faa [FIR] add RedundantReturnUnitTypeChecker 2020-07-14 10:05:28 +03:00
Dmitry Savvinov
5c88b1e80a Allow depending on Native stdlib even if platforms do not match under HMPP
^KT-40102
2020-07-14 12:49:59 +07:00
Dmitry Savvinov
21026001db Add logging into ideaModelDependencies 2020-07-14 12:49:59 +07:00
Ilya Gorbunov
010e530ac4 Make common KClass extend common KClassifier
It already does that in all platforms.
Add KClass common API test.
2020-07-13 23:20:52 +03:00
Florian Kistner
1878ae8222 Don't apply copyright notice to Kotlin Ultimate
* Previous attempt apparently no longer effective
* Cover a few additional strangling files
2020-07-13 19:42:04 +02:00
Florian Kistner
ce39b75cc8 Don't apply copyright notice to Kotlin Ultimate
* Previous attempt apparently no longer effective
2020-07-13 19:37:38 +02:00
Ilya Goncharov
bbb3032e1c [Gradle, JS] Rename package-candidate.json to pre-package.json
^KT-39515 fixed
2020-07-13 19:32:29 +03:00
Ilya Goncharov
6a0315fe7a [Gradle, JS] force write package json in all cases
^KT-39515 fixed
2020-07-13 19:32:29 +03:00
Ilya Goncharov
b4a774e821 [Gradle, JS] Use package.json candidate
^KT-39515 fixed
2020-07-13 19:32:29 +03:00
Ilya Goncharov
8586d5e206 [Gradle, JS] Small refactoring of yarn imported
^KT-39515 fixed
2020-07-13 19:32:28 +03:00
Konstantin Tskhovrebov
cfd91023be Add native targets check to "isAllowCommonizer" method.
#KT-40164 Fixed.
2020-07-13 19:31:08 +03:00
Ilya Goncharov
797449f7e4 [Gradle, JS] Add TC client on TC output handler for browser run task
^KT-40178 fixed
2020-07-13 19:25:04 +03:00
Nikolay Krasko
943d012875 Fix comparison for SdkAndMockLibraryProjectDescriptor
There's no known problems connected with this change, but wrong
comparison might cause tests flakiness.

`allowKotlinPackage` and `classpath` fields were not included.
2020-07-13 17:58:04 +03:00
Nikolay Krasko
0db7806dec Use test classpath for annotations.jar search
Got unstable behaviour in 202 test because of setting
idea.home.path during the compiler execution.
2020-07-13 17:58:03 +03:00
Yaroslav Chernyshev
07e3dd9ec7 [Gradle, Cocoapods] Fixed bug in scheme name for pods 2020-07-13 16:37:37 +03:00
Nick
67e58ff152 [FIR] Fix redundant calls to firEffectiveVisibility() 2020-07-13 16:30:47 +03:00
Alexander Udalov
5340cf5567 Add property kotlin.build.useIR to enable JVM IR in Kotlin build
Right now this is only supposed to be turned on locally (`./gradlew
-Pkotlin.build.useIR=true ...`), to be able to quickly try how JVM
IR-compiled Kotlin compiler works.
2020-07-13 14:38:22 +02:00
Alexander Udalov
9c36c74357 Build: do not pass JVM compiler arguments to common KotlinCompile 2020-07-13 14:38:22 +02:00
Kristoffer Andersen
8d79a6ae03 [JVM IR] Copy inline class constructor annotations 2020-07-13 11:50:34 +03:00
Mikhail Zarechenskiy
678b76cab1 Fix presence of Deprecated hidden annotation for reference arguments
#KT-40234 Fixed
2020-07-13 11:23:28 +03:00
Ilya Matveev
c2e0cd60d7 Gradle tests: Temporary disable NativePlatformLibsIT for Windows
This test causes a build timeouts on CI which cannot be reproduced
locally. So we disable them to not block the testing process until
a proper fix is found.
2020-07-13 07:48:35 +00:00
Dmitry Savvinov
3ef760604b Force expansion to have the same nullability as abbreviation
Note that classifier.underlyingType is always non-nullable, but
abbreviation might be nullable, so we should keep them consistent

^KT-40199 Fixed
2020-07-13 11:50:10 +07:00
Dmitry Savvinov
8890ae10d4 Add test on signatures with nullable abbreviated types
Currently test fails, see KT-40199
2020-07-13 11:50:10 +07:00
Natalia Selezneva
e0bc54cd82 gradle.kts: update notification messages after proofreading 2020-07-12 22:37:45 +03:00
Mikhail Glukhikh
8005df42fb [FIR] Make redundant visibility modifier a warning 2020-07-11 10:45:33 +03:00
Mikhail Glukhikh
5276903bea Fix code style: DeclarationCheckersDiagnosticComponent 2020-07-11 10:45:33 +03:00
Mikhail Glukhikh
aee49c3fde [FIR TEST] Add forgotten txt-file for redundant visibility checker test 2020-07-11 10:45:32 +03:00
vladislavf7@gmail.com
be684c784f [FIR] Introduce extended checkers for inspection-like diagnostics 2020-07-11 10:45:32 +03:00
vladislavf7@gmail.com
4643d483a0 [FIR] Introduce RedundantVisibilityModifierChecker 2020-07-11 10:45:10 +03:00
Ilya Muradyan
510ac66ce1 Fix tests generation after upgrading Gradle to 6.5 2020-07-10 22:07:10 +03:00
Ilya Gorbunov
dd47962ad0 Extract current Kotlin version value into a separate class
In order to selectively ignore it during classpath normalization,
and do not recompile all the dependencies when just the version value
changes.
2020-07-10 19:12:07 +03:00
Nikolay Krasko
cb513b9a70 202: Fix KotlinUastReferencesTest 2020-07-10 19:09:27 +03:00
Ilya Gorbunov
20683d62a6 Postpone introducing common StringBuilder.capacity() function
Its support complicates JS StringBuilder implementation with no actual
performance improvements. Benefits of having capacity() function
in common code are also not completely clear.

Relates to KT-33069
#KT-40168
2020-07-10 18:49:39 +03:00
Steven Schäfer
097e0fb46c JVM IR: Mangle delegated properties with inline class type (KT-40125) 2020-07-10 17:06:44 +02:00
Sergey Rostov
e48d2b9b83 ScriptTemplatesClassRootsIndex: inc version and minor fixes
Content was changed, so we should force reindex.

Minor changes:
- There is no need to save a string, we can just save nothing
 by using the Unit value (see UnitKey.save and UnitKey.read)
- Unit can be shared between all indexes, so we can extract UnitKey object
- It would be good to extract abstract class FileListIndex:
  - for better readability: separate the logic of the specific index from the common FileListIndex implementation
  - someone can use it also
- mapOf (Unit to null) will create singletonMap itself and more readable
- ScriptTemplatesClassRootsIndex.KEY perhaps better to call NAME
2020-07-10 18:01:38 +03:00
Sergey Rostov
1f52c0e0d4 gradle.kts: improve service initializtion
- prevent analyzing .gradle.kts files until all services are loaded
- remove services caches where it is not required
- replace cached services with cache only during vfs events batch processing
- prevent services loading in actions updating
2020-07-10 17:47:10 +03:00
Georgy Bronnikov
a97d718de8 IR: remove a KotlinType use from Ir.kt 2020-07-10 17:35:30 +03:00
Georgy Bronnikov
aab95f93f2 JVM_IR: invoke method descriptor for default lambdas 2020-07-10 17:35:29 +03:00
Alexander Udalov
e8c3c70369 IR: make IrDeclarationWithVisibility.visibility mutable
It was mutable anyway in many subclasses. This is needed in order to
avoid depending on concrete IR implementations in the JVM IR backend
where it's necessary to be able to change visibility.
2020-07-10 16:17:06 +02:00
Alexander Udalov
96f0a8e8e5 IR: minor, inline OverridableMember 2020-07-10 16:17:06 +02:00
Alexander Udalov
e674226a3b IR: do not use Ir*Impl elements where it's not necessary 2020-07-10 16:17:06 +02:00
Alexander Udalov
dbad81473e IR: make IrMetadataSourceOwner.metadata mutable
To avoid casting to specific Ir*Impl elements at call sites.

Also inherit from IrMetadataSourceOwner only where it's needed: class,
file, function, property. Previously this field was always null and took
some space for things like value parameters, type parameters, etc.
2020-07-10 16:17:05 +02:00
simon.ogorodnik
689887c94d [FIR] Fail test if no modules analyzed successfully 2020-07-10 16:25:22 +03:00
Victor Petukhov
cdb122c698 Add skipped ignore directive in test for b08c7eff38 2020-07-10 14:52:51 +03:00
Mikhail Zarechenskiy
0c8b847ae6 Introduce compiler key to disable compatibility resolution mechanism
Enable it if one was using new inferene before 1.4

 #KT-40128 Fixed
 #KT-40112 Fixed
 #KT-40113 Fixed
2020-07-10 14:23:45 +03:00
Mikhail Glukhikh
c1fd891916 [FIR IDE] Fix compilation in asKtSymbolOrigin 2020-07-10 13:02:31 +03:00
Ilya Goncharov
644c5a941b [Gradle, JS] Add task on webpack-compile sync
^KT-40087 fixed

[Gradle, JS] Use runCompileSync only for run

^KT-40087 fixed

[Gradle, JS] Rename type on mode

^KT-40087 fixed

[Gradle, JS] Use explicit names in lambda

^KT-40087 fixed
2020-07-10 12:32:07 +03:00
Anton Bannykh
939f0d0344 [IR] minor: make StageController an open class
This should make creating a new "do nothing" controller more straightforward.
2020-07-10 11:30:42 +03:00
Anton Bannykh
abc6ecaa1c [JS IR BE] support SAM conversions in DCE-driven mode 2020-07-10 11:30:42 +03:00
Anton Bannykh
8fcd73e3cb [JS IR BE] move exceptionState initialization from constructor to coroutine entryState
This fixes the DCE-driven mode. Before this fix the suspend lambda constructor was modified
by the `invoke` body lowering. Which is wrong, becuase the corresponding class was created
by the CallableReferenceLoiwering much earlier.
2020-07-10 11:30:41 +03:00
Anton Bannykh
916a5f367c [IR] simplify Carriers (remove type parameters) 2020-07-10 11:30:41 +03:00
Anton Bannykh
adf5ee394e [JS IR BE] remove unnecesary code from DCE 2020-07-10 11:30:41 +03:00
Victor Petukhov
514ac7dc8f NI: introduce simple calls storage (which aren't gone through type inference) in coroutine inference session to further substitute postponed variable
^KT-40151 Fixed
2020-07-10 11:11:48 +03:00
Kirill Shmakov
3acb4e54d5 Update AS version 2020-07-10 11:06:33 +03:00
Vladimir Ilmov
3e69250f72 (CoroutineDebugger) Restored frame variables isn't shown for 2020.1.
#KT-40172 fixed
2020-07-10 09:57:38 +02:00
Mikhail Glukhikh
fbbf4e06ba [FIR] Support imported callable from object properly #KT-35730 Fixed 2020-07-10 10:25:39 +03:00
Mikhail Glukhikh
6b964cb61d [FIR2IR] Drop explicit receiver double-conversion for objects 2020-07-10 08:56:58 +03:00
Ilya Gorbunov
2f3e1dcbc6 Add EXACTLY_ONCE contract to suspendCoroutine* functions
Update line numbers in the affected test.
2020-07-10 01:05:16 +03:00
Ilya Gorbunov
1a32fdf6d7 Add EXACTLY_ONCE contract to functions that call their lambda parameter once
KT-35972
2020-07-10 01:05:16 +03:00
Ilya Gorbunov
c85432b2f9 Fix typo in kotlinx.dom docs 2020-07-10 01:05:16 +03:00
Ivan Kylchik
c44fd235ce [FIR] Remove isEnumEntry field from FirJavaField
This field isn't used anymore because java enum entry is represented by
FirEnumEntry
2020-07-09 23:49:55 +03:00
Ivan Kylchik
dcae6f1415 [FIR] Support when exhaustiveness for java enum
The problem appear because for java enum its entries was represented by
FirJavaField. To fix this FirEnumEntry was used

#KT-39621 Fixed
2020-07-09 23:49:54 +03:00
Ivan Kylchik
307871a050 [FIR] Unmute fir spec tests
#KT-38397 Fixed
#KT-38334 Fixed
2020-07-09 23:49:39 +03:00
Alexander Udalov
0baa1c8723 IR: remove deprecated constructor of IrClassImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov
e6993e1b88 IR: remove deprecated constructor of IrConstructorImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov
ef94716af5 IR: remove deprecated constructor of IrFieldImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov
7f9ef5e11d IR: remove deprecated constructors of IrFunctionImpl 2020-07-09 18:51:04 +02:00
Alexander Udalov
551f1f85a9 IR: remove secondary constructor of IrModuleFragmentImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov
19ec8646b8 IR: remove convenience factory for IrTypeAliasImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov
fd83596c91 IR: remove deprecated constructor of IrTypeParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov
0691595ed2 IR: remove deprecated constructor of IrValueParameterImpl 2020-07-09 18:51:03 +02:00
Alexander Udalov
bba597cdff IR: remove deprecated constructors of IrVariableImpl 2020-07-09 18:51:02 +02:00
Alexander Udalov
d8a2b92098 IR: remove deprecated constructors of IrPropertyImpl 2020-07-09 18:51:02 +02:00
Vyacheslav Gerasimov
501fea1202 Fix TCServiceMessagesClient compilation against Gradle 6.5
Method `isRoot` doesn't exist anymore in TestDescriptorInternal
2020-07-09 19:31:21 +03:00
Vyacheslav Gerasimov
697bb04d46 Build: Setup jvmTarget 1.6 for several common modules
Some modules depending on them target jvm 1.6 and can't depend on
jvm 1.8 module in Gradle 6.5.
2020-07-09 19:31:20 +03:00
Vyacheslav Gerasimov
b5ee0e8222 Build: Remove jvmTarget 1.6 for several modules depending on 1.8 modules
Module targeting jvm 1.6 can't depend on jvm 8 one. In Gradle 6.5 this
behaviour is enforced by configuration error.
2020-07-09 19:31:20 +03:00
Vyacheslav Gerasimov
1fea01754d Build: Remove jvmTarget = "1.6" for kotlinx-metadata-klib
kotlinx-metadata-klib can't have jvmTarget 1.6 because it embeds module
:compiler:serialization which is compiled with jvmTarget 1.8. It is
enforced by configuration error in Gradle 6.5
2020-07-09 19:31:20 +03:00
Vyacheslav Gerasimov
508036742c Build: Upgrade Gradle to 6.5.1 2020-07-09 19:31:20 +03:00
Ilya Kirillov
39601f99ab Wizard: update ktor version
#KT-40037 fixed
2020-07-09 18:27:43 +03:00
Ilya Kirillov
44334fca11 Wizard: consider RC version as a EAP one
#KT-39871 fixed
2020-07-09 18:27:41 +03:00
Ilya Kirillov
9fde2ac269 Wizard: add kotlinx repo for projects using kotlinx-html
#KT-40004 fixed
2020-07-09 18:27:39 +03:00
Florian Kistner
346df07adc 203: Fix compilation for 203 2020-07-09 15:27:45 +02:00
Florian Kistner
4c4af9971e 203: Bump intellijSdk version for 203 2020-07-09 15:27:45 +02:00
Florian Kistner
202a55cb39 Bump intellijSdk version for 203 2020-07-09 15:27:45 +02:00
Dmitry Gridin
1c4d7c5772 Regenerate test data 2020-07-09 18:37:37 +07:00
Yan Zhulanow
81869b282b Mute failing QuickFixTestGenerated/KotlinSteppingTestGenerated 2020-07-09 19:23:16 +09:00
Ilya Muradyan
2487f9369c Fix REPL completion for import directives 2020-07-09 13:19:04 +03:00
Dmitriy Dolovov
16aee6c8d6 [Commonizer] Lookup descriptors that doesn't participate in commonization
^KT-40119
2020-07-09 16:44:33 +07:00
Dmitriy Dolovov
3af937ea9a [Commonizer] Remove isDefinitelyNotNullType from CirSimpleType 2020-07-09 16:44:32 +07:00
Nikolay Krasko
4d21455e72 Mute testImportAliasMultiDeclarations because of wrong behaviour in headless
Caused by: java.lang.AssertionError: Editor must be showing on the screen
	at com.intellij.ui.popup.AbstractPopup.showInBestPositionFor(AbstractPopup.java:546)
	at com.intellij.codeInsight.navigation.actions.GotoDeclarationOnlyHandler2.gotoDeclaration$intellij_platform_lang_impl(GotoDeclarationOnlyHandler2.kt:74)
	at com.intellij.codeInsight.navigation.actions.GotoDeclarationOrUsageHandler2.invoke(GotoDeclarationOrUsageHandler2.kt:63)
	at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$0(CodeInsightAction.java:57)
	at com.intellij.codeInsight.actions.CodeInsightAction.lambda$actionPerformedImpl$1(CodeInsightAction.java:63)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:158)
	at com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl(CodeInsightAction.java:54)
	at org.jetbrains.kotlin.idea.navigation.AbstractGotoActionTest.doTest(AbstractGotoActionTest.kt:27)
	at org.jetbrains.kotlin.test.KotlinTestUtils.lambda$testWithCustomIgnoreDirective$6(KotlinTestUtils.java:804)
	at org.jetbrains.kotlin.test.MuteWithFileKt$testWithMuteInFile$1.invoke(muteWithFile.kt:41)
	at org.jetbrains.kotlin.test.KotlinTestUtils.runTestImpl(KotlinTestUtils.java:774)
	at org.jetbrains.kotlin.test.KotlinTestUtils.runTest(KotlinTestUtils.java:716)
	at org.jetbrains.kotlin.idea.navigation.GotoDeclarationTestGenerated.runTest(GotoDeclarationTestGenerated.java:24)
	at org.jetbrains.kotlin.idea.navigation.GotoDeclarationTestGenerated.testImportAliasMultiDeclarations(GotoDeclarationTestGenerated.java:38)
2020-07-09 12:43:11 +03:00
Nikolay Krasko
593fd646b1 Add mute-platform.csv.202 2020-07-09 12:43:10 +03:00
Roman Artemev
ca44242f37 [IR] Fix synthetic declarations generator to make it produce correct type
- Fix KT-40126
 - Add test
2020-07-09 11:47:07 +03:00
Igor Chevdar
d8f5b50cd8 [native-gradle-plugin] Respected changed cache format 2020-07-09 12:33:59 +05:00
Igor Chevdar
79af726872 [native-gradle-plugin] Fixed problem with rebuilding caches 2020-07-09 12:33:59 +05:00
Anton Yalyshev
bc979a33f7 Enable FUS for Code Completion in 1.4.0 2020-07-09 10:20:18 +03:00
Dmitriy Dolovov
d3e858645f [Commonizer] Remove CirTypeSignature from CirType 2020-07-09 10:08:13 +07:00
Dmitriy Dolovov
4ab5bfef22 [Commonizer] Preserve order of supertypes in commonized class 2020-07-09 10:08:06 +07:00
Dmitriy Dolovov
5e383e9d71 [Commonizer] Narrow CirClassifierId subtype cast in AnnotationsCommonizer 2020-07-09 10:07:59 +07:00
Dmitriy Dolovov
7a283c64cb [Commonizer] Minor. Reorder type params for CirNode 2020-07-09 10:07:52 +07:00
Andrey Uskov
c37f339d8c Send use-ir and jvmDefaults compiler arguments from IDE
Relates to KT-39924 and KT-39977
2020-07-08 20:39:44 +03:00
Andrey Uskov
550c53c2ac Report jvm-default compiler arguments from Gradle
#KT-39977 Fixed
2020-07-08 20:39:33 +03:00
Andrey Uskov
e3a5df1aaa Report use-ir flag from Gradle
#KT-39924 Fixed
2020-07-08 20:39:14 +03:00
Leonid Startsev
340deb01dd Add 'Incorrect Transient' diagnostic
when users write @Transient, they get @kotlin.jvm.Transient, because it's always in auto-import.
This annotation does not work with @Serializable classes; @kotlinx.serialization.Transient should be used instead.

Add quickfix for 'incorrect transient' diagnostic:
'Import kotlinx.serialization.Transient'
2020-07-08 20:17:11 +03:00
Leonid Startsev
6ef597a4ee Split ContextualSerialization annotation in two 2020-07-08 20:15:56 +03:00
Natalia Selezneva
3d91c410e7 *.gradle.kts: include project sources in script dependencies sources scope
^KT-39523 Fixed
2020-07-08 18:30:02 +03:00
Natalia Selezneva
93d7015139 Remove old roots from KotlinScriptDependenciesCLassFinder
Otherwise it may produce an exception that some invalid roots are returned by ScriptClassRootsCache
2020-07-08 18:30:01 +03:00
Natalia Selezneva
8bb3c0796d Add original errors into the IllegalStateException from import of build script models
This exception is needed to finish gradle import and avoid importing other models into IDE
In most cases this exception is repoted together with Gradle exception from import,
but as soon as it it visible in UI we add some clarification which errors are happened
2020-07-08 18:28:08 +03:00
Jinseong Jeon
3afc37438e FIR: handle getClassCall with integer literals 2020-07-08 18:23:27 +03:00
Vladimir Ilmov
7f472ba24e Switch to isApplicableAsync instead of isApplicable in ToStringRenderer
#KT-39717 fixed
2020-07-08 16:15:46 +02:00
Ilya Goncharov
3d9353f7f5 [Gradle, JS] Add test on dependencies clash
^KT-40093 fixed
2020-07-08 16:10:46 +03:00
Ilya Goncharov
2e2a5a0156 [Gradle, JS] Update version in package.json with file dependency
^KT-40093 fixed
2020-07-08 16:10:39 +03:00
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
Vyacheslav Karpukhin
1ba4d7d99b Update foreign references when renaming a Kotlin file
(cherry picked from commit 1571a87d8f)
2020-05-15 19:45:14 +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
21078 changed files with 675530 additions and 215812 deletions

12
.bunch
View File

@@ -1,7 +1,7 @@
193
201
192
191_192
as35_191_192
as36_192
as40
202
203_202
193
as40_193
as41
as42_202

1
.gitattributes vendored
View File

@@ -3,5 +3,6 @@
* text=auto
* eol=lf
*.png binary
*.jar binary
compiler/cli/bin/* eol=lf
compiler/cli/bin/*.bat eol=crlf

4
.gitignore vendored
View File

@@ -58,5 +58,7 @@ kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-js-runner/lib/
libraries/tools/kotlin-source-map-loader/lib/
local.properties
buildSrcTmp/
distTmp/
outTmp/

View File

@@ -101,4 +101,4 @@
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
</codeStyleSettings>
</code_scheme>
</component>
</component>

View File

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

@@ -0,0 +1,27 @@
<component name="ProjectDictionaryState">
<dictionary name="svyatoslav.kuzmich">
<words>
<w>anyfunc</w>
<w>copysign</w>
<w>eqref</w>
<w>exnref</w>
<w>externref</w>
<w>funcref</w>
<w>jetbrains</w>
<w>kotlinx</w>
<w>ktor</w>
<w>optref</w>
<w>popcnt</w>
<w>rotl</w>
<w>rotr</w>
<w>simd</w>
<w>sqrt</w>
<w>testsuite</w>
<w>uninstantiable</w>
<w>unlinkable</w>
<w>vtable</w>
<w>wabt</w>
<w>xopt</w>
</words>
</dictionary>
</component>

View File

@@ -10,7 +10,10 @@
<w>kapt</w>
<w>kotlinc</w>
<w>mutators</w>
<w>parcelable</w>
<w>parceler</w>
<w>parcelers</w>
<w>parcelize</w>
<w>repl</w>
<w>testdata</w>
<w>uast</w>

View File

@@ -453,4 +453,4 @@
<option name="ignoreNonEmtpyLoops" value="false" />
</inspection_tool>
</profile>
</component>
</component>

2
.idea/misc.xml generated
View File

@@ -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[group:kotlin-ultimate]:*/&amp;&amp;!file[kotlin.libraries]:stdlib/api//*" />
</component>

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,16 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Public Slack channel](https://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Kotlin Multiplatform capabilities
Support for multiplatform programming is one of Kotlins key benefits. It reduces time spent writing and maintaining the same code for [different platforms](https://kotlinlang.org/docs/reference/mpp-supported-platforms.html) while retaining the flexibility and benefits of native programming.
* [Kotlin Multiplatform Mobile](https://kotlinlang.org/lp/mobile/) for sharing code between Android and iOS
* [Getting Started with Kotlin Multiplatform Mobile Guide](https://kotlinlang.org/docs/mobile/create-first-app.html)
* [Kotlin Multiplatform Benefits](https://kotlinlang.org/docs/reference/multiplatform.html)
* [Share code on all platforms](https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#share-code-on-all-platforms)
* [Share code on similar platforms](https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#share-code-on-similar-platforms)
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
@@ -41,7 +51,12 @@ For local development, if you're not working on bytecode generation or the stand
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_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:
@@ -81,6 +96,8 @@ command line parameters on the first run:
- `compilerTest` - build and run all compiler tests
- `ideaPluginTest` - build and run all IDEA plugin tests
To reproduce TeamCity build use `-Pteamcity=true` flag. Local builds don't run proguard and have jar compression disabled by default.
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately with Maven.
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.

View File

@@ -8,10 +8,8 @@ buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
}
dependencies {
@@ -30,22 +28,19 @@ repositories {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
} else {
} else {
maven("https://dl.bintray.com/kotlin/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
}
}
dependencies {
compile(kotlinStdlib())
compile(project(":compiler:frontend"))
compile(projectTests(":compiler:tests-common"))
compile(project(":compiler:cli"))
compile(intellijCoreDep()) { includeJars("intellij-core") }
compile(jpsStandalone()) { includeJars("jps-model") }
Platform[192].orHigher {
compile(intellijPluginDep("java"))
}
compile(intellijPluginDep("java"))
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compile("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:$benchmarks_version")
}
@@ -73,6 +68,7 @@ benchmark {
param("size", 1000)
include("CommonCallsBenchmark")
include("ControlFlowAnalysisBenchmark")
//include("InferenceBaselineCallsBenchmark")
}
@@ -95,3 +91,52 @@ benchmark {
register("main")
}
}
tasks.named("classes") {
doLast {
tasks.named("mainBenchmarkJar", Zip::class.java) {
isZip64 = true
archiveName = "benchmarks.jar"
}
listOf("mainBenchmark", "mainFirBenchmark", "mainNiBenchmark").forEach {
tasks.named(it, JavaExec::class.java) {
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
}
}
}
}
tasks.register<JavaExec>("runBenchmark") {
// jmhArgs example: -PjmhArgs='CommonCalls -p size=500 -p isIR=true -p useNI=true -f 1'
val jmhArgs = if (project.hasProperty("jmhArgs")) project.property("jmhArgs").toString() else ""
val resultFilePath = "$buildDir/benchmarks/jmh-result.json"
val ideaHome = intellijRootDir().canonicalPath
val benchmarkJarPath = "$buildDir/benchmarks/main/jars/benchmarks.jar"
args = mutableListOf("-Didea.home.path=$ideaHome", benchmarkJarPath, "-rf", "json", "-rff", resultFilePath) + jmhArgs.split("\\s".toRegex())
main = "-jar"
doLast {
if (project.kotlinBuildProperties.isTeamcityBuild) {
val jsonArray = com.google.gson.JsonParser.parseString(File(resultFilePath).readText()).asJsonArray
jsonArray.forEach {
val benchmark = it.asJsonObject
// remove unnecessary name parts from string like this "org.jetbrains.kotlin.benchmarks.CommonCallsBenchmark.benchmark"
val name = benchmark["benchmark"].asString.removeSuffix(".benchmark").let {
val indexOfLastDot = it.indexOfLast { it == '.' }
it.removeRange(0..indexOfLastDot)
}
val params = benchmark["params"].asJsonObject
val isIR = if (params.has("isIR")) params["isIR"].asString else "false"
val useNI = if (params.has("useNI")) params["useNI"].asString else "false"
val size = params["size"].asString
val score = "%.3f".format(benchmark["primaryMetric"].asJsonObject["score"].asString.toFloat())
val irPostfix = if (isIR.toBoolean()) " isIR=true" else ""
val niPostfix = if (useNI.toBoolean() && !isIR.toBoolean()) " isNI=true" else ""
println("""##teamcity[buildStatisticValue key='$name size=$size${irPostfix}$niPostfix' value='$score']""")
}
}
}
}

View File

@@ -5,7 +5,6 @@
package org.jetbrains.kotlin.benchmarks
import com.intellij.openapi.Disposable
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.psi.PsiElementFinder
@@ -13,7 +12,6 @@ import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl.PsiFileFactoryImpl
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.kotlin.analyzer.ModuleInfo
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
@@ -26,21 +24,15 @@ import org.jetbrains.kotlin.context.withModule
import org.jetbrains.kotlin.context.withProject
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
import org.jetbrains.kotlin.fir.java.FirJavaModuleBasedSession
import org.jetbrains.kotlin.fir.java.FirLibrarySession
import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider
import org.jetbrains.kotlin.fir.createSession
import org.jetbrains.kotlin.fir.java.FirJavaElementFinder
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
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
import org.jetbrains.kotlin.storage.ExceptionTracker
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager
@@ -66,10 +58,10 @@ 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()
@@ -81,10 +73,10 @@ private fun newConfiguration(useNewInference: Boolean): CompilerConfiguration {
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 +97,19 @@ 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)
PsiElementFinder.EP.getPoint(env.project).unregisterExtension(JavaElementFinder::class.java)
}
file = createFile(
"test.kt",
buildText(),
env.project
"test.kt",
buildText(),
env.project
)
}
@@ -134,22 +124,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,56 +149,21 @@ 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 builder = RawFirBuilder(session, firProvider.kotlinScopeProvider)
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())
env.project.extensionArea
.getExtensionPoint<PsiElementFinder>(PsiElementFinder.EP.name)
.unregisterExtension(FirJavaElementFinder::class.java)
}
protected abstract fun buildText(): String
}
fun createSession(
environment: KotlinCoreEnvironment,
sourceScope: GlobalSearchScope,
librariesScope: GlobalSearchScope = GlobalSearchScope.notScope(sourceScope)
): FirSession {
val moduleInfo = FirTestModuleInfo()
val project = environment.project
val provider = FirProjectSessionProvider(project)
return FirJavaModuleBasedSession(moduleInfo, provider, sourceScope).also {
createSessionForDependencies(provider, moduleInfo, librariesScope, environment)
}
}
private fun createSessionForDependencies(
provider: FirProjectSessionProvider,
moduleInfo: FirTestModuleInfo,
librariesScope: GlobalSearchScope,
environment: KotlinCoreEnvironment
) {
val dependenciesInfo = FirTestModuleInfo()
moduleInfo.dependencies.add(dependenciesInfo)
FirLibrarySession.create(
dependenciesInfo, provider, librariesScope, environment.project,
environment.createPackagePartProvider(librariesScope)
)
}
class FirTestModuleInfo(
override val name: Name = Name.identifier("TestModule"),
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
override val platform: TargetPlatform = JvmPlatforms.unspecifiedJvmPlatform,
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
) : ModuleInfo {
override fun dependencies(): List<ModuleInfo> = dependencies
}

View File

@@ -0,0 +1,35 @@
/*
* 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 ControlFlowAnalysisBenchmark : AbstractSimpleFileBenchmark() {
@Param("1000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
buildString {
appendLine("fun test() {")
for (i in 0 until size) {
appendLine("for (i$i in 0..10) { ")
}
for (i in 0 until size) {
appendLine("}")
}
appendLine("}")
}
}

View File

@@ -23,28 +23,28 @@ open class ManyImplicitReceiversBenchmark : AbstractSimpleFileBenchmark() {
override fun buildText(): String {
return buildString {
appendln("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
appendLine("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
for (i in 1..size) {
appendln("interface A$i {")
appendln(" fun foo$i()")
appendln("}")
appendln()
appendLine("interface A$i {")
appendLine(" fun foo$i()")
appendLine("}")
appendLine()
}
appendln()
appendLine()
append("fun test(")
append((1..size).joinToString(", ") { "a$it: A$it" })
appendln(" {")
appendLine(" {")
for (i in 1..size) {
appendln("with(a$i) {")
appendLine("with(a$i) {")
}
for (i in 1..size) {
appendln("foo$i()")
appendLine("foo$i()")
}
for (i in 1..size) {
appendln("}")
appendLine("}")
}
appendln("}")
appendLine("}")
}
}
}

View File

@@ -22,7 +22,7 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark()
}
override fun buildText(): String = buildString {
appendln(
appendLine(
"""
class A {
operator fun <T : Number> plus(other: (Int) -> T): A = this
@@ -30,19 +30,20 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark()
}
""".trimIndent()
)
appendln("fun test() {")
appendln("var a = A()")
appendLine("fun test() {")
appendLine("var a = A()")
for (i in 1..size) {
appendln("a += {")
appendLine("a += {")
}
for (i in 1..size) {
appendln(
appendLine(
"""
it.inc()
1
}
""".trimIndent())
""".trimIndent()
)
}
appendln()
appendLine()
}
}

View File

@@ -7,6 +7,7 @@ plugins {
dependencies {
compileOnly(project(":core:util.runtime"))
compileOnly(project(":compiler:backend.common.jvm"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":compiler:frontend.java"))

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
/*
* 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.build
import java.io.Serializable
enum class ExecutionStrategy : Serializable {
DAEMON, IN_PROCESS, OUT_OF_PROCESS
}

View File

@@ -0,0 +1,24 @@
/*
* 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.build.report
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
import org.jetbrains.kotlin.build.report.metrics.RemoteBuildMetricsReporter
open class BuildReporter(
protected open val icReporter: ICReporter,
protected open val buildMetricsReporter: BuildMetricsReporter
) : ICReporter by icReporter, BuildMetricsReporter by buildMetricsReporter
class RemoteBuildReporter(
override val icReporter: RemoteICReporter,
override val buildMetricsReporter: RemoteBuildMetricsReporter
) : BuildReporter(icReporter, buildMetricsReporter), RemoteReporter {
override fun flush() {
icReporter.flush()
buildMetricsReporter.flush()
}
}

View File

@@ -3,7 +3,7 @@
* 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
package org.jetbrains.kotlin.build.report
import org.jetbrains.kotlin.cli.common.ExitCode
import java.io.File
@@ -17,3 +17,5 @@ interface ICReporter {
fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String)
fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String)
}

View File

@@ -1,9 +1,9 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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
package org.jetbrains.kotlin.build.report
import java.io.File

View File

@@ -0,0 +1,9 @@
/*
* 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.build.report
interface RemoteICReporter : ICReporter,
RemoteReporter

View File

@@ -0,0 +1,11 @@
/*
* 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.build.report
interface RemoteReporter {
fun flush()
}

View File

@@ -0,0 +1,37 @@
/*
* 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.build.report.metrics
import java.io.Serializable
enum class BuildAttributeKind : Serializable {
REBUILD_REASON;
companion object {
const val serialVersionUID = 0L
}
}
enum class BuildAttribute(val kind: BuildAttributeKind) : Serializable {
NO_BUILD_HISTORY(BuildAttributeKind.REBUILD_REASON),
CACHE_CORRUPTION(BuildAttributeKind.REBUILD_REASON),
UNKNOWN_CHANGES_IN_GRADLE_INPUTS(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNTRACKED_FILE_IS_REMOVED(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNEXPECTED_PSI(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNKNOWN_QUALIFIER(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_REMOVED_ENTRY(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_IS_NOT_FOUND(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_CANNOT_BE_READ(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_NO_KNOWN_BUILDS(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_NON_INCREMENTAL_BUILD_IN_DEP(BuildAttributeKind.REBUILD_REASON),
IN_PROCESS_EXECUTION(BuildAttributeKind.REBUILD_REASON),
OUT_OF_PROCESS_EXECUTION(BuildAttributeKind.REBUILD_REASON),
IC_IS_NOT_ENABLED(BuildAttributeKind.REBUILD_REASON);
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -0,0 +1,30 @@
/*
* 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.build.report.metrics
import java.io.Serializable
import java.util.*
class BuildAttributes : Serializable {
private val myAttributes =
EnumMap<BuildAttribute, Int>(
BuildAttribute::class.java
)
fun add(attr: BuildAttribute, count: Int = 1) {
myAttributes[attr] = myAttributes.getOrDefault(attr, 0) + count
}
fun addAll(other: BuildAttributes) {
other.myAttributes.forEach { (attr, n) -> add(attr, n) }
}
fun asMap(): Map<BuildAttribute, Int> = myAttributes
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -0,0 +1,22 @@
/*
* 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.build.report.metrics
import java.io.Serializable
data class BuildMetrics(
val buildTimes: BuildTimes = BuildTimes(),
val buildAttributes: BuildAttributes = BuildAttributes()
) : Serializable {
fun addAll(other: BuildMetrics) {
buildTimes.addAll(other.buildTimes)
buildAttributes.addAll(other.buildAttributes)
}
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -0,0 +1,28 @@
/*
* 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.build.report.metrics
interface BuildMetricsReporter {
fun startMeasure(metric: BuildTime, startNs: Long)
fun endMeasure(metric: BuildTime, endNs: Long)
fun addAttribute(attribute: BuildAttribute)
fun getMetrics(): BuildMetrics
fun addMetrics(metrics: BuildMetrics?)
}
inline fun <T> BuildMetricsReporter.measure(metric: BuildTime, fn: () -> T): T {
val start = System.nanoTime()
startMeasure(metric, start)
try {
return fn()
} finally {
val end = System.nanoTime()
endMeasure(metric, end)
}
}

View File

@@ -0,0 +1,47 @@
/*
* 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.build.report.metrics
import java.util.*
class BuildMetricsReporterImpl : BuildMetricsReporter {
private val myBuildTimeStartNs: EnumMap<BuildTime, Long> =
EnumMap(
BuildTime::class.java
)
private val myBuildTimes = BuildTimes()
private val myBuildAttributes = BuildAttributes()
override fun startMeasure(metric: BuildTime, startNs: Long) {
if (metric in myBuildTimeStartNs) {
error("$metric was restarted before it finished")
}
myBuildTimeStartNs[metric] = startNs
}
override fun endMeasure(metric: BuildTime, endNs: Long) {
val startNs = myBuildTimeStartNs.remove(metric) ?: error("$metric finished before it started")
val durationNs = endNs - startNs
myBuildTimes.add(metric, durationNs)
}
override fun addAttribute(attribute: BuildAttribute) {
myBuildAttributes.add(attribute)
}
override fun getMetrics(): BuildMetrics =
BuildMetrics(
buildTimes = myBuildTimes,
buildAttributes = myBuildAttributes
)
override fun addMetrics(metrics: BuildMetrics?) {
if (metrics == null) return
myBuildAttributes.addAll(metrics.buildAttributes)
myBuildTimes.addAll(metrics.buildTimes)
}
}

View File

@@ -0,0 +1,43 @@
/*
* 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.build.report.metrics
import java.io.Serializable
@Suppress("Reformat")
enum class BuildTime(val parent: BuildTime? = null) : Serializable {
GRADLE_TASK,
CLEAR_OUTPUT(GRADLE_TASK),
BACKUP_OUTPUT(GRADLE_TASK),
RESTORE_OUTPUT_FROM_BACKUP(GRADLE_TASK),
CONNECT_TO_DAEMON(GRADLE_TASK),
CLEAR_JAR_CACHE(GRADLE_TASK),
RUN_COMPILER(GRADLE_TASK),
NON_INCREMENTAL_COMPILATION_IN_PROCESS(RUN_COMPILER),
NON_INCREMENTAL_COMPILATION_OUT_OF_PROCESS(RUN_COMPILER),
NON_INCREMENTAL_COMPILATION_DAEMON(RUN_COMPILER),
INCREMENTAL_COMPILATION(RUN_COMPILER),
IC_CALCULATE_INITIAL_DIRTY_SET(INCREMENTAL_COMPILATION),
IC_ANALYZE_CHANGES_IN_DEPENDENCIES(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_FIND_HISTORY_FILES(IC_ANALYZE_CHANGES_IN_DEPENDENCIES),
IC_ANALYZE_HISTORY_FILES(IC_ANALYZE_CHANGES_IN_DEPENDENCIES),
IC_ANALYZE_CHANGES_IN_JAVA_SOURCES(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_ANALYZE_CHANGES_IN_ANDROID_LAYOUTS(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_DETECT_REMOVED_CLASSES(IC_CALCULATE_INITIAL_DIRTY_SET),
CLEAR_OUTPUT_ON_REBUILD(INCREMENTAL_COMPILATION),
IC_UPDATE_CACHES(INCREMENTAL_COMPILATION),
INCREMENTAL_ITERATION(INCREMENTAL_COMPILATION),
NON_INCREMENTAL_ITERATION(INCREMENTAL_COMPILATION),
IC_WRITE_HISTORY_FILE(INCREMENTAL_COMPILATION);
companion object {
const val serialVersionUID = 0L
val children by lazy {
values().filter { it.parent != null }.groupBy { it.parent }
}
}
}

View File

@@ -0,0 +1,29 @@
/*
* 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.build.report.metrics
import java.io.Serializable
import java.util.*
class BuildTimes : Serializable {
private val myBuildTimes = EnumMap<BuildTime, Long>(BuildTime::class.java)
fun addAll(other: BuildTimes) {
for ((bt, timeNs) in other.myBuildTimes) {
add(bt, timeNs)
}
}
fun add(buildTime: BuildTime, timeNs: Long) {
myBuildTimes[buildTime] = myBuildTimes.getOrDefault(buildTime, 0) + timeNs
}
fun asMap(): Map<BuildTime, Long> = myBuildTimes
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -0,0 +1,25 @@
/*
* 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.build.report.metrics
object DoNothingBuildMetricsReporter : BuildMetricsReporter {
override fun startMeasure(metric: BuildTime, startNs: Long) {
}
override fun endMeasure(metric: BuildTime, endNs: Long) {
}
override fun addAttribute(attribute: BuildAttribute) {
}
override fun getMetrics(): BuildMetrics =
BuildMetrics(
BuildTimes(),
BuildAttributes()
)
override fun addMetrics(metrics: BuildMetrics?) {}
}

View File

@@ -0,0 +1,11 @@
/*
* 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.build.report.metrics
import org.jetbrains.kotlin.build.report.RemoteReporter
interface RemoteBuildMetricsReporter : BuildMetricsReporter,
RemoteReporter

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

@@ -75,7 +75,7 @@ open class IncrementalJsCache(
override fun markDirty(removedAndCompiledSources: Collection<File>) {
removedAndCompiledSources.forEach { sourceFile ->
// The common prefix of all FQN parents has to be the file package
sourceToClassesMap[sourceFile].map { it.parentOrNull()?.asString() ?: "" }.minBy { it.length }?.let {
sourceToClassesMap[sourceFile].map { it.parentOrNull()?.asString() ?: "" }.minByOrNull { it.length }?.let {
packageMetadata.remove(it)
}
}

View File

@@ -168,6 +168,8 @@ open class IncrementalJvmCache(
constantsMap.process(kotlinClass, changesCollector)
inlineFunctionsMap.process(kotlinClass, changesCollector)
}
KotlinClassHeader.Kind.UNKNOWN, KotlinClassHeader.Kind.SYNTHETIC_CLASS -> {
}
}
}

View File

@@ -17,7 +17,7 @@
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.load.java.JavaVisibilities
import org.jetbrains.kotlin.load.java.JavaDescriptorVisibilities
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
import org.jetbrains.kotlin.metadata.java.JavaClassProtoBuf
@@ -41,7 +41,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
childSerializer: DescriptorSerializer
) {
super.serializeClass(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
if (descriptor.visibility == JavaDescriptorVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateClass, true)
}
}
@@ -50,7 +50,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
proto: ProtoBuf.Constructor.Builder,
childSerializer: DescriptorSerializer) {
super.serializeConstructor(descriptor, proto, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
if (descriptor.visibility == JavaDescriptorVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateConstructor, true)
}
}
@@ -62,7 +62,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
childSerializer: DescriptorSerializer
) {
super.serializeFunction(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
if (descriptor.visibility == JavaDescriptorVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateMethod, true)
}
@@ -78,7 +78,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)
if (descriptor.visibility == JavaVisibilities.PACKAGE_VISIBILITY) {
if (descriptor.visibility == JavaDescriptorVisibilities.PACKAGE_VISIBILITY) {
proto.setExtension(JavaClassProtoBuf.isPackagePrivateField, true)
}

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

@@ -23,12 +23,12 @@ import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
class LocalFileKotlinClass private constructor(
private val file: File,
private val fileContents: ByteArray,
className: ClassId,
classVersion: Int,
classHeader: KotlinClassHeader,
innerClasses: InnerClassesInfo
private val file: File,
private val fileContents: ByteArray,
className: ClassId,
classVersion: Int,
classHeader: KotlinClassHeader,
innerClasses: InnerClassesInfo
) : FileBasedKotlinClass(className, classVersion, classHeader, innerClasses) {
companion object {

View File

@@ -80,7 +80,7 @@ open class LookupStorage(
for (lookupSymbol in lookups.keySet().sorted()) {
val key = LookupSymbolKey(lookupSymbol.name, lookupSymbol.scope)
val paths = lookups[lookupSymbol]!!
val paths = lookups[lookupSymbol]
val fileIds = paths.mapTo(TreeSet()) { pathToId[it]!! }
fileIds.addAll(lookupMap[key] ?: emptySet())
lookupMap[key] = fileIds

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
@file:Suppress("UNUSED_PARAMETER")
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.library.metadata.KlibMetadataProtoBuf

View File

@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.build.isModuleMappingFile
import org.jetbrains.kotlin.build.report.ICReporter
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCache
@@ -31,6 +32,7 @@ import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.resolve.sam.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
import java.io.File
import java.nio.file.Files
import java.util.*
import kotlin.collections.HashSet
import kotlin.collections.LinkedHashSet
@@ -66,7 +68,7 @@ fun makeModuleFile(
friendDirs
)
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
val scriptFile = Files.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml").toFile()
scriptFile.writeText(builder.asText().toString())
return scriptFile
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufClassKind
import org.jetbrains.kotlin.incremental.ProtoCompareGenerated.ProtoBufPackageKind
import org.jetbrains.kotlin.incremental.storage.ProtoMapValue
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.protobuf.MessageLite
import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags
import org.jetbrains.kotlin.serialization.deserialization.descriptorVisibility
import java.util.*
data class Difference(
@@ -49,8 +50,8 @@ fun ProtoMapValue.toProtoData(packageFqName: FqName): ProtoData =
}
internal val MessageLite.isPrivate: Boolean
get() = Visibilities.isPrivate(
ProtoEnumFlags.visibility(
get() = DescriptorVisibilities.isPrivate(
ProtoEnumFlags.descriptorVisibility(
when (this) {
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
@@ -346,4 +347,4 @@ val ProtoBuf.Class.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null
val ProtoBuf.Package.typeTableOrNull: ProtoBuf.TypeTable?
get() = if (hasTypeTable()) typeTable else null
get() = if (hasTypeTable()) typeTable else null

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

@@ -0,0 +1,34 @@
/*
* 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.storage
import java.io.File
open class IncrementalFileToPathConverter(val rootProjectDir: File?) : FileToPathConverter {
//project root dir
private val projectDirPath = rootProjectDir?.normalize()?.absolutePath
override fun toPath(file: File): String {
val path = file.normalize().absolutePath
return when {
projectDirPath == null || !path.startsWith(projectDirPath) -> path
else -> PROJECT_DIR_PLACEHOLDER + path.substring(projectDirPath.length)
}
}
override fun toFile(path: String): File =
when {
rootProjectDir != null && path.startsWith(PROJECT_DIR_PLACEHOLDER) -> rootProjectDir.resolve(path.substring(PATH_PREFIX.length))
else -> File(path)
}
private companion object {
private const val PROJECT_DIR_PLACEHOLDER = "${'$'}PROJECT_DIR$"
//use only for prefix length because it OS dependent
private const val PATH_PREFIX = "$PROJECT_DIR_PLACEHOLDER/"
}
}

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

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

View File

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

@@ -0,0 +1,62 @@
/*
* 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.storage
import org.jetbrains.kotlin.TestWithWorkingDir
import org.junit.Test
import java.io.File
internal class IncrementalFileToPathConverterTest : TestWithWorkingDir() {
val separator: String = File.separator
@Test
fun testPathTransform() {
val relativeFilePath = "testFile.txt"
val transformedPath = testPathTransformation(workingDir.resolve("testDir"), relativeFilePath)
assertEquals("${'$'}PROJECT_DIR${'$'}$separator$relativeFilePath", transformedPath)
}
@Test
fun testComplicatedProjectRootPath() {
val relativeFilePath = "testFile.txt"
val transformedPath = testPathTransformation(workingDir.resolve("first$separator..${separator}testDir"), relativeFilePath)
assertEquals("${'$'}PROJECT_DIR${'$'}$separator$relativeFilePath", transformedPath)
}
@Test
fun testInccorectProjectRootPath() {
val relativeFilePath = "testFile.txt"
val transformedPath = testPathTransformation(workingDir.resolve("testDir$separator"), relativeFilePath)
assertEquals("${'$'}PROJECT_DIR${'$'}$separator$relativeFilePath", transformedPath)
}
@Test
fun testFileOutOfProject() {
val relativeFilePath = "..${separator}testFile.txt"
val transformedPath = testPathTransformation(workingDir.resolve("testDir"), relativeFilePath)
assertEquals("${workingDir.absolutePath}${separator}testFile.txt", transformedPath)
}
@Test
fun testFileWithExtraSlash() {
val relativeFilePath = "testFile.txt$separator"
val transformedPath = testPathTransformation(workingDir.resolve("testDir"), relativeFilePath)
assertEquals("${'$'}PROJECT_DIR${'$'}${separator}testFile.txt", transformedPath)
}
private fun testPathTransformation(projectRoot: File, relativeFilePath: String): String {
val pathConverter = IncrementalFileToPathConverter(projectRoot)
val testFile = projectRoot.resolve(relativeFilePath)
val transformedPath = pathConverter.toPath(testFile)
assertEquals(testFile.normalize().absolutePath, pathConverter.toFile(transformedPath).normalize().absolutePath)
return transformedPath
}
}

View File

@@ -17258,6 +17258,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
boolean hasFlags();
@@ -17268,6 +17269,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
int getFlags();
@@ -17463,6 +17465,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public boolean hasFlags() {
@@ -17475,6 +17478,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public int getFlags() {
@@ -17894,6 +17898,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public boolean hasFlags() {
@@ -17906,6 +17911,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public int getFlags() {
@@ -17918,6 +17924,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public Builder setFlags(int value) {
@@ -17933,6 +17940,7 @@ public final class DebugProtoBuf {
*hasAnnotations
*Visibility
*isSecondary
*hasNonStableParameterNames
* </pre>
*/
public Builder clearFlags() {
@@ -18307,6 +18315,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
boolean hasFlags();
@@ -18325,6 +18334,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
int getFlags();
@@ -18723,6 +18733,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public boolean hasFlags() {
@@ -18743,6 +18754,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public int getFlags() {
@@ -19639,6 +19651,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public boolean hasFlags() {
@@ -19659,6 +19672,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public int getFlags() {
@@ -19679,6 +19693,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public Builder setFlags(int value) {
@@ -19702,6 +19717,7 @@ public final class DebugProtoBuf {
*isExternal
*isSuspend
*isExpect
*hasNonStableParameterNames
* </pre>
*/
public Builder clearFlags() {

View File

@@ -4656,7 +4656,8 @@ public final class DebugJvmProtoBuf {
* <code>extend .org.jetbrains.kotlin.metadata.Class { ... }</code>
*
* <pre>
* isFunctionBodyInInterface: 0 if actual body generated in DefaultImpl, 1 - otherwise (in interface default method)
* first bit: isFunctionBodyInInterface: 0 if actual body generated in DefaultImpl, 1 - otherwise (in interface default method)
* second bit: is all-compatibility mode or not, 1 - yes, 0 - no
* </pre>
*/
public static final

View File

@@ -1,4 +1,5 @@
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.KotlinCompile
import proguard.gradle.ProGuardTask
@@ -6,7 +7,7 @@ import proguard.gradle.ProGuardTask
buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
kotlinBootstrapFrom(BootstrapOption.SpaceBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
repositories {
bootstrapKotlinRepo?.let(::maven)
@@ -26,10 +27,11 @@ buildscript {
dependencies {
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
classpath("com.gradle.publish:plugin-publish-plugin:0.11.0")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath(kotlin("serialization", bootstrapKotlinVersion))
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
classpath("org.jfrog.buildinfo:build-info-extractor-gradle:4.17.2")
}
}
@@ -42,6 +44,8 @@ plugins {
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
id("org.gradle.crypto.checksum") version "1.2.0"
signing
}
pill {
@@ -150,6 +154,7 @@ rootProject.apply {
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)
@@ -163,9 +168,8 @@ 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"
extra["versions.kotlinx-coroutines-core"] = coroutinesVersion
extra["versions.kotlinx-coroutines-jdk8"] = coroutinesVersion
extra["versions.kotlinx-coroutines-core"] = "1.3.8"
extra["versions.kotlinx-coroutines-jdk8"] = "1.3.8"
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -174,8 +178,8 @@ extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
extra["versions.completion-ranking-kotlin"] = "0.1.2"
extra["versions.r8"] = "1.5.70"
extra["versions.completion-ranking-kotlin"] = "0.1.3"
extra["versions.r8"] = "2.0.88"
val immutablesVersion = "0.3.1"
extra["versions.kotlinx-collections-immutable"] = immutablesVersion
extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
@@ -184,12 +188,13 @@ extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.4-M3-dev-15453"
extra["versions.kotlin-native"] = "1.4.30-dev-17200"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
val useJvmIrBackend by extra(project.kotlinBuildProperties.useIR)
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
@@ -197,7 +202,10 @@ 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",
@@ -214,6 +222,8 @@ extra["compilerModules"] = arrayOf(
":compiler:config",
":compiler:config.jvm",
":compiler:container",
":compiler:resolution.common",
":compiler:resolution.common.jvm",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
@@ -222,6 +232,8 @@ extra["compilerModules"] = arrayOf(
":compiler:frontend.java",
":compiler:cli-common",
":compiler:ir.tree",
":compiler:ir.tree.impl",
":compiler:ir.tree.persistent",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
@@ -230,6 +242,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",
@@ -255,17 +268,22 @@ extra["compilerModules"] = arrayOf(
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:deserialization.common",
":core:deserialization.common.jvm",
":core:compiler.common",
":core:compiler.common.jvm",
":compiler:backend.common.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:descriptors.runtime",
":core:deserialization",
":core:util.runtime",
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:fir-serialization",
":compiler:fir:fir-deserialization",
":compiler:fir:tree",
":compiler:fir:raw-fir:fir-common",
":compiler:fir:raw-fir:raw-fir.common",
":compiler:fir:raw-fir:psi2fir",
":compiler:fir:raw-fir:light-tree2fir",
":compiler:fir:fir2ir",
@@ -273,14 +291,38 @@ extra["compilerModules"] = arrayOf(
":compiler:fir:java",
":compiler:fir:jvm",
":compiler:fir:checkers",
":compiler:fir:analysis-tests"
":compiler:fir:entrypoint",
":compiler:fir:analysis-tests",
":wasm:wasm.ir"
)
extra["compilerModulesForJps"] = listOf(
":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:compiler.common",
":core:compiler.common.jvm",
":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",
":kotlin-stdlib-js-ir",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-annotations-common",
@@ -290,22 +332,18 @@ val coreLibProjects = listOfNotNull(
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlin-test:kotlin-test-js-ir".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync },
":kotlin-reflect",
":kotlin-coroutines-experimental-compat"
)
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"
":kotlin-sam-with-receiver",
":kotlin-parcelize-compiler"
)
apply {
@@ -329,12 +367,28 @@ fun Task.listConfigurationContents(configName: String) {
}
val defaultJvmTarget = "1.8"
val defaultJavaHome = jdkPath(defaultJvmTarget)
val defaultJavaHome = jdkPath(if (Platform[203].orHigher()) "11" else defaultJvmTarget)
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
@@ -366,9 +420,6 @@ allprojects {
val commonCompilerArgs = listOfNotNull(
"-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") }
)
@@ -380,9 +431,21 @@ allprojects {
}
}
val jvmCompilerArgs = listOf(
"-Xjvm-default=compatibility",
"-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception",
"-Xnormalize-constructor-calls=enable"
)
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile> {
kotlinOptions {
freeCompilerArgs = commonCompilerArgs + listOf("-Xnormalize-constructor-calls=enable")
freeCompilerArgs = commonCompilerArgs + jvmCompilerArgs
if (useJvmIrBackend) {
useIR = true
freeCompilerArgs += "-Xir-binary-with-stable-abi"
}
}
}
@@ -412,6 +475,7 @@ allprojects {
ignore("META-INF/MANIFEST.MF")
ignore("META-INF/compiler.version")
ignore("META-INF/plugin.xml")
ignore("kotlin/KotlinVersionCurrentValue.class")
}
}
@@ -461,6 +525,23 @@ allprojects {
}
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
apply(from = "$rootDir/gradle/testRetry.gradle.kts")
}
}
gradle.buildFinished {
val taskGraph = gradle?.taskGraph
if (taskGraph != null) {
taskGraph.allTasks
.filterIsInstance<SourceTask>()
.filter { it.didWork }
.forEach {
it.source.visit {
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
logger.warn("Empty source directories may cause build cache misses: " + file.absolutePath)
}
}
}
}
}
@@ -468,9 +549,12 @@ gradle.taskGraph.whenReady {
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")
val proguardMessage = "proguard is ${kotlinBuildProperties.proguard.toOnOff()}"
val jarCompressionMessage = "jar compression is ${kotlinBuildProperties.jarCompression.toOnOff()}"
val profileMessage = "$profile build profile is active ($proguardMessage, $jarCompressionMessage). " +
"Use -Pteamcity=<true|false> to reproduce CI/local build"
logger.warn("\n\n$profileMessage")
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
task.entryCompression = if (kotlinBuildProperties.jarCompression)
@@ -484,6 +568,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)
@@ -509,7 +597,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") }
}
@@ -518,6 +606,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"
@@ -561,8 +651,11 @@ tasks {
}
register("wasmCompilerTest") {
// TODO: fix once
// dependsOn(":js:js.tests:wasmTest")
dependsOn(":js:js.tests:wasmTest")
// Windows WABT release requires Visual C++ Redistributable
if (!kotlinBuildProperties.isTeamcityBuild || !org.gradle.internal.os.OperatingSystem.current().isWindows) {
dependsOn(":wasm:wasm.ir:test")
}
}
register("nativeCompilerTest") {
@@ -583,7 +676,6 @@ tasks {
":compiler:fir:raw-fir:light-tree2fir:test",
":compiler:fir:analysis-tests:test",
":compiler:fir:fir2ir:test",
":idea:idea-fir:test",
":plugins:fir:fir-plugin-prototype:test"
)
}
@@ -595,7 +687,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")
@@ -607,12 +699,17 @@ tasks {
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")
@@ -621,9 +718,12 @@ tasks {
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
dependsOn(":compiler:incremental-compilation-impl:test")
dependsOn(":compiler:incremental-compilation-impl:testJvmICWithJdk11")
dependsOn(":core:descriptors.runtime:test")
dependsOn("jvmCompilerIntegrationTest")
dependsOn(":plugins:parcelize:parcelize-compiler:test")
}
register("toolsTest") {
@@ -659,16 +759,9 @@ tasks {
dependsOn(":jps-plugin:test")
}
register("idea-plugin-main-tests") {
dependsOn("dist")
dependsOn(":idea:test")
}
register("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":nj2k:test",
@@ -676,8 +769,7 @@ tasks {
":idea:jvm-debugger:jvm-debugger-evaluation:test",
":idea:jvm-debugger:jvm-debugger-sequence:test",
":idea:jvm-debugger:eval4j:test",
":idea:scripting-support:test",
":idea:idea-fir:test"
":idea:scripting-support:test"
)
}
@@ -692,37 +784,57 @@ tasks {
}
}
register("idea-plugin-tests") {
dependsOn("dist")
register("idea-plugin-performance-tests") {
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
"dist",
":idea:performanceTests:performanceTest",
":idea:performanceTests:aggregateResults"
)
if (Ide.IJ()) {
dependsOn("idea-new-project-wizard-tests")
}
}
register("idea-plugin-performance-tests") {
register("idea-fir-plugin-performance-tests") {
dependsOn("dist")
dependsOn(
":idea:performanceTests:performanceTest"
":idea:idea-fir-performance-tests:ideaFirPerformanceTest"
)
}
register("idea-fir-plugin-tests") {
dependsOn("dist")
dependsOn(
":idea:idea-fir:test",
":idea:idea-frontend-api:test",
":idea:idea-frontend-fir:test",
":idea:idea-frontend-fir:idea-fir-low-level-api:test"
)
}
register("android-ide-tests") {
dependsOn("dist")
dependsOn(
":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test"
":kotlin-annotation-processing:test",
":plugins:parcelize:parcelize-ide:test"
)
}
register("plugins-tests") {
dependsOn("dist")
register("ideaPluginTest") {
dependsOn(
"mainIdeTests",
"gradleIdeTest",
"kaptIdeTest",
"miscIdeTests"
)
}
register("mainIdeTests") {
dependsOn(":idea:test")
}
register("miscIdeTests") {
dependsOn(
":kotlin-annotation-processing:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
@@ -730,21 +842,41 @@ tasks {
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-compiler-plugin:test",
":kotlinx-serialization-ide-plugin:test",
":idea:jvm-debugger:jvm-debugger-test:test"
)
}
register("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
":idea:jvm-debugger:jvm-debugger-test:test",
"idea-plugin-additional-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
)
if (Ide.IJ()) {
dependsOn("idea-new-project-wizard-tests")
}
}
register("kaptIdeTest") {
dependsOn(":kotlin-annotation-processing:test")
}
register("gradleIdeTest") {
dependsOn(
":idea:idea-gradle:test",
":idea:idea-gradle-native:test"
)
}
register("kmmTest", AggregateTest::class) {
dependsOn(
":idea:idea-gradle:test",
":idea:test",
":compiler:test",
":js:js.tests:test"
)
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 {
@@ -763,6 +895,41 @@ tasks {
}
}
}
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-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",
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide: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",
":kotlin-coroutines-experimental-compat:publish"
)
}
}
}
fun CopySpec.setExecutablePermissions() {
@@ -772,15 +939,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}")
}
}
@@ -826,10 +993,37 @@ val zipPlugin by task<Zip> {
setExecutablePermissions()
doLast {
logger.lifecycle("Plugin artifacts packed to $archiveFile")
logger.lifecycle("Plugin artifacts packed to ${archiveFile.get()}")
}
}
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(
@@ -957,3 +1151,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,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
extra["versions.native-platform"] = "0.14"
buildscript {
@@ -5,8 +7,7 @@ buildscript {
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
extra["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
BootstrapOption.BintrayBootstrap("1.4.0-dev-1818", cacheRedirectorEnabled).applyToProject(project)
// kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
kotlinBootstrapFrom(BootstrapOption.SpaceBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
repositories {
if (cacheRedirectorEnabled) {
@@ -23,7 +24,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
}
@@ -73,7 +74,6 @@ 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"] = when {
extra["versions.intellijSdk"]?.toString()?.contains("-EAP-") == true -> "snapshots"
@@ -98,7 +98,9 @@ repositories {
dependencies {
implementation(kotlin("stdlib", embeddedKotlinVersion))
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
implementation("com.gradle.publish:plugin-publish-plugin:0.12.0")
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
@@ -107,9 +109,11 @@ dependencies {
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:7.0.1")
implementation("org.jetbrains.intellij.deps:asm-all:8.0.1")
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
implementation("org.gradle:test-retry-gradle-plugin:1.1.9")
}
samWithReceiver {
@@ -124,6 +128,11 @@ java {
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs +=
listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xskip-runtime-version-check")
}
tasks["build"].dependsOn(":prepare-deps:build")
allprojects {

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

@@ -1,22 +1,20 @@
@file:Suppress("PropertyName", "HasPlatformType", "UnstableApiUsage")
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.tasks.internal.CleanableStore
import java.io.Closeable
import java.io.FileWriter
import java.io.OutputStreamWriter
import java.net.URI
import java.text.SimpleDateFormat
import java.time.Duration
import java.time.Instant
import java.util.*
import javax.xml.stream.XMLOutputFactory
import org.jetbrains.kotlin.gradle.tasks.internal.CleanableStore
import org.jetbrains.kotlin.gradle.tasks.CleanDataTask
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
@@ -25,7 +23,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) {
@@ -34,7 +32,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")
@@ -145,21 +142,7 @@ dependencies {
}
}
val cleanupIntellijCore = tasks.register<CleanDataTask>("cleanupIntellijCore") {
cleanableStoreProvider = provider { CleanableStore[repoDir.resolve("intellij-core").absolutePath] }
}
val cleanupIntellijAnnotation = tasks.register<CleanDataTask>("cleanupIntellijAnnotation") {
cleanableStoreProvider = provider { CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath] }
}
val cleanupDependencies = tasks.register("cleanupDependencies") {
dependsOn(cleanupIntellijCore)
dependsOn(cleanupIntellijAnnotation)
}
val makeIntellijCore = buildIvyRepositoryTaskAndRegisterCleanupTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.registering(Copy::class) {
dependsOn(makeIntellijCore)
@@ -167,12 +150,17 @@ val makeIntellijAnnotations by tasks.registering(Copy::class) {
val intellijCoreRepo = CleanableStore[repoDir.resolve("intellij-core").absolutePath][intellijVersion].use()
from(intellijCoreRepo.resolve("artifacts/annotations.jar"))
val targetDir = CleanableStore[repoDir.resolve(intellijRuntimeAnnotations).absolutePath][intellijVersion].use()
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,
@@ -191,7 +179,10 @@ val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
from(provider { sources.map(::zipTree) })
isZip64 = true
if (!kotlinBuildProperties.isTeamcityBuild) {
from(provider { sources.map(::zipTree) })
}
destinationDirectory.set(File(repoDir, sources.name))
archiveBaseName.set("intellij")
archiveClassifier.set("sources")
@@ -201,7 +192,7 @@ val mergeSources by tasks.creating(Jar::class.java) {
val sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTaskAndRegisterCleanupTask(
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
@@ -212,9 +203,9 @@ val makeIde = if (androidStudioBuild != null) {
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTaskAndRegisterCleanupTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTaskAndRegisterCleanupTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
@@ -224,7 +215,7 @@ val makeIde = if (androidStudioBuild != null) {
task
}
val buildJpsStandalone = buildIvyRepositoryTaskAndRegisterCleanupTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
val buildJpsStandalone = buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile)
tasks.named("build") {
dependsOn(
@@ -238,24 +229,15 @@ tasks.named("build") {
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTaskAndRegisterCleanupTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
}
tasks.named("build") { dependsOn(cleanupDependencies) }
// Task to delete legacy repo locations
tasks.register<Delete>("cleanLegacy") {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
tasks.named<Delete>("clean") {
//TODO specify repos to clean? Use CleanDataTask
delete(customDepsRepoDir)
}
fun buildIvyRepositoryTaskAndRegisterCleanupTask(
fun buildIvyRepositoryTask(
configuration: Configuration,
organization: String,
repoDirectory: File,
@@ -268,29 +250,29 @@ fun buildIvyRepositoryTaskAndRegisterCleanupTask(
fun ResolvedArtifact.moduleDirectory(): File =
storeDirectory()[moduleVersion.id.version].use()
val buildIvyRepositoryTask = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
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()
}
outputs.upToDateWhen {
val repoMarker = configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory().resolve(".marker")
repoMarker.exists()
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
val artifact = configuration.resolvedConfiguration.resolvedArtifacts.single()
val moduleDirectory = artifact.moduleDirectory()
artifact.storeDirectory().cleanStore()
val repoMarker = File(moduleDirectory, ".marker")
if (repoMarker.exists()) {
logger.info("Path ${repoMarker.absolutePath} already exists, skipping unpacking.")
return@doFirst
}
with(artifact) {
val artifactsDirectory = File(moduleDirectory, "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
@@ -344,23 +326,15 @@ fun buildIvyRepositoryTaskAndRegisterCleanupTask(
)
}
}
repoMarker.createNewFile()
}
}
}
val cleanupIvyRepositoryTask = tasks.register<CleanDataTask>("cleanupIvyRepositoryFor${configuration.name.capitalize()}") {
cleanableStoreProvider = provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().storeDirectory()
}
}
cleanupDependencies {
dependsOn(cleanupIvyRepositoryTask)
}
return buildIvyRepositoryTask
}
fun CleanableStore.cleanStore() = cleanDir(Instant.now().minus(Duration.ofDays(30)))
fun writeIvyXml(
organization: String,
moduleName: String,

View File

@@ -20,15 +20,13 @@ buildscript {
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.21")
}
}
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")
@@ -48,12 +46,12 @@ if (target_AppCode_Clion) {
} else if (target_AndroidStudio) {
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")
include ":prepare-deps:cocoa-common-binaries"
include ":prepare-deps:appcode-binaries"
include ":prepare-deps:lldb-framework"
include ":prepare-deps:lldb-frontend"
project(":prepare-deps:cocoa-common-binaries").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/cocoa-common-binaries")
project(":prepare-deps:appcode-binaries").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/appcode-binaries")
project(":prepare-deps:lldb-framework").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-framework")
project(":prepare-deps:lldb-frontend").projectDir =
@@ -71,4 +69,4 @@ if (target_AppCode_Clion) {
} else {
logger.info("Not including extra modules 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

@@ -56,7 +56,7 @@ var Project.javaHome: String?
fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaExec {
classpath = (sourceSet ?: testSourceSet).runtimeClasspath
main = fqName
mainClass.set(fqName)
workingDir = rootDir
systemProperty("line.separator", "\n")
}

View File

@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P183, P191, P192, P193, P201;
P183, P191, P192, P193, P201, P202, P203;
val version: Int = name.drop(1).toInt()
@@ -47,10 +47,14 @@ enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ192(Platform.P192),
IJ193(Platform.P193),
IJ201(Platform.P201),
IJ202(Platform.P202),
IJ203(Platform.P203),
AS35(Platform.P183),
AS36(Platform.P192),
AS40(Platform.P193);
AS40(Platform.P193),
AS41(Platform.P201),
AS42(Platform.P202);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -23,6 +23,10 @@ fun JavaExec.passClasspathInJar() {
dependsOn(classpath)
inputs.files(classpath)
inputs.property("main", main)
archiveFileName.set("$main.${this@passClasspathInJar.name}.classpath.container.jar")
destinationDirectory.set(temporaryDir)
doFirst {
val classPathString = classpath.joinToString(" ") { project.file(it).toURI().toString() }
manifest {
@@ -34,16 +38,11 @@ fun JavaExec.passClasspathInJar() {
)
}
}
archiveName = "$main.${this@passClasspathInJar.name}.classpath.container.$extension"
destinationDir = temporaryDir
}
dependsOn(jarTask)
doFirst {
main = "-jar"
classpath = project.files()
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
}
main = "-jar"
classpath = project.files()
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
}

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,20 +71,14 @@ fun Project.noDefaultJar() {
}
}
fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) {
addArtifact("archives", task, artifactRef, body)
addArtifact("runtimeJar", task, artifactRef, body)
configurations.findByName("runtime")?.let {
addArtifact(it, task, artifactRef, body)
}
}
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", 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)
@@ -78,19 +87,51 @@ 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.addArtifact("archives", task, task)
project.addArtifact("runtimeJar", task, task)
project.configurations.findByName("runtime")?.let {
project.addArtifact(it.name, 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.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 +140,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 +148,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 +174,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 +215,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 +247,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 +346,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 +375,6 @@ fun Project.cleanArtifacts() {
}
}
}
fun Project.configurePublishedComponent(configure: AdhocComponentWithVariants.() -> Unit) =
(components.findByName(KotlinBuildPublishingPlugin.ADHOC_COMPONENT_NAME) as AdhocComponentWithVariants?)?.apply(configure)

View File

@@ -1,3 +1,8 @@
/*
* 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("unused")
// usages in build scripts are not tracked properly
@@ -97,9 +102,11 @@ fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): An
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"), classifier)
}
fun Project.kotlinBuiltins(): Any =
fun Project.kotlinBuiltins(): Any = kotlinBuiltins(forJvm = false)
fun Project.kotlinBuiltins(forJvm: Boolean): Any =
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
else dependencies.project(":core:builtins")
else dependencies.project(":core:builtins", configuration = "runtimeElementsJvm".takeIf { forJvm })
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")

View File

@@ -5,10 +5,13 @@ import org.gradle.api.Project
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.tasks.TaskProvider
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.register
import java.io.File
val kotlinEmbeddableRootPackage = "org.jetbrains.kotlin"
const val kotlinEmbeddableRootPackage = "org.jetbrains.kotlin"
val packagesToRelocate =
listOf(
@@ -20,7 +23,6 @@ val packagesToRelocate =
"org.picocontainer",
"org.jline",
"org.fusesource",
"kotlinx.coroutines",
"net.jpountz",
"one.util.streamex",
"kotlinx.collections.immutable"
@@ -32,21 +34,23 @@ val packagesToRelocate =
// But due to the shadow plugin bug (https://github.com/johnrengelman/shadow/issues/262) it is not possible to use
// packagesToRelocate list to for the include list. Therefore the exclude list has to be created.
val packagesToExcludeFromDummy =
listOf("org/jetbrains/kotlin/**",
"org/intellij/lang/annotations/**",
"org/jetbrains/jps/**",
"META-INF/**",
"com/sun/jna/**",
"com/thoughtworks/xstream/**",
"javaslang/**",
"*.proto",
"messages/**",
"net/sf/cglib/**",
"one/util/streamex/**",
"org/iq80/snappy/**",
"org/jline/**",
"org/xmlpull/**",
"*.txt")
listOf(
"org/jetbrains/kotlin/**",
"org/intellij/lang/annotations/**",
"org/jetbrains/jps/**",
"META-INF/**",
"com/sun/jna/**",
"com/thoughtworks/xstream/**",
"javaslang/**",
"*.proto",
"messages/**",
"net/sf/cglib/**",
"one/util/streamex/**",
"org/iq80/snappy/**",
"org/jline/**",
"org/xmlpull/**",
"*.txt"
)
private fun ShadowJar.configureEmbeddableCompilerRelocation(withJavaxInject: Boolean = true) {
relocate("com.google.protobuf", "org.jetbrains.kotlin.protobuf")
@@ -68,8 +72,8 @@ private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Un
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
destinationDirectory.set(project.file(File(buildDir, "libs")))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(compilerJar)
body()
}
@@ -108,8 +112,8 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(
)
return tasks.register<ShadowJar>(taskName) {
destinationDir = File(buildDir, "libs")
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
destinationDirectory.set(project.file(File(buildDir, "libs")))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(compilerDummyJar)
configureEmbeddableCompilerRelocation(withJavaxInject = false)
body()
@@ -120,7 +124,7 @@ fun Project.rewriteDepsToShadedJar(
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}
): TaskProvider<out Jar> {
originalJarTask.configure {
classifier = "original"
archiveClassifier.set("original")
}
val compilerDummyJarFile by lazy { configurations.getAt("compilerDummyJar").singleFile }
@@ -133,7 +137,7 @@ fun Project.rewriteDepsToShadedJar(
// which leads to the content of that JAR being excluded as well:
exclude { it.file == compilerDummyJarFile }
classifier = ""
archiveClassifier.set("original")
body()
}
return shadowJarTask

View File

@@ -80,6 +80,8 @@ fun Project.androidDxJar() = "org.jetbrains.kotlin:android-dx:${rootProject.extr
fun Project.jpsBuildTest() = "com.jetbrains.intellij.idea:jps-build-test:${rootProject.extra["versions.intellijSdk"]}"
fun Project.kotlinxCollectionsImmutable() = "org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:${rootProject.extra["versions.kotlinx-collections-immutable"]}"
/**
* Runtime version of annotations that are already in Kotlin stdlib (historically Kotlin has older version of this one).
*
@@ -130,12 +132,10 @@ object IntellijRootUtils {
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
@Suppress("UNCHECKED_CAST")
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean = { true }): Unit =
includeJars(
*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(),
*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter(jarsFilterPredicate).toTypedArray(),
rootProject = project.rootProject
)
@@ -165,7 +165,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
mainClass.set("com.intellij.idea.Main")
workingDir = File(intellijRootDir(), "bin")
@@ -178,13 +178,14 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Didea.tooling.debug=true",
"-Dfus.internal.test.mode=true",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (Platform[201].orHigher()) {
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
jvmArgs("-Didea.platform.prefix=Idea")
}

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"
@OptIn(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

@@ -0,0 +1,164 @@
/*
* 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.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.Sign
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
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)
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()
}
}
}
val signingRequired = provider {
project.findProperty("signingRequired")?.toString()?.toBoolean()
?: project.property("isSonatypeRelease") as Boolean
}
configure<SigningExtension> {
setRequired(signingRequired)
sign(extensions.getByType<PublishingExtension>().publications[PUBLICATION_NAME])
useGpgCmd()
}
tasks.withType<Sign>().configureEach {
setOnlyIf { signingRequired.get() }
}
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"
@OptIn(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

@@ -1,3 +1,4 @@
@file:Suppress("DEPRECATION")
package plugins
import org.codehaus.groovy.runtime.InvokerHelper
@@ -16,10 +17,8 @@ import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import kotlin.properties.Delegates
/**
* Configures a Kotlin module for publication.
*
*/
open class PublishedKotlinModule : Plugin<Project> {
@@ -31,12 +30,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")
@@ -46,6 +51,7 @@ open class PublishedKotlinModule : Plugin<Project> {
configure<SigningExtension> {
isRequired = signingRequired
sign(configurations["archives"])
useGpgCmd()
}
tasks.named<Sign>("signArchives").configure {

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

@@ -31,6 +31,47 @@ import java.lang.Character.isUpperCase
import java.nio.file.Files
import java.nio.file.Path
fun Task.dependsOnKotlinPluginInstall() {
dependsOn(
":kotlin-allopen:install",
":kotlin-noarg:install",
":kotlin-sam-with-receiver:install",
":kotlin-android-extensions:install",
":kotlin-parcelize-compiler:install",
":kotlin-build-common:install",
":kotlin-compiler-embeddable:install",
":native:kotlin-native-utils:install",
":kotlin-util-klib:install",
":kotlin-util-io:install",
":kotlin-compiler-runner:install",
":kotlin-daemon-embeddable:install",
":kotlin-daemon-client:install",
":kotlin-gradle-plugin-api:install",
":kotlin-gradle-plugin:install",
":kotlin-gradle-plugin-model:install",
":kotlin-reflect:install",
":kotlin-annotation-processing-gradle:install",
":kotlin-test:kotlin-test-common:install",
":kotlin-test:kotlin-test-annotations-common:install",
":kotlin-test:kotlin-test-jvm:install",
":kotlin-test:kotlin-test-js:install",
":kotlin-test:kotlin-test-junit:install",
":kotlin-gradle-subplugin-example:install",
":kotlin-stdlib-common:install",
":kotlin-stdlib:install",
":kotlin-stdlib-jdk8:install",
":kotlin-stdlib-js:install",
":examples:annotation-processor-example:install",
":kotlin-script-runtime:install",
":kotlin-scripting-common:install",
":kotlin-scripting-jvm:install",
":kotlin-scripting-compiler-embeddable:install",
":kotlin-scripting-compiler-impl-embeddable:install",
":kotlin-test-js-runner:install",
":native:kotlin-klib-commonizer-embeddable:install"
)
}
fun Project.projectTest(
taskName: String = "test",
parallel: Boolean = false,
@@ -79,21 +120,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,10 +146,15 @@ 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 {
val teamcity = rootProject.findProperty("teamcity") as? Map<Any?, *>
val teamcity = rootProject.findProperty("teamcity") as? Map<*, *>
val systemTempRoot =
// TC by default doesn't switch `teamcity.build.tempDir` to 'java.io.tmpdir' so it could cause to wasted disk space
// Should be fixed soon on Teamcity side
@@ -135,7 +180,7 @@ fun Project.projectTest(
if (parallel) {
maxParallelForks =
project.findProperty("kotlin.test.maxParallelForks")?.toString()?.toInt()
?: Math.max(Runtime.getRuntime().availableProcessors() / if (kotlinBuildProperties.isTeamcityBuild) 2 else 4, 1)
?: (Runtime.getRuntime().availableProcessors() / if (kotlinBuildProperties.isTeamcityBuild) 2 else 4).coerceAtLeast(1)
}
body()
}

View File

@@ -6,42 +6,41 @@ plugins {
}
dependencies {
compile(project(":compiler:util"))
compile(project(":compiler:cli"))
compile(project(":compiler:frontend"))
compile(project(":compiler:backend"))
compile(kotlinStdlib())
compile(project(":kotlin-reflect"))
compile(projectTests(":compiler:tests-common"))
compile(commonDep("junit:junit"))
Platform[193].orLower {
compileOnly(intellijDep()) { includeJars("openapi") }
}
testCompile(project(":compiler:incremental-compilation-impl"))
testCompile(project(":core:descriptors"))
testCompile(project(":core:descriptors.jvm"))
testCompile(project(":compiler:util"))
testCompile(project(":compiler:cli"))
testCompile(project(":compiler:frontend"))
testCompile(project(":compiler:backend"))
testCompile(project(":compiler:incremental-compilation-impl"))
testCompile(project(":compiler:frontend.java"))
testCompile(kotlinStdlib())
testCompile(project(":kotlin-reflect"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
Platform[193].orLower {
testCompile(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", "groovy-all", rootProject = rootProject) }
Platform[191].orLower {
testCompile(intellijDep()) { includeJars("jps-builders") }
testCompile(intellijDep()) { includeJars("util", "idea", "idea_rt", rootProject = rootProject) }
Platform[202].orHigher {
testCompile(intellijDep()) { includeJars("groovy", rootProject = rootProject) }
}
Platform[192].orHigher {
testCompile(intellijPluginDep("java")) { includeJars("jps-builders") }
Platform[201].orLower {
testCompile(intellijDep()) { includeJars("groovy-all", rootProject = rootProject) }
}
testCompile(intellijPluginDep("java")) { includeJars("jps-builders") }
testCompile(jpsStandalone()) { includeJars("jps-model") }
testCompile(jpsBuildTest())
}
sourceSets {
"main" { projectDefault() }
"main" { }
"test" { projectDefault() }
}

View File

@@ -25,7 +25,7 @@ import org.junit.runners.AllTests;
import java.io.File;
@RunWith(AllTests.class)
//@RunWith(AllTests.class)
public class AndroidRunner {
private static PathManager pathManager;

View File

@@ -27,6 +27,7 @@ import org.junit.Assert
import java.io.File
import java.io.FileWriter
import java.io.IOException
import kotlin.io.path.*
import kotlin.test.assertTrue
data class ConfigurationKey(val kind: ConfigurationKind, val jdkKind: TestJdkKind, val configuration: String)
@@ -100,9 +101,11 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
File("./gradlew.bat").copyTo(File(projectRoot, "gradlew.bat"));
val file = File(target, "gradle-wrapper.properties")
file.readLines().map {
if (it.startsWith("distributionUrl"))
"distributionUrl=https\\://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip"
else it
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 ->
@@ -292,7 +295,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
val kind = KotlinBaseTest.extractConfigurationKind(testFiles)
val jdkKind = KotlinBaseTest.getTestJdkKind(testFiles)
val keyConfiguration = CompilerConfiguration()
CodegenTestCase.updateConfigurationByDirectivesInTestFiles(testFiles, keyConfiguration)
KotlinBaseTest.updateConfigurationByDirectivesInTestFiles(testFiles, keyConfiguration)
val key = ConfigurationKey(kind, jdkKind, keyConfiguration.toString())
val compiler = if (isJvm8Target) {
@@ -301,7 +304,7 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
val filesHolder = holders.getOrPut(key) {
FilesWriter(compiler, KotlinTestUtils.newConfiguration(kind, jdkKind, KotlinTestUtils.getAnnotationsJar()).apply {
println("Creating new configuration by $key")
CodegenTestCase.updateConfigurationByDirectivesInTestFiles(testFiles, this)
KotlinBaseTest.updateConfigurationByDirectivesInTestFiles(testFiles, this)
})
}
@@ -315,7 +318,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
CodegenTestCase.createTestFilesFromFile(file, expectedText, "kotlin.coroutines", false, TargetBackend.JVM)
companion object {
const val GRADLE_VERSION = "5.6.4"
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"
@@ -342,14 +346,15 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
FileWriter(file).use { fw -> fw.write("sdk.dir=$sdkRoot") }
}
@OptIn(ExperimentalPathApi::class)
@JvmStatic
fun main(args: Array<String>) {
val tmpFolder = createTempDir()
println("Created temporary folder for android tests: " + tmpFolder.absolutePath)
val rootFolder = File("")
val pathManager = PathManager(rootFolder.absolutePath, tmpFolder.absolutePath)
val tmpFolder = createTempDirectory().absolutePathString()
println("Created temporary folder for android tests: $tmpFolder")
val rootFolder = Path("").absolutePathString()
val pathManager = PathManager(rootFolder, tmpFolder)
generate(pathManager, true)
println("Android test project is generated into " + tmpFolder.absolutePath + " folder")
println("Android test project is generated into $tmpFolder folder")
}
}
}

View File

@@ -0,0 +1,8 @@
/*
* 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.backend.common
class BackendException(message: String, cause: Throwable?) : IllegalStateException(message, cause)

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
@@ -71,7 +65,7 @@ object CodegenUtil {
if (copy)
copyFunctions(
declaration, traitMember, declaration.containingDeclaration, traitMember.modality,
Visibilities.PUBLIC, CallableMemberDescriptor.Kind.DECLARATION, true
DescriptorVisibilities.PUBLIC, CallableMemberDescriptor.Kind.DECLARATION, true
)
else mapMembers(declaration, traitMember)
)
@@ -80,33 +74,31 @@ object CodegenUtil {
}
fun copyFunctions(
inheritedMember: CallableMemberDescriptor,
traitMember: CallableMemberDescriptor,
newOwner: DeclarationDescriptor,
modality: Modality,
visibility: Visibility,
kind: CallableMemberDescriptor.Kind,
copyOverrides: Boolean
inheritedMember: CallableMemberDescriptor,
traitMember: CallableMemberDescriptor,
newOwner: DeclarationDescriptor,
modality: Modality,
visibility: DescriptorVisibility,
kind: CallableMemberDescriptor.Kind,
copyOverrides: Boolean
): Map<FunctionDescriptor, FunctionDescriptor> =
mapMembers(inheritedMember.copy(newOwner, modality, visibility, kind, copyOverrides), traitMember)
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
@@ -240,12 +232,13 @@ object CodegenUtil {
}
@JvmStatic
fun reportBackendException(exception: Throwable, phase: String, fileUrl: String?): Nothing {
fun reportBackendException(exception: Throwable, phase: String, location: String?, additionalMessage: String? = null): Nothing {
// CompilationException (the only KotlinExceptionWithAttachments possible here) is already supposed
// to have all information about the context.
if (exception is KotlinExceptionWithAttachments) throw exception
throw IllegalStateException(
getExceptionMessage("Backend", "Exception during $phase", exception, fileUrl),
throw BackendException(
getExceptionMessage("Backend", "Exception during $phase", exception, location) +
additionalMessage?.let { "\n" + it }.orEmpty(),
exception
)
}

View File

@@ -24,6 +24,8 @@ 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,
@@ -81,60 +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(),
true
))
}
}
}

View File

@@ -0,0 +1,15 @@
plugins {
kotlin("jvm")
id("jps-compatible")
}
dependencies {
api(project(":core:compiler.common.jvm"))
api(project(":compiler:config.jvm"))
api(intellijCoreDep()) { includeJars("asm-all", "guava", rootProject = rootProject) }
}
sourceSets {
"main" { projectDefault() }
"test" {}
}

View File

@@ -0,0 +1,450 @@
/*
* 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.codegen;
import com.google.common.collect.ImmutableMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.PrimitiveType;
import org.jetbrains.kotlin.descriptors.Visibilities;
import org.jetbrains.kotlin.descriptors.Visibility;
import org.jetbrains.kotlin.descriptors.java.JavaVisibilities;
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.jvm.JvmClassName;
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType;
import org.jetbrains.org.objectweb.asm.AnnotationVisitor;
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.commons.Method;
import java.util.Map;
import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*;
import static org.jetbrains.org.objectweb.asm.Opcodes.*;
public class AsmUtil {
private static final int NO_FLAG_LOCAL = 0;
public static final int NO_FLAG_PACKAGE_PRIVATE = 0;
@NotNull
private static final Map<Visibility, Integer> visibilityToAccessFlag = ImmutableMap.<Visibility, Integer>builder()
.put(Visibilities.Private.INSTANCE, ACC_PRIVATE)
.put(Visibilities.PrivateToThis.INSTANCE, ACC_PRIVATE)
.put(Visibilities.Protected.INSTANCE, ACC_PROTECTED)
.put(JavaVisibilities.ProtectedStaticVisibility.INSTANCE, ACC_PROTECTED)
.put(JavaVisibilities.ProtectedAndPackage.INSTANCE, ACC_PROTECTED)
.put(Visibilities.Public.INSTANCE, ACC_PUBLIC)
.put(Visibilities.Internal.INSTANCE, ACC_PUBLIC)
.put(Visibilities.Local.INSTANCE, NO_FLAG_LOCAL)
.put(JavaVisibilities.PackageVisibility.INSTANCE, NO_FLAG_PACKAGE_PRIVATE)
.build();
public static final String CAPTURED_PREFIX = "$";
public static final String THIS = "this";
public static final String THIS_IN_DEFAULT_IMPLS = "$this";
public static final String LABELED_THIS_FIELD = THIS + "_";
public static final String CAPTURED_LABELED_THIS_FIELD = CAPTURED_PREFIX + LABELED_THIS_FIELD;
public static final String INLINE_DECLARATION_SITE_THIS = "this_";
public static final String LABELED_THIS_PARAMETER = CAPTURED_PREFIX + THIS + "$";
public static final String CAPTURED_THIS_FIELD = "this$0";
public static final String RECEIVER_PARAMETER_NAME = "$receiver";
/*
This is basically an old convention. Starting from Kotlin 1.3, it was replaced with `$this_<label>`.
Note that it is still used for inlined callable references and anonymous callable extension receivers
even in 1.3.
*/
public static final String CAPTURED_RECEIVER_FIELD = "receiver$0";
// For non-inlined callable references ('kotlin.jvm.internal.CallableReference' has a 'receiver' field)
public static final String BOUND_REFERENCE_RECEIVER = "receiver";
public static final String LOCAL_FUNCTION_VARIABLE_PREFIX = "$fun$";
private static final ImmutableMap<Integer, JvmPrimitiveType> primitiveTypeByAsmSort;
private static final ImmutableMap<Type, Type> primitiveTypeByBoxedType;
static {
ImmutableMap.Builder<Integer, JvmPrimitiveType> typeBySortBuilder = ImmutableMap.builder();
ImmutableMap.Builder<Type, Type> typeByWrapperBuilder = ImmutableMap.builder();
for (JvmPrimitiveType primitiveType : JvmPrimitiveType.values()) {
Type asmType = Type.getType(primitiveType.getDesc());
typeBySortBuilder.put(asmType.getSort(), primitiveType);
typeByWrapperBuilder.put(asmTypeByFqNameWithoutInnerClasses(primitiveType.getWrapperFqName()), asmType);
}
primitiveTypeByAsmSort = typeBySortBuilder.build();
primitiveTypeByBoxedType = typeByWrapperBuilder.build();
}
private AsmUtil() {
}
@NotNull
public static String getCapturedFieldName(@NotNull String originalName) {
return CAPTURED_PREFIX + originalName;
}
@NotNull
public static String getLabeledThisName(@NotNull String callableName, @NotNull String prefix, @NotNull String defaultName) {
if (!Name.isValidIdentifier(callableName)) {
return defaultName;
}
return prefix + CommonVariableAsmNameManglingUtils.mangleNameIfNeeded(callableName);
}
@NotNull
public static Type boxType(@NotNull Type type) {
Type boxedType = boxPrimitiveType(type);
return boxedType != null ? boxedType : type;
}
@Nullable
public static Type boxPrimitiveType(@NotNull Type type) {
JvmPrimitiveType jvmPrimitiveType = primitiveTypeByAsmSort.get(type.getSort());
return jvmPrimitiveType != null ? asmTypeByFqNameWithoutInnerClasses(jvmPrimitiveType.getWrapperFqName()) : null;
}
@NotNull
public static Type unboxType(@NotNull Type boxedType) {
Type primitiveType = unboxPrimitiveTypeOrNull(boxedType);
if (primitiveType == null) {
throw new UnsupportedOperationException("Unboxing: " + boxedType);
}
return primitiveType;
}
@Nullable
public static Type unboxPrimitiveTypeOrNull(@NotNull Type boxedType) {
return primitiveTypeByBoxedType.get(boxedType);
}
public static boolean isBoxedPrimitiveType(@NotNull Type boxedType) {
return primitiveTypeByBoxedType.get(boxedType) != null;
}
@NotNull
public static Type unboxUnlessPrimitive(@NotNull Type boxedOrPrimitiveType) {
if (isPrimitive(boxedOrPrimitiveType)) return boxedOrPrimitiveType;
return unboxType(boxedOrPrimitiveType);
}
public static boolean isBoxedTypeOf(@NotNull Type boxedType, @NotNull Type unboxedType) {
return unboxPrimitiveTypeOrNull(boxedType) == unboxedType;
}
public static boolean isIntPrimitive(Type type) {
return type == Type.INT_TYPE || type == Type.SHORT_TYPE || type == Type.BYTE_TYPE || type == Type.CHAR_TYPE;
}
public static boolean isIntOrLongPrimitive(Type type) {
return isIntPrimitive(type) || type == Type.LONG_TYPE;
}
public static boolean isPrimitive(Type type) {
return type.getSort() != Type.OBJECT && type.getSort() != Type.ARRAY;
}
@NotNull
public static Type correctElementType(@NotNull Type type) {
String internalName = type.getInternalName();
assert internalName.charAt(0) == '[';
return Type.getType(internalName.substring(1));
}
@NotNull
public static Type getArrayType(@NotNull Type componentType) {
return Type.getType("[" + componentType.getDescriptor());
}
@Nullable
public static PrimitiveType asmPrimitiveTypeToLangPrimitiveType(Type type) {
JvmPrimitiveType jvmPrimitiveType = primitiveTypeByAsmSort.get(type.getSort());
return jvmPrimitiveType != null ? jvmPrimitiveType.getPrimitiveType() : null;
}
@NotNull
public static Method method(@NotNull String name, @NotNull Type returnType, @NotNull Type... parameterTypes) {
return new Method(name, Type.getMethodDescriptor(returnType, parameterTypes));
}
public static Type stringValueOfType(Type type) {
int sort = type.getSort();
return sort == Type.OBJECT || sort == Type.ARRAY
? OBJECT_TYPE
: sort == Type.BYTE || sort == Type.SHORT ? Type.INT_TYPE : type;
}
public static void genThrow(@NotNull InstructionAdapter v, @NotNull String exception, @Nullable String message) {
v.anew(Type.getObjectType(exception));
v.dup();
if (message != null) {
v.aconst(message);
v.invokespecial(exception, "<init>", "(Ljava/lang/String;)V", false);
}
else {
v.invokespecial(exception, "<init>", "()V", false);
}
v.athrow();
}
public static void genStringBuilderConstructor(InstructionAdapter v) {
v.visitTypeInsn(NEW, "java/lang/StringBuilder");
v.dup();
v.invokespecial("java/lang/StringBuilder", "<init>", "()V", false);
}
public static void genInvertBoolean(InstructionAdapter v) {
v.iconst(1);
v.xor(Type.INT_TYPE);
}
public static void numConst(int value, Type type, InstructionAdapter v) {
if (type == Type.FLOAT_TYPE) {
v.fconst(value);
}
else if (type == Type.DOUBLE_TYPE) {
v.dconst(value);
}
else if (type == Type.LONG_TYPE) {
v.lconst(value);
}
else if (type == Type.CHAR_TYPE || type == Type.BYTE_TYPE || type == Type.SHORT_TYPE || type == Type.INT_TYPE) {
v.iconst(value);
}
else {
throw new IllegalArgumentException("Primitive numeric type expected, got: " + type);
}
}
public static void swap(InstructionAdapter v, Type stackTop, Type afterTop) {
if (stackTop.getSize() == 1) {
if (afterTop.getSize() == 1) {
v.swap();
}
else {
v.dupX2();
v.pop();
}
}
else {
if (afterTop.getSize() == 1) {
v.dup2X1();
}
else {
v.dup2X2();
}
v.pop2();
}
}
public static void pushDefaultValueOnStack(@NotNull Type type, @NotNull InstructionAdapter v) {
v.visitInsn(defaultValueOpcode(type));
}
public static int defaultValueOpcode(@NotNull Type type) {
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
return ACONST_NULL;
}
if (type.getSort() == Type.FLOAT) {
return FCONST_0;
}
if (type.getSort() == Type.DOUBLE) {
return DCONST_0;
}
if (type.getSort() == Type.LONG) {
return LCONST_0;
}
return ICONST_0;
}
public static Type comparisonOperandType(Type left, Type right) {
if (left == Type.DOUBLE_TYPE || right == Type.DOUBLE_TYPE) return Type.DOUBLE_TYPE;
if (left == Type.FLOAT_TYPE || right == Type.FLOAT_TYPE) return Type.FLOAT_TYPE;
if (left == Type.LONG_TYPE || right == Type.LONG_TYPE) return Type.LONG_TYPE;
if (left == Type.CHAR_TYPE || right == Type.CHAR_TYPE) return Type.CHAR_TYPE;
return Type.INT_TYPE;
}
@NotNull
public static Type numberFunctionOperandType(@NotNull Type expectedType) {
if (expectedType == Type.SHORT_TYPE || expectedType == Type.BYTE_TYPE || expectedType == Type.CHAR_TYPE) {
return Type.INT_TYPE;
}
return expectedType;
}
public static void pop(@NotNull MethodVisitor v, @NotNull Type type) {
if (type.getSize() == 2) {
v.visitInsn(Opcodes.POP2);
}
else {
v.visitInsn(Opcodes.POP);
}
}
public static void pop2(@NotNull MethodVisitor v, @NotNull Type topOfStack, @NotNull Type afterTop) {
if (topOfStack.getSize() == 1 && afterTop.getSize() == 1) {
v.visitInsn(POP2);
} else {
pop(v, topOfStack);
pop(v, afterTop);
}
}
public static void pop2(@NotNull MethodVisitor v, @NotNull Type type) {
if (type.getSize() == 2) {
v.visitInsn(Opcodes.POP2);
v.visitInsn(Opcodes.POP2);
}
else {
v.visitInsn(Opcodes.POP2);
}
}
public static void dup(@NotNull InstructionAdapter v, @NotNull Type type) {
dup(v, type.getSize());
}
private static void dup(@NotNull InstructionAdapter v, int size) {
if (size == 2) {
v.dup2();
}
else if (size == 1) {
v.dup();
}
else {
throw new UnsupportedOperationException();
}
}
public static void dupx(@NotNull InstructionAdapter v, @NotNull Type type) {
dupx(v, type.getSize());
}
private static void dupx(@NotNull InstructionAdapter v, int size) {
if (size == 2) {
v.dup2X2();
}
else if (size == 1) {
v.dupX1();
}
else {
throw new UnsupportedOperationException();
}
}
// Duplicate the element afterTop and push it on the top of the stack.
public static void dupSecond(@NotNull InstructionAdapter v, @NotNull Type topOfStack, @NotNull Type afterTop) {
if (afterTop.getSize() == 0) {
return;
}
if (topOfStack.getSize() == 0) {
dup(v, afterTop);
} else if (topOfStack.getSize() == 1 && afterTop.getSize() == 1) {
v.dup2();
v.pop();
} else {
swap(v, topOfStack, afterTop);
if (topOfStack.getSize() == 1 && afterTop.getSize() == 2) {
v.dup2X1();
} else if (topOfStack.getSize() == 2 && afterTop.getSize() == 1) {
v.dupX2();
} else /* top = 2, after top = 2 */ {
v.dup2X2();
}
}
}
public static void dup(@NotNull InstructionAdapter v, @NotNull Type topOfStack, @NotNull Type afterTop) {
if (topOfStack.getSize() == 0 && afterTop.getSize() == 0) {
return;
}
if (topOfStack.getSize() == 0) {
dup(v, afterTop);
}
else if (afterTop.getSize() == 0) {
dup(v, topOfStack);
}
else if (afterTop.getSize() == 1) {
if (topOfStack.getSize() == 1) {
dup(v, 2);
}
else {
v.dup2X1();
v.pop2();
v.dupX2();
v.dupX2();
v.pop();
v.dup2X1();
}
}
else {
//Note: it's possible to write dup3 and dup4
throw new UnsupportedOperationException("Don't know how generate dup3/dup4 for: " + topOfStack + " and " + afterTop);
}
}
public static void writeAnnotationData(
@NotNull AnnotationVisitor av, @NotNull String[] data, @NotNull String[] strings
) {
AnnotationVisitor dataVisitor = av.visitArray(JvmAnnotationNames.METADATA_DATA_FIELD_NAME);
for (String string : data) {
dataVisitor.visit(null, string);
}
dataVisitor.visitEnd();
AnnotationVisitor stringsVisitor = av.visitArray(JvmAnnotationNames.METADATA_STRINGS_FIELD_NAME);
for (String string : strings) {
stringsVisitor.visit(null, string);
}
stringsVisitor.visitEnd();
}
@NotNull
public static Type asmTypeByFqNameWithoutInnerClasses(@NotNull FqName fqName) {
return Type.getObjectType(internalNameByFqNameWithoutInnerClasses(fqName));
}
@NotNull
public static Type asmTypeByClassId(@NotNull ClassId classId) {
return Type.getObjectType(classId.asString().replace('.', '$'));
}
@NotNull
public static String internalNameByFqNameWithoutInnerClasses(@NotNull FqName fqName) {
return JvmClassName.byFqNameWithoutInnerClasses(fqName).getInternalName();
}
public static void wrapJavaClassIntoKClass(@NotNull InstructionAdapter v) {
v.invokestatic(REFLECTION, "getOrCreateKotlinClass", Type.getMethodDescriptor(K_CLASS_TYPE, getType(Class.class)), false);
}
public static void wrapJavaClassesIntoKClasses(@NotNull InstructionAdapter v) {
v.invokestatic(REFLECTION, "getOrCreateKotlinClasses", Type.getMethodDescriptor(K_CLASS_ARRAY_TYPE, getType(Class[].class)), false);
}
@Nullable
public static Integer getVisibilityAccessFlag(Visibility visibility) {
return visibilityToAccessFlag.get(visibility);
}
}

View File

@@ -0,0 +1,31 @@
/*
* 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:JvmName("CommonVariableAsmNameManglingUtils")
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.resolve.jvm.checkers.isValidDalvikCharacter
fun mangleNameIfNeeded(name: String): String {
if (name.all { it.isValidCharacter() }) {
return name
}
return buildString {
for (c in name) {
if (c.isValidCharacter()) {
append(c)
} else {
val hexString = Integer.toHexString(c.toInt())
assert(hexString.length <= 4)
append("_u").append(hexString)
}
}
}
}
private fun Char.isValidCharacter(): Boolean {
return this != '$' && this != '-' && isValidDalvikCharacter(this)
}

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen.signature
import org.jetbrains.kotlin.builtins.PrimitiveType
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.load.kotlin.JvmTypeFactory
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.org.objectweb.asm.Type
object AsmTypeFactory : JvmTypeFactory<Type> {
override fun boxType(possiblyPrimitiveType: Type): Type =
AsmUtil.boxType(possiblyPrimitiveType)
override fun createFromString(representation: String): Type =
Type.getType(representation)
override fun createPrimitiveType(primitiveType: PrimitiveType): Type =
AsmTypes.valueTypeForPrimitive(primitiveType)
override fun createObjectType(internalName: String): Type =
Type.getObjectType(internalName)
override fun toString(type: Type): String =
type.descriptor
override val javaLangClassType: Type
get() = AsmTypes.JAVA_CLASS_TYPE
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* 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.
*/
@@ -10,7 +10,11 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.builtins.PrimitiveType;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
public class AsmTypes {
private static final Map<Class<?>, Type> TYPES_MAP = new HashMap<>();

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