Commit Graph

1629 Commits

Author SHA1 Message Date
Dmitrii Gridin cb8cc65fb8 [AA Fe10] update testData
org.jetbrains.kotlin.analysis.api.fe10.test.cases.generated.cases.symbols.Fe10IdeNormalAnalysisSourceModuleSymbolByFqNameTestGenerated.testKclass
2022-11-25 15:33:58 +01:00
Anna Kozlova abb45a0728 [AA] don't treat incomplete function as anonymous
^KTIJ-23672
sync anonymous function predicate with RawFirBuilder/DeclarationsConverter
2022-11-25 14:27:03 +00:00
Anna Kozlova cd0b1c2fff [LL] do not build fir in a non-cancelable section
find by classId might require indices which will throw PCE when not up-to-date
which is prohibited in non-cancelable section
2022-11-25 13:28:20 +00:00
Egor Kulikov d585f068dd [FIR] Make anonymous initializer lazy in RawFirBuilder
Fourth step for KT-52615

Merge-request: KT-MR-7798
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2022-11-25 11:41:44 +00:00
Nikolay Lunyak a454d42e65 [FIR] KT-54587: Report the missing diagnostics
^KT-54587 Fixed

Merge-request: KT-MR-7791
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2022-11-25 10:19:58 +00:00
Vladislav Grechko cd6e865fb3 Improve support of 'lateinit' modifier
- Allow 'lateinit' for inline classes which underlying type
is suitable for 'lateinit'

- K2: report all problems related to 'lateinit' modifier

^KT-55052: Fixed
2022-11-24 19:47:21 +00:00
Dmitrii Gridin 8fc787d6df [AA FIR] FirCallableSignature: rename 'sameSignature' to 'hasTheSameSignature'
^KT-54826
2022-11-24 18:32:46 +00:00
Dmitrii Gridin c5fb8e7ceb [AA FIR] FirCallableSignature: avoid redundant resolve for return type
^KT-54826
2022-11-24 18:32:46 +00:00
Dmitrii Gridin fa7fe74c5f [AA FIR] containing declaration: drop redundant fake elements
it is possible after f775778efa

^KT-54826
2022-11-24 18:32:45 +00:00
Dmitrii Gridin e684607e9d [AA] FirCallableSignature: add test on type alias
^KT-54826
2022-11-24 18:32:45 +00:00
Dmitrii Gridin dfc59d5d07 [AA FIR] support symbol pointer restore for value parameter from delegated setter
^KT-54051
2022-11-24 18:32:44 +00:00
Dmitrii Gridin 55ca2d608b [AA] AbstractSymbolTest: add check for parameters
^KT-54826
2022-11-24 18:32:44 +00:00
Dmitrii Gridin 1222d18b3d [AA Fe10] fix StackOverflowError from KtFe10PsiClassInitializerSymbol
^KT-54826
2022-11-24 18:32:44 +00:00
Dmitrii Gridin ec613e57ef [FIR] add Enhancement wrapping for type parameters
^KT-55095 Fixed
2022-11-24 18:32:43 +00:00
Dmitrii Gridin 2155a23e4e [AA FIR] implement FirCallableSignature to simplify search by signature
^KT-54826 Fixed
2022-11-24 18:32:43 +00:00
Dmitrii Gridin 48e2e5cc87 [AA] AbstractSymbolTest: add type parameters check
^KT-54826
2022-11-24 18:32:43 +00:00
Dmitrii Gridin 771823c9e7 [AA] AbstractSymbolTest: improve implicit checks
^KT-54826
2022-11-24 18:32:42 +00:00
Dmitrii Gridin 7e433a936d [AA FIR] introduce FirCallableSignature to encapsulate IdSignature
^KT-54826
2022-11-24 18:32:42 +00:00
Dmitrii Gridin b04c9f02b0 [AA] add test on data class members
^KT-54051
2022-11-24 18:32:42 +00:00
Dmitrii Gridin edd60cd204 [AA] improve symbol pointers for property accessors
Fe10:
* supported default setter
* support default getter
* support parameter from default setter

Fir:
* support java synthetic properties
* support parameter from default setter

^KT-54051
2022-11-24 18:32:41 +00:00
Denis.Zharkov ca12cfb90d K2: Do not fix variables that has yet unprocessed constraints in forks
Otherwise, exception from org.jetbrains.kotlin.resolve.calls.inference.components.ConstraintInjector.TypeCheckerStateForConstraintInjector.fixedTypeVariable
might happen during forks resolution

The test data is extracted from intelliJ FP test

^KT-43296 Fixed
2022-11-24 17:29:30 +00:00
Denis.Zharkov b73acd7a3a K2: Apply constraints from forks at UNTIL_FIRST_LAMBDA completion phase
Otherwise, OVERLOAD_RESOLUTION_AMBIGUITY is reported for the calls to
the functions annotated as @OverloadResolutionByLambdaReturnType

^KT-43296 In Progress
2022-11-24 17:29:29 +00:00
Denis.Zharkov 10d63cc52a K2: Postpone inference forks resolution until FULL completion
It helps to use expected type information when choosing the branch
even in the nested calls

^KT-43296 In Progress
2022-11-24 17:29:29 +00:00
Denis.Zharkov 715a73c8fb K2: Support inference case with a mix of smart-cast and expected type
The idea is that we should not fix (i.e. choose any of the fork branches)
on the stage of candidate processing before completion, but it's enough
just to check that current state can be converged to success.

And when completion starts, and we add expected type to the system,
we've got more information to choose the correct fork branch.

NB: The old `processForkConstraints` is being called just
at the beginning of the completion phase.

^KT-43296 In Progress
2022-11-24 17:29:28 +00:00
Anna Kozlova cdf6ffa167 [AA] do not try to build KtSymbol for FirErrorFunction
^KTIJ-23669
FirErrorFunctions are created for unknown labels
when the code in return statements is not complete yet.
Such labels cannot be resolved, and no symbols should be created for them
2022-11-24 13:09:29 +00:00
Anna Kozlova 98cb25605a [LL] testdata for KTIJ-21468
ensure that for each destructuring declaration entry exists FirProperty
2022-11-24 10:20:38 +00:00
Egor Kulikov 3e8f7b8ee4 [FIR] Make enum entry initializer lazy in RawFirBuilder
Third step for KT-52615

Merge-request: KT-MR-7769
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2022-11-23 18:55:21 +00:00
Ivan Kochurkin 194d1cfccf [FIR] Filter out incorrect library provides for dependencyProviders
Get rid of providers duplication
2022-11-23 18:29:29 +00:00
Ivan Kochurkin 8883de3f00 [FIR] Don't resolve Enum.declaringClass and Enum.getDeclaringClass
^KT-53946 Fixed
2022-11-23 18:29:29 +00:00
Ivan Kochurkin 6e76978530 [FIR] Consider anonymous objects in FirSuperclassNotAccessibleFromInterfaceChecker
^KT-54673 Fixed
2022-11-23 18:29:28 +00:00
Mikhail Glukhikh f62bdb0e3d K1 opt-in: fix message/behavior for future error with WasExperimental 2022-11-23 12:00:08 +00:00
Mikhail Glukhikh b92ce68f32 K2 opt-in: restore marker annotation check for constructors 2022-11-23 12:00:07 +00:00
Mikhail Glukhikh a77750a257 K2 opt-in: drop redundant recursive check for overridables 2022-11-23 12:00:06 +00:00
Mikhail Glukhikh 73cb4d1a6e K2 opt-in: don't take sub./int. override parent classes into account
#KT-54823 Fixed
2022-11-23 12:00:04 +00:00
Anna Kozlova 43bd05f470 [LL FIR] make dependency from library on builtins invisible from outside
^KTIJ-23421

hide explicit builtins to reveal target platform dependencies.
Otherwise, `expect` class from builtin of e.g. JDK
would be found instead of actual dependency from Kotlin Runtime
2022-11-23 10:46:49 +00:00
Jinseong Jeon c79d65536b Gracefully handle erroneous super type during local type approximation
^KTIJ-23528 Fixed
2022-11-22 20:16:40 +01:00
Ilya Kirillov f775778efa [Analysis API FIR] fix containing declaration for value parameter
now it should also work for non-source declarations
2022-11-22 18:25:30 +01:00
Ilya Kirillov 7781ad67d4 [FIR] introduce FirValueParameter.containingFunctionSymbol
^KT-55034 fixed
2022-11-22 18:25:30 +01:00
Ilya Kirillov c8e3103af9 [FIR] do not create FirParameter for catch parameter
use FirProperty instead

^KT-55034
2022-11-22 18:25:30 +01:00
Dmitriy Novozhilov eb8ce449e3 [FIR] Don't lose flexible types during capturing from expression 2022-11-22 15:46:22 +00:00
Dmitriy Novozhilov 9b7b517f43 [FIR] Properly resolve declarations inside contract calls on CONTRACT phase 2022-11-22 15:46:21 +00:00
Dmitriy Novozhilov 01c6c7dc59 [FIR] Properly approximate return type of callable declarations
- approximate intersection types in all non-local declarations
- approximate local types in non-private non-local declarations
2022-11-22 15:46:20 +00:00
Dmitriy Novozhilov 1b42298025 [FIR] Implement IMPLICIT_NOTHING_*_TYPE diagnostics 2022-11-22 15:46:19 +00:00
Dmitriy Novozhilov 0e84bf2053 [FIR] Don't report ARGUMENT_TYPE_MISMATCH on error types 2022-11-22 15:46:19 +00:00
Dmitriy Novozhilov 82c39187f6 [FIR] Refactor: rename function 2022-11-22 15:46:18 +00:00
Dmitriy Novozhilov 1b27d60307 [FIR] Support @OnlyInputTypes annotation
^KT-54807 Fixed
2022-11-22 15:46:17 +00:00
pyos 5cc08fb314 FIR DFA: check for reassignments of LHS when handling ?..
`x?.y != null` does not imply that `x != null` if e.g. an argument to
`y` has reassigned `x` in the meantime.

The same is true for `x == y` and `functionWithContract(x, y)`, but
those are somewhat harder to implement since there is no easy way to
find the last node of a certain argument.

^KT-55096
2022-11-22 15:44:38 +00:00
pyos 564eca58dd FIR DFA: don't update receivers' types if flow is unchanged 2022-11-22 15:44:36 +00:00
pyos ae31275f73 FIR DFA: unwrap transparent expressions in more places 2022-11-22 15:44:35 +00:00
pyos 5796f0eb07 FIR DFA: clean up LogicSystem API
Receivers have nothing to do with it.
2022-11-22 15:44:33 +00:00