[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
This commit is contained in:
Ivan Kylchik
2024-02-29 13:25:43 +01:00
committed by Space Team
parent b157a8eae5
commit ada47eb110
7 changed files with 74 additions and 0 deletions
+1
View File
@@ -24,6 +24,7 @@ List of all FIR phases that exist in the compiler right now with a short descrip
- **EXPECT_ACTUAL_MATCHING**: The compiler matches and records an `expect` member declaration for `actual` member declarations.
- **CONTRACTS**: The compiler resolves a contract definition in property accessors, functions, and constructors.
- **IMPLICIT_TYPES_BODY_RESOLVE**: The compiler resolves types for callable declarations without an explicit return type.
- **CONSTANT_EVALUATION**: The compiler evaluates values of const properties and defaults of annotations' constructors.
- **ANNOTATION_ARGUMENTS**: The compiler resolves arguments of annotations in declaration headers.
- **BODY_RESOLVE**: The compiler resolves bodies for declarations.
- **CHECKERS**: At this point, all FIR tree is already resolved, and it's time to check it and report diagnostics for the user.