Commit Graph

72848 Commits

Author SHA1 Message Date
Jinseong Jeon 52ea7fdb72 FIR: ensure type ref after supertype resolve transformer is resolved 2021-02-19 10:17:15 +03:00
Vladimir Dolzhenko 8783ebc352 Report highlight errors to WolfTheProblemSolver
Relates to #KT-37702
#KTIJ-1246 Fixed

Original commit: bd222a5255c2fd6f4abfce3115f81733ef9a39f3
2021-02-19 05:46:04 +00:00
tgeng afe71f5d59 FIR: Add runConfig to generate FIR boilerplate (#4130)
* FIR: Add runConfig to generate FIR boilerplate

* FIR: Add runConfig to generate FIR boilerplate
2021-02-18 23:26:10 +01:00
Tianyu Geng 51da54ce66 FIR IDE: Simplify registerPsiQuickFixes
This change makes it possible to register multiple fixes for a
diagnostic. Also, the previous registerPsiQuickFix that relies compiler
to infer the KtFirDiagnostic type parameter is dangerous since it
can silently register fixes on interface `KtDiagnosticWithPsi` if caller
doesn't specify it explicitly.
2021-02-18 19:37:37 +01:00
Ilmir Usmanov cacd84390e Use erased upper bound instead of checking for inline type 2021-02-18 18:31:50 +01:00
Ilmir Usmanov 741c1a864f JVM_IR: IC: Unbox inline class argument of callable reference
if it is unbound and the underlying type is reference type.
If the underlying type is primitive, it is boxed and unboxed
correctly, otherwise, it is simply casted and not unboxed.
Additionally, generate functions for inliner with inline classes
in signature, so unboxing works.
The unboxing is removed after inlining.
 #KT-44722 Fixed
2021-02-18 18:31:48 +01:00
Dmitry Petrov 744a0fcd25 PSI2IR KT-45022 object in LHS of compound assignment 2021-02-18 20:24:16 +03:00
Dmitriy Dolovov 05447ce0c8 [Commonizer] Print true time for resolving of libraries to be commonized 2021-02-18 18:47:38 +03:00
Dmitriy Dolovov 0b26a281de [Commonizer] Print pretty target name in console output 2021-02-18 18:47:33 +03:00
Dmitriy Dolovov fb51105a5d [Commonizer] Log time in commonizer result consumers 2021-02-18 18:47:28 +03:00
Dmitriy Dolovov 496aad3c4a [Commonizer] Log commonization only for really present targets 2021-02-18 18:47:19 +03:00
Dmitriy Dolovov 3ad7b60747 [Commonizer] Prefer using CommonizerTarget instead of KonanTarget 2021-02-18 18:47:14 +03:00
Dmitriy Dolovov 1895c230ef [Commonizer] K/N dist: Process targets in alphabetical order 2021-02-18 18:47:10 +03:00
Dmitriy Dolovov f473b88e47 [Commonizer] Nicer API for CirProvidedClassifiers 2021-02-18 18:47:05 +03:00
Dmitriy Dolovov 84ce9c612c [Commonizer] Keep only "common" dependencies in CirKnownClassifiers 2021-02-18 18:47:00 +03:00
Dmitriy Dolovov 2581b67cda [Commonizer] Rename: CirCommonizedClassifiers -> CirCommonizedClassifierNodes 2021-02-18 18:46:55 +03:00
Dmitriy Dolovov 43ad0ed907 [Commonizer] Optimized implementation of CirProvidedClassifiers
Read classifiers directly from metadata, don't use descriptors.
2021-02-18 18:46:49 +03:00
Dmitriy Dolovov 79e3ce022f [Commonizer] Fix: Keep fwd declarations under real names in CirForwardDeclarations cache 2021-02-18 18:46:45 +03:00
Anton Bannykh bc9a791809 Refactor klib serializer/deserializer 2021-02-18 18:03:41 +03:00
Victor Petukhov ad9fd7ecf3 KotlinBinaryClassCache: clean-up request caches for all threads
^KT-44550 Fixed
2021-02-18 17:05:59 +03:00
Alexander Dudinsky 5cbbbc3b83 Fix artifacts needed for the kotlin-gradle-plugin 2021-02-18 16:50:52 +03:00
Alexander Dudinsky 33313ae4b4 Fix artifacts needed for the kotlin-gradle-plugin 2021-02-18 16:47:22 +03:00
Sergey Shanshin 8c20c655fe Updated bytecode of serialization for IR
`shouldEncodeElementDefault` now checked before evaluating default value
2021-02-18 15:03:35 +03:00
Dmitriy Novozhilov 7b7b8fbea7 [Test] Filter dependent modules by source kind in creating FirModuleInfo 2021-02-18 14:44:44 +03:00
Alexander Udalov 8c95b78346 Update JVM metadata version to 1.5.0
Improve the test which checks that we use correct metadata version if
`-language-version` is passed by checking all supported language
versions.

The change in libraries/reflect/build.gradle.kts is needed because
kotlinx-metadata-jvm of version 0.1.0 is based on pre-1.4 Kotlin, which
doesn't support the new module file metadata generated with metadata
version 1.4 and later, and module files need to be readable there to be
able to transform them for the shadow plugin.

Similarly override dependency on kotlinx-metadata-jvm in the
binary-compatibility-validator module.
2021-02-18 12:42:23 +01:00
Alexander Udalov dbadd5846a Add test for script flag in kotlin.Metadata
It passes at the moment because the test uses old backend, but the
required behavior is not yet supported in JVM IR, and it'll need to be
fixed.
2021-02-18 12:36:54 +01:00
Alexander Udalov 1d6b198915 Build: suppress version and JVM target warnings
To further reduce the output on each build.
2021-02-18 12:17:17 +01:00
Alexander Udalov 49fc1b9e3e Build: enable -Werror for several modules 2021-02-18 12:14:09 +01:00
Hyojae Kim 82ac482143 Fix typo (#4051)
Fix typo
2021-02-18 12:28:19 +03:00
Alexander Dudinsky a3fa6c6d13 Publish artifacts needed for the kotlin-gradle-plugin in kotlin-ide repository 2021-02-18 11:51:32 +03:00
Dmitriy Novozhilov 9b4949a3c5 [FIR] Fix taking symbol of expression with smartcast inside DFA 2021-02-18 10:10:38 +03:00
Alexander Udalov adb05ab076 JVM IR: write inherited multifile parts flag to kotlin.Metadata
This flag is unused at the moment, but might be used one day to support
proper incremental compilation for multifile classes.
2021-02-17 21:56:18 +01:00
sebastian.sellmair 35008df969 [Commonizer] Rename NativeDistributionCommonizer to LibraryCommonizer 2021-02-17 19:24:54 +00:00
sebastian.sellmair 4500b6ce74 [Commonizer] Implement :native:kotlin-klib-commonizer:api with support for library commonization
- Implement new Gradle module ':native:kotlin-klib-commonizer'
- Implement new NativeKlibCommonize task
- Implement CommonizerTarget.identityString
2021-02-17 19:24:54 +00:00
Dmitry Petrov 6d019d9544 JVM_IR indy-SAM on functional expression 2021-02-17 22:18:06 +03:00
Mikhael Bogdanov 134fda8bad Support Unit/V types in string-concat indy calls
unitComponent.kt test fails with JVM target 9+
2021-02-17 18:43:24 +01:00
Mikhael Bogdanov e3e7e6b740 Make indy-with-constants default for -jvm-target 9+
#KT-42522 Fixed
2021-02-17 18:43:23 +01:00
Mikhael Bogdanov 3d8e8dd3ba Fail on compilation errors in AbstractBytecodeTextTest 2021-02-17 18:43:23 +01:00
Mikhael Bogdanov 61fce74b76 Support new targets in KotlinBytecodeToolWindow
#KT-30222 Fixed
2021-02-17 18:43:23 +01:00
Sergey Shanshin 91f1cb88c1 Support serialization of java enum classes in IR
Fixes Kotlin/kotlinx.serialization#1334
2021-02-17 20:24:31 +03:00
Tianyu Geng 652207dcac FIR IDE: add AddModifierFix 2021-02-17 18:19:27 +01:00
Tianyu Geng 5793f77ece FIR IDE: AddModifierFix -> AddModifierFixMpp 2021-02-17 18:19:27 +01:00
Sergey Shanshin de06a69b12 Added external serializers in serialization plugin for IR backend
- added fallback support of external serializers in IR
- implemented calculations of properties default values in IR
- swapped check of shouldEncodeElementDefault and comparing the property with default value in IR. Now default value calculated only of shouldEncodeElementDefault returns false
2021-02-17 20:16:34 +03:00
Tianyu Geng 66f00a2eb5 FIR IDE: move AddFunctionBodyFix to fe-independent 2021-02-17 18:14:10 +01:00
Alexander Udalov 67e91b7ebd Minor, add workaround for KT-45008 2021-02-17 16:39:19 +01:00
Alexander Udalov 4d9cffccf2 Support structural equals/hashCode for type constructors of type parameters
Use the same logic as for type constructors of classes, based on the
fully-qualified name of the classifier, with special cases for error
types and local declarations, with an additional check that the type
constructors' declaration descriptors are structurally equal via
`DescriptorEquivalenceForOverrides`. The latter is required because type
parameters of overloaded functions must be different, even though their
full FQ name is the same.

This (hopefully) has no effect for the compiler, but is useful for
kotlin-reflect where `KType.equals` runs the type checker on the
underlying `KotlinType` instances, which eventually ends up comparing
type constructors. Descriptors and types in kotlin-reflect are cached on
soft references, so they may be suddenly garbage-collected and
recomputed, and we want copies of the same type parameter to be equal to
each other.

This fixes flaky codegen tests which started to fail after migration to
the new test infrastructure, where tests are now run in parallel in the
same process, thus with higher memory pressure and more soft references
being GC'd:

* `codegen/box/reflection/types/createType/typeParameter.kt`
* `codegen/box/reflection/supertypes/genericSubstitution.kt`

Also, add a new test to check that we do the instanceof check in
overrides of `AbstractTypeConstructor.isSameClassifier`.

 #KT-44850 Fixed
2021-02-17 14:41:07 +01:00
Alexander Udalov aaecb87d1b Tests: compute runtime classpath for JVM box tests manually
Taking just the `jvmClasspathRoots` is not correct because it also
contains stuff needed for resolve to work correctly, such as JDK (full
or mock), stdlib (full or mock), reflect. JDK is obviously not needed in
the classpath, and stdlib/reflect are available via the parent class
loader, which is specifically reused across all tests to make them run
faster.

Also, don't try to create class loader for Java-only modules in
`JvmBoxRunner.processModule`. This happens, for example, for all tests
which were moved from `boxAgainstJava`.
2021-02-17 14:41:07 +01:00
Dmitriy Novozhilov df42868874 [Inference] Fix subtyping on classes with same FQN but with different number of arguments
Such situations may appear if there are multiple classes with same
  names from different modules in dependencies
2021-02-17 16:23:08 +03:00
Dmitriy Novozhilov 0b22c30ab1 [FIR] Fix dispatch receiver type for members of builtin functional types 2021-02-17 16:23:08 +03:00
Dmitriy Novozhilov e5ab684127 [FIR] Support methods of cone type contexts with annotation markers 2021-02-17 16:23:08 +03:00