Commit Graph

885 Commits

Author SHA1 Message Date
Dmitriy Novozhilov f3116cb64a Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code 2021-07-20 13:33:46 +03:00
Dmitriy Novozhilov 6e83820f97 Move ExpectActualCompatibility to :compiler:resolution.common 2021-07-20 10:33:33 +03:00
Victor Petukhov 6a1ec92d39 Introduce specific error for calls which could be resolved only with unrestricted builder inference
^KT-47747 Fixed
2021-07-16 19:32:36 +03:00
Victor Petukhov 357fda2efa Initialize builder inference lambda anyway, even a call is inapplicable
^KT-47744 Fixed
2021-07-16 19:32:35 +03:00
Victor Petukhov c2cf2f36cd Implement inferring materialized self types through a default type in ResultTypeResolver 2021-07-09 19:21:04 +03:00
Victor Petukhov 3787099a38 Put the type inference on calls with self types under the compiler flag 2021-07-09 19:20:56 +03:00
Victor Petukhov 51c5a54e31 Support type inference for self type materialization calls 2021-07-09 19:20:54 +03:00
Mikhail Zarechenskiy 44cf4be1e5 Inference for some kind of self types 2021-07-09 19:20:52 +03:00
Victor Petukhov c3a5a7754d Use proper applicability for constraint warnings
^KT-47316 Fixed
2021-07-09 14:07:01 +03:00
Tianyu Geng ce767046eb FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-10 16:01:13 +03:00
Victor Petukhov 124a14c8df Use separate constraint position during call substitution as part of inferring postponed type variables
^KT-47052 Fixed
^KT-47082 Fixed
2021-06-03 12:37:17 +03:00
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00
Tianyu Geng 84334b087c FIR checkers: report SMARTCAST_IMPOSSIBLE 2021-06-02 13:19:12 +03:00
Alexander Udalov bcf47ddc94 Move optional annotation utilities to module 'resolution'
To avoid depending on a heavy module 'frontend' in parts of the compiler
where checking for optional annotations is needed, such as in
'ir.serialization.common'.
2021-06-01 20:28:22 +02:00
Victor Petukhov 9fd1cbd2e7 Inject stub type variables of a different builder inference call properly 2021-05-28 15:36:19 +03:00
Victor Petukhov afbda75581 Set member scope for builder inference stub types equivalent to Any 2021-05-28 15:36:18 +03:00
Victor Petukhov 6356b9d501 Put removing builder inference restrictions under the compiler flag 2021-05-28 15:36:17 +03:00
Victor Petukhov 5a11450d77 Split stub types into stub type for subtyping and for builder inference and use them in the proper way 2021-05-28 15:36:17 +03:00
Victor Petukhov ac7b459f2a Do subtyping with stub types properly
1) Return stub type if we are calculating super type between two same stub types
2) Return nullable Any if those stub types are different
2021-05-28 15:36:15 +03:00
Victor Petukhov 5d0461c722 Remove restrictions for builder inference internal calls 2021-05-28 15:36:14 +03:00
Denis.Zharkov dac5c31993 Minor. Simplify ConstraintSystemUtilContext::createArgumentConstraintPosition 2021-05-20 17:24:23 +03:00
Victor Petukhov 21dada4d2d [Jspecify] Use enhancement of type with enhancement if possible during substitution 2021-05-18 17:52:10 +03:00
Victor Petukhov 12f6146bdf [Jspecify] Substitute enhancement of type instead of type itself directly 2021-05-18 17:52:09 +03:00
Victor Petukhov 2479655708 [Jspecify] Do preserving flexibility when adding equality constraints by taking into account type with enhancement 2021-05-18 17:52:07 +03:00
Dmitriy Novozhilov d114913cd2 Replace usages of addToStdlib.firstNotNullResult with firstNotNullOfOrNull 2021-05-14 14:30:19 +03:00
Victor Petukhov 7c62e9aecd Introduce warnings reporting by missed constraints because of incorrect optimization in the constraints processor 2021-04-30 15:46:04 +03:00
Tianyu Geng 6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00
Dmitriy Novozhilov b530427bb2 Fix substitution of generic types in contracts
#KT-41078 Fixed
2021-04-16 17:23:24 +03:00
Victor Petukhov 73a2838555 Do substitution captured type's super types as well
^KT-45982 Fixed
2021-04-12 14:00:40 +03:00
Denis.Zharkov e74a0c7ef7 Pass languageVersionSettings to AbstractTypeApproximator 2021-04-09 13:06:35 +03:00
Abduqodiri Qurbonzoda 19116e5623 Migrate compiler and others from sumBy to sumOf 2021-04-08 03:48:02 +03:00
Victor Petukhov bbf5c4412e Do subtyping between self types with captured type in special way 2021-03-29 16:30:58 +03:00
Victor Petukhov 999d1f982e Introduce hierarchy of inference sessions 2021-03-24 15:57:47 +03:00
Victor Petukhov a2b1aa753b Substitute captured types with type variables properly
^KT-44687 Fixed
2021-03-19 16:16:09 +03:00
Dmitriy Novozhilov 74118930b4 [FE] Don't fail with exception if ESVisitor tries to visit ESLambda
#KT-45243 Fixed
2021-03-11 00:58:24 +03:00
Pavel Kirpichenkov c68a4bdc0f [MPP] Consider expect-actual inline/value classes interchangeable
^KT-44926 Fixed
2021-03-01 19:25:31 +03:00
Simon Ogorodnik 3909e3c54c Decouple TypeCheckerContext and TypeSystemContext 2021-02-15 18:28:58 +03:00
Victor Petukhov f797ee7803 Substitute captured types with inner intersection one (NewTypeSubstitutor)
^KT-44651 Fixed
2021-02-11 14:20:14 +03:00
Victor Petukhov 670f029bdf Allow passing non-spread arrays into a vararg parameter after sam properly, through propagating vararg element type to a sam adapter from the original parameter descriptor 2021-01-28 13:19:31 +03:00
Victor Petukhov 8bd78064be Do substitution of a type enhancement, not only lower and upper bounds
^KT-44439 Fixed
2021-01-25 12:14:34 +03:00
Dmitriy Novozhilov 025ec8e8b1 Add FQ_NAME postfix to OVERLOAD_RESOLUTION_BY_LAMBDA_ANNOTATION 2020-11-11 09:52:55 +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 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 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
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
Victor Petukhov 25ea3df5ca Put fix in 9123c4f73baf77f8a50dede6c890c46f5ffafd6c under the inference compatibility flag 2020-09-23 17:15:58 +03:00