Commit Graph

972 Commits

Author SHA1 Message Date
Anastasia.Shadrina a86b4d767e [FE] KT-50878 Prohibit using contextual declarations without -Xcontext-receivers 2022-01-21 17:21:59 +03:00
Mikhail Glukhikh 756ff6cf43 Minor performance improvements in tryToCompleteWithBuilderInference 2022-01-20 23:46:40 +03:00
Mikhail Glukhikh e8be9d4861 FIR: support don't use builder inference if possible
In this commit we upgrade FIR builder inference logic from
the compiler version to 1.7. FIR-based compiler now works with
"don't use builder inference" flag always ON and supports switching
the flag "use builder inference only if needed". To do it,
ContraintSystemCompleter (FIR) and KotlinConstraintSystemCompleter (FE 1.0)
are made similar with extracting some common parts into
ConstraintSystemCompletionContext.

Test status: one BB test fails after this commit (KT-49285).
Also we have a crush in DFA logic in FIR bootstrap test and somehow
questionable behavior in FIR diagnostic test. However,
two BB tests were fixed, the 3rd case from KT-49925 were also fixed.

#KT-49925 Fixed
2022-01-20 23:46:36 +03:00
Pavel Kirpichenkov b4c854429f [MPP] Permit const actual properties for non-const expects
It's safe as not having const is more restrictive, therefore can be
allowed in common. Otherwise, it's not possible to declare an expect
declaration for a platform property with `const` modifier in common

KT-18856
2022-01-19 13:22:47 +03:00
Mikhail Glukhikh fdf336042b Provide migration of Any functions via super in abstract case
Related to KT-38078
2022-01-14 22:20:21 +03:00
Mikhail Glukhikh b689bbf5c7 Forbid usages of super if in fact it accesses an abstract member
#KT-49017 Fixed
2022-01-14 22:20:21 +03:00
Denis.Zharkov 1d258635a2 NI: Get rid of confusing asConstraintSystemCompletionContext
NB: there is a different asConstraintSystemCompleterContext that might have side effects
2022-01-11 20:45:53 +03:00
Victor Petukhov 455b3143e7 [FE 1.0] Introduce builder inference stub types checker which may report more precise and clear errors due to resolution ambiguity
^KT-49828 Fixed
2022-01-11 18:34:47 +03:00
Victor Petukhov 4dc9b291e5 [FE 1.0] Store builder inference session in the corresponding lambda argument 2022-01-11 18:34:46 +03:00
Victor Petukhov 74f294d849 [FE 1.0] Store constraint system in call resolution result instead of constraint storage 2022-01-11 18:34:45 +03:00
Victor Petukhov 37d163d417 [FE 1.0] Don't lose diagnostics during lambda analysis at the overload resolution by return type stage
^KT-49658 Fixed
2022-01-11 18:07:05 +03:00
Irene Dea a98e2c4e03 Fix failed tests 2022-01-08 15:26:44 +03:00
Irene Dea 374d287d08 Reorganize TypeAttributeTranslatorExtension 2022-01-08 15:26:38 +03:00
Irene Dea 19bfc43bee Fixes and refactors 2022-01-08 15:25:07 +03:00
Victor Petukhov d3ee284461 [FE 1.0] Check for readiness to fix for all type variables after try analysing a lambda with the builder inference
^KT-50498 Fixed
2021-12-24 13:37:45 +03:00
sebastian.sellmair ba201a249e [MPP] allModulesProvidingActualsFor: Support non-hmpp ide case
^KT-50156
2021-12-23 08:57:54 +00:00
sebastian.sellmair 2e55b82ba3 [MPP] Introduce allModulesProviding(Expects|Actuals)For filters
This new filters will also take care of filtering out descriptors
that are provided by 'regular' dependencies instead of 'dependsOn'
dependencies.

^KT-50120
2021-12-21 21:31:44 +00:00
sebastian.sellmair e561b095f7 [MPP] Fix checkExpectedParameter using wrong ModuleFilter
KT-50120 Partially solved for functions.
ClassConstructors seem to be deserialized with 'isExpect=false'
which will still lead to wrong 'expect/actual matching'
2021-12-21 21:31:43 +00:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Victor Petukhov e50e055eb4 [FE 1.0] Don't try to compute value parameters for variables while creating a flat signature for the overload resolution
^KT-50172 Fixed
2021-12-16 17:46:01 +03:00
Victor Petukhov 24900630cb Revert "Revert "[FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor""
This reverts commit faeb5d21ab.
2021-12-14 14:21:46 +03:00
Nikolay Krasko faeb5d21ab Revert "[FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor"
This reverts commit 0e6762acc3.
2021-12-10 16:54:55 +03:00
Victor Petukhov 0e6762acc3 [FE 1.0] Provide an API to clean compile time initializer cache for variable descriptor 2021-12-09 16:15:24 +03:00
Victor Petukhov 7475d26902 [FE 1.0] Implement checker to detect changed resolve for progressions and ranges due to the start of implementing Collection<T>
^KT-49276 Fixed
2021-12-07 18:48:27 +03:00
Anastasiya Shadrina 4372670dfa [FE] Minor: remove redundant check 2021-12-02 20:24:45 +03:00
Anastasiya Shadrina 17b7bca5e4 [FE] CheckContextReceiversResolutionPart: return if no context receivers 2021-12-02 20:24:45 +03:00
Anastasiya Shadrina fd7d000138 [FE] Minor: rename ApplicableArgumentWithConstraint 2021-12-02 20:24:43 +03:00
Anastasiya Shadrina aeaa7f71da [FE] Refactor: remove unused imports 2021-12-02 20:24:42 +03:00
Anastasiya Shadrina 2ce885b811 [FE] Minor: rename getArgumentWithConstraintIfCompatible() 2021-12-02 20:24:42 +03:00
Anastasiya Shadrina 4aa05d85a4 [FE] Handle context receivers in CallableReferencesCandidateFactory 2021-12-02 20:24:29 +03:00
Anastasiya Shadrina 083e718efd [FE] Protect resolution from context receivers calculations 2021-12-02 20:24:29 +03:00
Anastasiya Shadrina a091b345a0 [FE] Provide overloadability for candidates with different CR 2021-12-02 20:24:19 +03:00
Anastasiya Shadrina 7fce2691e2 [FE] Allow lambda argument cast to contextual functional type 2021-12-02 20:24:15 +03:00
Anastasiya Shadrina d8faa9686d [Tests] Test samples from KEEP 2021-12-02 20:24:14 +03:00
Anastasiya Shadrina f92ac6ca14 [FE] TowerResolver optimizations 2021-12-02 20:24:12 +03:00
Anastasiya Shadrina e3f987459c [PSI, FE] Support functional types 2021-12-02 20:24:11 +03:00
Anastasiya Shadrina e53cee77a3 [FE] Support multiple candidates for extension receiver 2021-12-02 20:24:10 +03:00
Anastasiya Shadrina af78ec7371 [PSI, FE] Review fixes 2021-12-02 20:24:04 +03:00
Anastasiya Shadrina f427265739 [FE] Resolve overload conflict between contextual and non-contextual declarations 2021-12-02 20:24:03 +03:00
Anastasiya Shadrina 814777ba8c [FE] Report ambiguity in all possible cases 2021-12-02 20:23:58 +03:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Anastasiya Shadrina 1f6746dc74 [FE] Relax the "no subtyping between context receivers" limitation 2021-12-02 20:23:56 +03:00
Anastasiya Shadrina bfd20e1890 [FE] Move context receivers checks to the separate resolution part 2021-12-02 20:23:56 +03:00
Anastasiya Shadrina c34fe8d547 [FE] Implement temporary resolution algorithm 2021-12-02 20:23:24 +03:00
Anastasiya Shadrina d923c95671 [FE] Add context receivers to scope 2021-12-02 20:23:22 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Denis.Zharkov 0d9ad62d4a Fix inference for lambdas with with extension function expected type
^KT-49832 Fixed
^KT-49836 Fixed
2021-11-26 19:39:51 +03:00
Denis.Zharkov 61fe70b600 Minor. Rename isAnonymousFunction to isFunctionExpression 2021-11-26 19:39:50 +03:00
Victor Petukhov a6fd14d4e6 [FE 1.0] Eliminate resolution ambiguity on inherited SAM-interfaces
^KT-17765 Fixed
2021-11-22 14:18:30 +03:00
Victor Petukhov a5c6d370dd [FE 1.0] Eliminate resolution ambiguity with external type parameters
^KT-10926 Fixed
2021-11-22 14:18:29 +03:00