Commit Graph

16 Commits

Author SHA1 Message Date
Ivan Kylchik 61fabc02ba [K2] Resolve bodies of const properties during IMPLICIT_TYPES_BODY_RESOLVE
This is required to implement constant evaluator on the FIR level.

#KT-64151
2024-03-13 16:53:59 +00:00
Denis.Zharkov 232c3aeadc K2: Fix PCLA breaking change when using a bare type on a type variable
See the change at docs/fir/pcla.md and the kdoc
at `getAndSemiFixCurrentResultIfTypeVariable` for clarification

^KT-64840 Fixed
2024-03-12 10:22:11 +00:00
Ivan Kylchik ada47eb110 [K2] Add new resolve phase CONSTANT_EVALUATION
During this phase, the compiler will evaluate initializers of
const properties and defaults of annotation's constructor.
Evaluation results will be stored in corresponding attributes.

#KT-64151
2024-03-06 11:35:41 +00:00
Dmitrii Gridin 7a13023b14 [FIR] add KDoc for FirResolvePhase 2024-02-15 19:28:10 +00:00
Denis.Zharkov cabf7e4fae Introduce documentation for PCLA implementation
^KT-65637 Fixed
2024-02-09 19:47:35 +00:00
Pavel Kunyavskiy f50fab65cc [IrActualizer] Update doc on how the actualization process works. 2023-12-15 15:38:10 +00:00
Nikita Bobko 5c8d55fba7 Update docs/fir/k2_kmp.md wrt KT-62590 2023-11-06 14:41:28 +00:00
Simon Ogorodnik 024e94a479 [K2] Document KMP implementation in the K2 Compiler
Add comprehensive documentation explaining the implementation and
functions of the Kotlin multiplatform (KMP) support in the K2 Compiler.
2023-10-12 12:27:54 +00:00
Denis.Zharkov a02cb16fb2 K2: Rewrite delegate inference
The main idea is getting rid of stub types and using just type variables
See more detailed description at docs/fir/delegated_property_inference.md

The problem with stub types is that they need really special treatment
in many places, and on the other hand, there are no clear contracts on
how they should work (that regularly leads to bugs like KT-59529)

^KT-61060 Fixed
^KT-61075 Fixed
^KT-61077 Fixed
^KT-59529 Fixed
^KT-61633 Related
^KT-61618 Related
^KT-61740 Related
^KT-59107 Related
^KT-61747 Related
^KT-61077 Related
^KT-61781 Related
2023-09-08 07:11:48 +00:00
Simon Ogorodnik 3e6b42083b FIR: Fix leakage of type variables in builder inference for lambdas returning Unit
When BI/incomplete call is present in return argument, it will be
added to the main call-tree, leading to requirement violation in
`ConstraintSystemCompleter.getOrderedAllTypeVariables`
as after `FirBuilderInferenceSession.inferPostponedVariables` it will
be completed, and its type variables couldn't be found anymore

In K1, we actually do the same, but we are able to find type variables
of such calls due to architecture difference:
In K2, `getOrderedAllTypeVariables` uses FIR as the main source to
lookup
In K1, `getOrderedAllTypeVariables` uses resolution atom tree, where
candidate/CS of the call is still available after
`inferPostponedVariables`

In fact, all incomplete calls were analyzed in FULL mode according to
the contract of `FirBuilderInferenceSession.addPartiallyResolvedCall`.
Thus, it means we normally shouldn't add them to the main call-tree, but
accidentally do it as incomplete calls contain non-completed candidate

This particular commit addresses the problem partially, only
in cases when the expected return type for the lambda is Unit and when
the incomplete call is located in the last expression of the lambda

In such cases, we can skip the call from the last expression completely,
since all potential calls there were analyzed in FULL mode,
and couldn't introduce any useful info to the CS of the main call-tree

^KT-54294
2023-05-17 10:50:36 +00:00
Simon Ogorodnik 4d1ea06c17 FIR. Document current builder inference algorithm 2023-05-10 10:40:04 +00:00
Jinseong Jeon 4700ad3e9e Docs: fix links to sources in FIR plugins 2022-06-08 11:28:56 +02:00
Dmitriy Novozhilov 7048cac770 [FIR] Move FirPredicateBasedProvider to :compiler:fir:tree module 2022-06-07 14:12:17 +00:00
Dmitriy Novozhilov 086d874fe2 Docs: Fix links to sources in FIR Plugins documentation 2022-01-31 16:28:03 +03:00
Dmitriy Novozhilov ee180a37a6 Docs: add basic FIR plugin API documentation 2022-01-24 11:11:07 +03:00
Ilya Kirillov d1335d3f44 Docs: add basic FIR compiler documentation
Originally written by Dmitriy Novozhilov
2022-01-21 15:56:47 +01:00