Commit Graph

88343 Commits

Author SHA1 Message Date
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
Roman Artemev 5ba6ca4c16 [TEST] Support module step directives in TestModel parser 2021-12-13 20:57:51 +03:00
Dmitry Petrov e47871f98b JVM_IR KT-50215 KT-50076 extra test 2021-12-13 20:34:57 +03:00
Ilya Goncharov 6adcbe081e [JS IR] Consider erasing type parameters in return type in js signatures 2021-12-13 16:16:59 +00:00
Ilya Goncharov 4f1a10d72e [JS] Uncomment test on afterTest 2021-12-13 15:29:27 +00:00
Dmitriy Dolovov e0daa96cae [Build] Avoid resetting of DefaultTestFilter.commandLineIncludePatterns 2021-12-13 18:14:43 +03:00
Ivan Kylchik b131c52889 Drop all usages of WITH_RUNTIME directive 2021-12-13 18:07:11 +03:00
Evgeniy.Zhelenskiy 1874318954 [Tests] Windows regeneration does not change tests 2021-12-13 17:54:15 +03:00
Dmitry Petrov df460a842b JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter 2021-12-13 14:13:34 +00:00
Dmitry Petrov 6f148c594f Revert "JVM_IR KT-50076 avoid CHECKCAST on moved dispatch receiver parameter"
This reverts commit 627d838343.
2021-12-13 14:13:33 +00:00
Mikhail Glukhikh df50a8141f FirCallCompleter: unwrap definitely not-null type properly
#KT-50180 Fixed
2021-12-13 16:24:59 +03:00
Mikhail Glukhikh febf336d23 IrConstTransformer: transform constants also inside call children 2021-12-13 16:24:59 +03:00
Mikhail Glukhikh 66231baa06 FIR2IR: pass annotationMode through arrayOf calls properly
#KT-50163 Fixed
2021-12-13 16:24:59 +03:00
Mikhail Glukhikh 09585d116e FirTypeIntersectionScope: fast success in isMoreSpecific 2021-12-13 16:24:58 +03:00