This commit does two things:
- prioritize type parameter scopes against static scopes in body resolve
(effectively it's a revert of KT-58028 fix)
- consider type parameters as inapplicable callable, so during callable
resolve we can go up the tower and still resolve to static scope
This allows both KT-58028 and KT-63377 to work properly
#KT-63377 Fixed
FirDefaultArgumentsInExpectActualizedByFakeOverrideChecker is an adhoc
checker which can be converted to ExpectActualCheckingCompatibility to
reuse common expect-actual checking infrastructure.
^KT-62913 Fixed
Review: https://jetbrains.team/p/kt/reviews/13094/timeline
Tests that were broken by one of my previous commits are now fixed:
- actualFakeOverride_paramsAreCompatibleViaSharedMethodWithDefaultParams.kt
- inheritedJavaMembers.kt
DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE diagnostic
disappeared in delegation.fir.kt because only one
AbstractExpectActualChecker incompatibility can be reported at a time
(DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE is now reported
not by adhoc checker but by common AbstractExpectActualChecker). It
would be nice to report both of them, but it's a separate issue KT-62631
delegation2 test makes sure that
DEFAULT_ARGUMENTS_IN_EXPECT_ACTUALIZED_BY_FAKE_OVERRIDE is reported when
NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS is fixed
This commit fixes fakeOverrides.fir.kt test that got broken in the
previous commit
Previously isFakeOverride was only checked on IR backend. Now this check
is moved to AbstractExpectActualAnnotationMatchChecker which is used by
both: frontend and backend. That's why frontend no longer reports false
positive ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT
Review: https://jetbrains.team/p/kt/reviews/13094/timeline
This tests started failing after the previous commit. I extract this
change into a separate commit to make it obvious that appeared
diagnostics is not an expected behavior. I will fix these tests in the
following commits
Review: https://jetbrains.team/p/kt/reviews/13094/timeline
^KT-63550 Fixed
Review: https://jetbrains.team/p/kt/reviews/13094/timeline
Now it's required to create a new ScopeSession when searching for expect
members for actuals. If you keep reusing actualScopeSession then members
declared in platform may "slip into" the search results, resulting an
incorrect expect for actual (e.g. it happens in
supertypeIsExpectActual_covariantOverrideOfInjectedFromSuper_transitiveSubstitutionFakeOverride.fir.kt)
I suppose that it always has been a bug that we reused
actualScopeSession because we were mixing actualScopeSession and
expect FirSession (which is a bad idea), but we simply didn't have cases
where this bug could be observed. Now after we started matching
fake-overrides, we have such cases.
But creating a new ScopeSession every time is a suboptimal solution. We
need to design a scope caching KT-63773
Review: https://jetbrains.team/p/kt/reviews/13094
I made the test to look like transitiveSuperclassActualization.kt
`actual typealias A = A_J` is incorrect because `A` isn't expect
If I kept the test "as it's", then it would become red once KT-63550 is
fixed
This commit is a preparation step for KT-59887. For now,
expectActualInlineClass.fir.kt became slightly more verbose. Once is
KT-59887 fixed, the verbosity will go away. Because we won't report
incompatibilites mismatches for ACTUAL_MISSING declarations
Review: https://jetbrains.team/p/kt/reviews/13094/timeline
This call to isAbstractMethodOfAny was in Fir2IrLazyClass since its
inception in 0622be14a5, and there's no explanation why this was
necessary. Removing it does not seem to break anything, but fixes the
case when IrFakeOverrideRebuilder is enabled and when Java base class
declares an abstract equals/hashCode/toString which is not overridden in
the Kotlin subclass.
#KT-63443 Fixed
move (de)compilation services from static dependencies into DI
This is done for allowing different (de)compile strategies in the future
Merge-request: KT-MR-13213
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
After bootstrap update and the change that added /usr subdir to
absoluteTargetToolchain
Merge-request: KT-MR-13212
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
Xcode 14 deprecates bitcode embedding, and Xcode 15 removes support
for it. Therefore, testing bitcode embedding in Kotlin doesn't make
much sense.
This commit removes most of test code that enables bitcode.
^KT-61875
This is required to have stable resolution order to avoid concurrent
modifications and correct resolution context.
This also fixes KT-63700 as a super call expands only during body
resolution in the case of secondary constructor
^KT-63042
^KT-63700 Fixed
This is required to have stable resolution order to avoid concurrent
modifications and correct resolution context.
E.g., this commit fixes the resolution behavior of delegate field for
ANNOTATION_ARGUMENTS phase – now annotation argument resolves in the
correct scope
^KT-63042
This issue doesn't affect the compiler because delegate field shares
annotation instance with the containing class, so it will be resolved
before field anyway.
In Low Level FIR we didn't notice this issue because we don't have
isResolved checks for type annotations (KT-63681)
^KT-63042
^KT-63681
This is required to have stable resolution order to avoid concurrent
modifications and correct resolution context.
E.g., this commit fixes the resolution behavior of fake override for
ANNOTATION_ARGUMENTS phase – now annotation argument resolves correctly.
We shouldn't do additional checks in the case of fake declaration
because they should be done on the original side
^KT-63042
Previously, this call was required to avoid sharing to have independent
instances with their own resolution cycle. Now we will have stable
order (in the next commit), so it is possible to share instances.
Also, this change makes the logic consistency with Light Tree
^KT-63042
This is required to have stable resolution order to avoid concurrent
modifications.
Another point here – status phase logic for componentN function is
located in the corresponding property resolution
^KT-63042
Previously, this call was required to avoid sharing to have independent
instances with their own resolution cycle. Now we will have stable
order (in the next commit), so it is possible to share instances.
Also, this change makes the logic consistency with Light Tree
^KT-63042
From one side to check how annotation propagation works and from another
side to cover scenarios with lazy resolution from type position as it is
a valid case of usage in Analysis API (KtFirAnnotationListForType)
^KT-63042