Commit Graph

88356 Commits

Author SHA1 Message Date
Nikolay Krasko ee507ceaed Simplify mapping between CI and test tasks 2021-12-15 19:18:56 +03:00
Nikolay Krasko 00f0978b1d Minor: reformat + clean warnings in org.jetbrains.kotlin.generators.arguments.test 2021-12-15 19:18:55 +03:00
Nikolay Krasko e733aa21d5 Fix error instead of muting it in kapt tests 2021-12-15 19:18:55 +03:00
Nikolay Krasko 5162ef31fc Rename task kaptIdeTest -> kaptTests 2021-12-15 19:18:54 +03:00
Nikolay Krasko 85a3c9e251 Restore running :generators:test 2021-12-15 19:18:53 +03:00
Nikolay Krasko a74c68c70a Regenerate gradle options 2021-12-15 19:18:53 +03:00
Nikolay Krasko bfd540e9e6 Fix compile:android-test:generateAndroidTests
Don't read absent file with disabled plugins during creating Kotlin
core environment.

Exception in thread "main" 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.readBrokenPluginFile(PluginManagerCore.java:249)
	at com.intellij.ide.plugins.PluginManagerCore.getBrokenPluginVersions(PluginManagerCore.java:241)
	at com.intellij.ide.plugins.PluginManagerCore.createLoadingResult(PluginManagerCore.java:822)
	at com.intellij.ide.plugins.DescriptorListLoadingContext.createSingleDescriptorContext(DescriptorListLoadingContext.java:64)
	at com.intellij.ide.plugins.PluginManagerCore.registerExtensionPointAndExtensions(PluginManagerCore.java:1318)
	at com.intellij.core.CoreApplicationEnvironment.registerExtensionPointAndExtensions(CoreApplicationEnvironment.java:287)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerApplicationExtensionPointsAndExtensionsFrom(KotlinCoreEnvironment.kt:622)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createApplicationEnvironment(KotlinCoreEnvironment.kt:592)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForTests(KotlinCoreEnvironment.kt:505)
	at org.jetbrains.kotlin.android.tests.CodegenTestsOnAndroidGenerator$FilesWriter.writeFilesOnDisk(CodegenTestsOnAndroidGenerator.kt:214)
	at org.jetbrains.kotlin.android.tests.CodegenTestsOnAndroidGenerator$FilesWriter.writeFilesOnDiskIfNeeded(CodegenTestsOnAndroidGenerator.kt:208)
2021-12-15 19:18:52 +03:00
Nikolay Krasko 71d84669f1 Remove idea tasks 2021-12-15 19:18:51 +03:00
Nikolay Krasko f2d649a7a1 Add dependency on dist for fir-plugin-prototype
> FirPluginDiagnosticTestGenerated$MemberGen.testClassWithCompanionObject
> java.lang.IllegalStateException: dist/kotlin-stdlib-jvm-minimal-for-test.jar does not exist. Run 'gradlew dist'
2021-12-15 19:18:50 +03:00
Leonid Startsev 2eac2ff3a2 Support Array<KClass> in instantiated annotations
#KT-47703 Fixed
2021-12-15 16:05:29 +00:00
Leonid Startsev 4df34a20e7 Fix classSerializerAsObject test that got broken after conflict-merge
with b131c52889
2021-12-15 17:18:18 +03:00
Tianyu Geng 4d2074fb66 Analysis API: allow creating type from type alias
There does not seem to be any reason to limit the type creator to only
create types of concrete class or object but not type alias.
2021-12-15 16:09:33 +03:00
Tianyu Geng 5fbe5981f7 Analysis API: add KtType.isDenotable() 2021-12-15 16:09:31 +03:00
Tianyu Geng 2f393cdd02 FE1.0 Analysis API: get smartcast if available with getKtExpressionType
The current implementation still does not work with multicast. In
addition, it appears FE1.0 does not attempt smart cast if it's not used.
2021-12-15 16:09:29 +03:00
Tianyu Geng a5844b754e Type Approximation: add separate flag to control approx. anonymous type
This extra flexibility is useful for IDE where we always want to
approximate anonymous types but may not want to approximate other local
 types
2021-12-15 16:09:27 +03:00
Yahor Berdnikau c5c606924c Move Kotlin daemon jvm args to kotlin.daemon.jvmargs property 2021-12-15 10:37:52 +00:00
Ilya Goncharov db9640c3b3 [Gradle, JS] Add gradle property for per-module/whole-program
Merge-request: KT-MR-5200
2021-12-15 09:08:45 +00:00
Alexander Shabalin 7eb0798d64 [K/N] Fix SafePointSlowPath in STMS
^KT-48537

Merge-request: KT-MR-5257
2021-12-15 07:54:07 +00:00
Jinseong Jeon e36cc87b19 LC: introduce KotlinLightTypeParameterBuilder (w/ origin) 2021-12-15 10:41:50 +03:00
Jinseong Jeon 7757fd312b FIR LC: make fields in objects static 2021-12-15 08:20:03 +03:00
Jinseong Jeon 82c2f0c6fd FIR LC: use unified annotations' ClassId or FqName 2021-12-15 08:20:02 +03:00
Nikolay Krasko 4e60a2dbe1 Remove unused JUnitMode.Mix mode
It's not used by now, and there's are known problems with it check
KTI-712.

If transition to JUnit5 is needed, creating another module might
be a better option.
2021-12-14 23:07:20 +03:00
Nikolay Krasko 1efd583e14 Fix running nested classes with JUnit 5 causes outer class tests execution
Note: there might be a performance issue with running tests,
the reason why custom filtering was added to the tests running.
It's not tested and should be addressed separately

Try run IrBlackBoxCodegenTestGenerated.Annotations. Everything in the
outer class IrBlackBoxCodegenTestGenerated is run instead.
This is not an IDEA problem, since it reproduces from
the command line too.

^KTI-712 Fixed
2021-12-14 23:07:19 +03:00
Jinseong Jeon 20408dc176 LC: use callable name as suffix of receiver parameter name 2021-12-14 21:01:50 +03:00
Leonid Startsev 9b9522d714 Allow defining custom KSerializer for non-generic class as a class
Previously only objects were allowed. Due to a bug, this accidentally
worked in old backend.

#KT-46444 Fixed
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1587
2021-12-14 17:53:09 +00:00
Jinseong Jeon 9a669092e3 FIR LC: backward compatible visibility of enum entry ctor 2021-12-14 18:26:26 +03:00
Dmitry Petrov 9375f41936 JVM_IR KT-50073 inline callable reference adapter into 'invoke' 2021-12-14 14:35:12 +00:00
Dmitry Petrov 42dd8aa12d JVM_IR KT-50193 remove temporary variable in argument null check 2021-12-14 17:10:23 +03:00
Dmitry Petrov 34c70ea04e JVM_IR KT-50193 result of !! is non-null 2021-12-14 17:10:20 +03:00
Anastasia.Shadrina 343a860553 [FE] Make OverloadChecker take CR into account 2021-12-14 15:19:42 +03:00
konstantin.tskhovrebov 2bb155edc1 KT-50159 Check that all inner frameworks in XCFramework have same names
And warn if XCFramework has different name with inner frameworks.

#KT-50159 Fixed
2021-12-14 14:47:42 +03:00
Yahor Berdnikau 1c8a1e656e Add function to make a snapshot of current test project
This will allow checking current state of test project and try
to work with it directly.

^KT-45745 In Progress
2021-12-14 12:45:51 +01:00
Victor Petukhov 6fed67b36c Revert "Revert "Fix setCompileTimeInitializer usage in MemberDeserializer.kt""
This reverts commit 965bab2d2d.
2021-12-14 14:21:48 +03:00
Victor Petukhov 24900630cb Revert "Revert "[FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor""
This reverts commit faeb5d21ab.
2021-12-14 14:21:46 +03:00
Dmitriy Dolovov 60dcafcf43 [Test] TestGen: Use canonical class names for generated imports
This is needed to have correct class names for inner/nested classes. For example, to have `import java.util.AbstractMap.SimpleEntry` instead of `import java.util.AbstractMap$SimpleEntry`.
2021-12-14 13:48:23 +03:00
Ilya Chernikov c1c94778ce Detect and report inner classes capturing script instance 2021-12-14 13:39:22 +03:00
Ilya Chernikov e865652602 [minor] ScriptLowering cleanup 2021-12-14 13:39:22 +03:00
Ilya Chernikov 1450f4d890 Implement property for explicit jvmTarget for script definition...
Apply the property to the default JSR-223 script taking the value from
java.specification.version property, so effectively implementing
jvmTarget detection from current VM.
Also drop enforcing of target 1.8, using common default.
#KT-49329 fixed
#KT-40497 fixed
2021-12-14 13:39:21 +03:00
Ilya Chernikov f0316cde54 [minor] test infrastructure: fix default handling in proc launcher 2021-12-14 13:39:21 +03:00
Ilya Chernikov ec2d6ea5f1 Restore script testing on both backends, fix some tests 2021-12-14 13:39:19 +03:00
Ilya Chernikov 670575696f Remove forced old backend for script compilation, using common default 2021-12-14 13:39:19 +03:00
Ilya Chernikov 6d6de9dd76 Implement tests for script instance capturing in the host tests 2021-12-14 13:39:18 +03:00
Ilya Chernikov 10c5071eda Implement backend error reporting on unsupported script capturing
#KT-30616 fixed
#KT-43995 fixed
#KT-19424 fixed
#KT-49443 fixed
2021-12-14 13:39:17 +03:00
Ilya Chernikov cb5e451e05 Implement script instance capturing in script lowering
for regular classes only. Reimplementing the main behavior of the
old BE and implementing few cases on top of it.
#KT-19423 fixed
2021-12-14 13:39:17 +03:00
Ilya Chernikov 87952d63a3 Rollback script related LDL changes...
to reimplement them properly in the script lowering
2021-12-14 13:39:16 +03:00
Hung Nguyen 586fa8af64 KT-45777: Shrink classpath snapshot incrementally
Currently, we shrink classpath snapshots at 2 steps:
  - Classpath diffing: Shrink the current classpath snapshot against
    the previous lookup symbols
  - Classpath snapshot saving: Shrink the current classpath snapshot
    against the current lookup symbols

With this commit, the shrinking at the second step is now incremental.
The shrinking at the first step is still non-incremental.
2021-12-14 13:10:08 +03:00
Steven Schäfer 4f3debdec6 [KAPT] Correct error types in annotations (KT-32596) 2021-12-14 11:31:25 +03:00
Yahor Berdnikau 701446ad25 Pin 'debug.keystore' in two additional android plugins
Also pin it for 'com.android.feature' and 'com.android.test' plugins.

^KT-45745 In Progress
2021-12-13 22:36:27 +03:00
Roman Artemev 312cbb6613 [JS IR IC] Add tests to check cache invalidation via fast path 2021-12-13 20:57:53 +03:00
Roman Artemev b719865c25 [JS IR IC] Implement fast path invalidation check
Compute library md5 hash and check it first with cached one. If hashes
are equal it means that cache is up-to-date and no additional checks are
needed

 - store library hashes (flat + trans) into cache info file
 - change invalidator return value
2021-12-13 20:57:52 +03:00