Commit Graph

10 Commits

Author SHA1 Message Date
Nikolay Lunyak 8f8c7fe7cf [FIR] Properly calculate visibilities
`testIntersectionOfPrimitiveBasedFunctions`
is fine, because we deprecate this
already in ^KT-63243.

`CANNOT_INFER_VISIBILITY` is
positioned as `DECLARATION_NAME`,
just in case we decide for
some reason that we do want to
report it along with
`MANY_*_NOT_IMPLEMENTED`. In that
case, we'd get a problem that
their bounds overlap, but not
completely contain one another.

^KT-63741 Fixed
^KT-59400 Fixed
2024-02-15 16:10:14 +00:00
Nikolay Lunyak 7056ad5325 [FIR] Set status.isOverride for fake overrides
Even though SO may not be correct
overrides sometimes, it feels more
natural to treat fake overrides as...
well, "overrides". And without it
we'd need to make the code in
`FirOverrideChecker` less intuitive.
2024-02-15 16:10:13 +00:00
Nikolay Lunyak 3b5fff5473 [FIR] Don't copy VP default values for fake overrides
In general, overrides should not
contain default values, and it's
better to make fake overrides be close
to proper overrides as much as
possible. It will be important when
we begin running `FirOverrideChecker`
for fake overrides.

^KT-63879 Fixed
^KT-65534
2024-02-15 16:10:13 +00:00
Kirill Rakhman 1238f081b7 [FIR] Defer computation of intersection override return type if overridden has implicit return type
#KT-59921
2024-01-31 11:16:50 +00:00
Dmitrii Gridin 357015f399 [FIR] FirFakeOverrideGenerator: drop fake attributes from value parameters
We can find corresponding parameters by the containing function symbol.
Analysis API part is covered by tests from:
* FirIdeNormalAnalysisSourceModuleResolveCandidatesTestGenerated
* FirIdeNormalAnalysisSourceModuleResolveCallTestGenerated
* FirIdeNormalAnalysisSourceModuleTypeScopeTestGenerated

^KT-64243
2023-12-19 16:21:57 +00:00
Dmitrii Gridin ed6a67b26d [LL FIR] proper lazy resolution support for fake declarations
Fake declarations do not require any context to be resolved, so we are
able to resolve them not only for non-local classes.
They share most states with the real declaration, so mostly they are
resolved through `LLFirTargetResolver.resolveDependencies`.
The next step is KT-64363

^KT-64243 Fixed
2023-12-19 16:21:57 +00:00
Dmitrii Gridin 835a9632b9 [FIR] FirFakeOverrideGenerator: use stub expression instead of original default value
We shouldn't copy the default value from the original declaration as is
as it won't be resolved correctly in some cases. It is enough to use
STUB as it will highlight the fact that we have some default value.
In LLFirBodyTargetResolver we shouldn't try to resolve fake declarations
as they don't have bodies and everything should already be resolved

^KT-64243
2023-12-19 16:21:57 +00:00
Dmitrii Gridin c9f11ad74f [FIR] FirFakeOverrideGenerator: unify value parameter copy between regular functions and property accessors
This commit contains:
* correct containingFunctionSymbol for value parameter from accessors
* correct choose between originalForIntersectionOverrideAttr and
originalForSubstitutionOverrideAttr for value parameters from functions

^KT-64243
2023-12-19 16:21:57 +00:00
Dmitrii Gridin 4a87ae9e04 [LL FIR] fix type annotations resolution for fake override declarations
Fake overrides have annotations from a class from which type parameters
were substituted, so we have to resolve them before the declaration.
It worked before in most cases as an original containing class is a part
of the designation path, so we considered annotations from such classes
as our and just resolved them in the wrong scope without right locks

^KT-64243
2023-12-19 16:21:57 +00:00
Dmitrii Gridin b6f0571f0b [LL FIR] introduce lazy resolution tests for fake overrides
^KT-64243
2023-12-19 16:21:57 +00:00