Commit Graph

49 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 523d37b0f5 [Test] Implement handler which dumps overrides tree of specified classes 2021-03-02 19:11:14 +03:00
Dmitriy Novozhilov 4299794de2 Move SmartPrinter to :core:compiler.common 2021-03-02 19:11:10 +03:00
Ilya Kirillov 83f8650e80 Move CallableId from fir module to compiler.common to use in IDE 2021-02-24 20:13:41 +01:00
Dmitriy Novozhilov 3626008ed2 [Inference] Add ability to approximate local types in AbstractTypeApproximator 2021-02-19 12:47:27 +03: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
Simon Ogorodnik 83836037f8 Add documentation on type checker context / type system context 2021-02-15 18:29:00 +03:00
Simon Ogorodnik 3909e3c54c Decouple TypeCheckerContext and TypeSystemContext 2021-02-15 18:28:58 +03:00
Alexander Udalov e0b6d4d917 Add -Xsuppress-deprecated-jvm-target-warning to modules compiled with 1.6
Currently this leads to an unknown argument warning, but it'll be
removed automatically on the next bootstrap.
2021-02-03 12:51:39 +01:00
Victor Petukhov 9efac8f68b Propagate all annotations during creating simple functional types
^KT-44563 Fixed
2021-01-29 13:50:46 +03:00
Victor Petukhov f06a5321a6 Approximate definitely not-null types for type parameter's types if they are already not-null (has not-null upper bounds)
^KT-44440 Fixed
2021-01-25 14:17:58 +03:00
Ilya Kirillov a52674f181 FIR: use more meaningful error messages 2021-01-15 17:23:00 +01:00
Stanislav Erokhin d24331955e Rename FirConstKind to ConstantValueKind and move it to compiler.common 2021-01-14 12:12:25 +01:00
Alexander Udalov 77a9d14f93 Capitalize/decapitalize only ASCII characters across project
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Alexander Udalov eef06cded3 JVM IR: output stable ABI binaries by default
#KT-43592 Fixed
2020-12-20 23:14:54 +01:00
Alexander Udalov 3f517d7e8d Add new metadata flag for class files compiled with FIR
Report a separate error when class files compiled with FIR are in
dependencies, in addition to the one for class files compiled with FE
1.0 + JVM IR.

 #KT-43592
2020-12-20 23:14:30 +01:00
Alexander Udalov cbd90c3af5 Refactor boolean IR ABI stability flag to enum
Introduce an enum DeserializedContainerAbiStability with two values.
This is needed in order to support another reason for ABI instability in
a subsequent commit, namely "unstable because compiled by FIR".

 #KT-43592
2020-12-20 23:14:12 +01:00
Dmitriy Novozhilov 7897bb6adb [FE] Support sealed classes and interfaces from java
KT-43551
KT-41215
2020-12-09 22:54:29 +03:00
Ilmir Usmanov 516fce37db Value classes: Allow unsigned arrays in annotations
including varargs, apparently.
So, we allow unsigned types and unsigned arrays in annotations,
but disallow user-defined inline classes.
 #KT-23816 Fixed
2020-12-03 17:22:08 +01:00
Jinseong Jeon d58e5b1d95 Remove unnecessary semi-colons 2020-11-25 16:55:09 +03: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 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
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
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
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
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 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 3822a32fce [FIR] Prepare commonization of PostponedArgumentInputTypesResolver 2020-10-13 11:00:20 +03:00
Dmitry Savvinov f02593074f Drop isEqualTypeConstructor in favour of areEqualTypeConstructors 2020-10-09 13:44: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
Лихолетов Михаил cfc1ebb4be [FIR] Support several annotation argument diagnostics 2020-09-16 16:53:31 +03:00
Dmitriy Novozhilov e1ad1aabc4 Move RequireKotlinConstants to :core:compiler.common 2020-09-11 10:08:34 +03:00
Victor Petukhov 140edb2215 Consider intersection with ILT subtype of ILT 2020-09-09 13:55:07 +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 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 7d9b7df3b4 Cleanup code in EffectiveVisibility.kt and extract descriptors related part to separate file 2020-09-04 11:07:42 +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 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 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 bc1b6d3588 Rename :core:descriptors.common to :core:compiler.common 2020-08-25 10:41:34 +03:00