Review: https://jetbrains.team/p/kt/reviews/9967
1. Fix weird indentation in ValDeferredInit*
2. Use meaningful names in ValDeferredInit*
3. Drop leading indentation in VarDeferredInit*. Not everyone has a wide
monitor
4. Add some NOTICABLE comment that VarDeferredInit* test should be read
as table
Review: https://jetbrains.team/p/kt/reviews/9967
This commit fixes:
Cause 2: java.lang.IllegalStateException: Not reachable case. We can always suggest making `open val` property `final`
at org.jetbrains.kotlin.resolve.DeclarationsChecker.reportMustBeInitialized(DeclarationsChecker.kt:845)
at org.jetbrains.kotlin.resolve.DeclarationsChecker.checkPropertyInitializer(DeclarationsChecker.kt:778)
at org.jetbrains.kotlin.resolve.DeclarationsChecker.checkProperty(DeclarationsChecker.kt:614)
at org.jetbrains.kotlin.resolve.DeclarationsChecker.process(DeclarationsChecker.kt:106)
at org.jetbrains.kotlin.resolve.BodyResolver.resolveBodies(BodyResolver.java:258)
Reproducible in K1 & K2
From user point of view it's an improvement in compilation message.
From technical point of view it's an introduction of new compilation
diagnostic.
Review: https://jetbrains.team/p/kt/reviews/9967
I'm going to deprecate `open val` case in the next few commits KT-57553.
But it is always possible to suggest using `final` for `open val` case.
^KT-58346 Fixed
Review: https://jetbrains.team/p/kt/reviews/9967
BTW this commit accidentaly and partially fixes KT-57553 for K2, because
of a cleaner K2 architecture. I will unify MUST_BE_INITIALIZED behaviour
in K1 and K2 in the next commits
Review: https://jetbrains.team/p/kt/reviews/9967
I'm going to change the logic in this area in the next few commits
KT-57553. So let's cover the current behaviour with tests.
*.fir.kt tests are not properly formatted because of K1 and K2 different
behaviour. I will fix it in the next commits
- Mangled names of property accessors now include context receiver
types of the corresponding property when computed from FIR.
- Context receivers are now supported when computing mangled names
from IR
- IrBasedDescriptors now account for context receivers
^KT-57435 Fixed
After it's released, there would be no need in them, but right now
they are unavailable through the toolchain, so we can't require it.
See KT-58765 for tracking
But there should be a dedicated Build configuration with JDK_21_0 env
properly set.
^KT-58716 Fixed
This commit removes the relevant feature from 1.9 and
makes this feature experimental.
We plan to enable it in some 2.* version (not earlier than 2.1)
Related to KT-54261, KT-36932, KT-49276
#KT-58791 Fixed
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
Both explicitly specified and default argument expressions are considered.
In case an argument expression is considered as 'unlinked' the whole annotation
is removed from the declaration. An appropriate compiler warning logged for each
such case.
The reason #1 for this feature is that we want to test IdSignatures
generated for declarations. Currently, there is no (easy) way to ensure
that a change in the signature building logic doesn't cause any breaking
changes wrt klibs.
Now, most IdSignatures include hashed mangled names in them, so even if
we catch a regression where the included hash changes, there would be no
way of knowing immediately what caused it, unless we'd also have mangled
names in the expectations.
The reason #2 is to test the manglers themselves. Currently, there are
no tests for them. They heavily duplicate each other, this is already
causing issues (see KT-57427) that would be very hard to catch without
these tests.
^KT-58238 Fixed
The test is not in any way JVM-specific, but it fails on the JS BE
because of different fq-names of stdlib symbols on JVM and JS.
The fix is in progress. Mute the test until the fix is ready.
The change in `QualifiedNameResolution.kt` is
backed by `starImportOnTypeAlias.fir.kt` and
`javaStaticMembersViaTypeAlias.fir.kt`.
Note that referencing inner classes via type-aliases is
prohibited, but referencing enum entries is not.
^KT-58523 Fixed