- Get rid of SPECIAL mode (just left REGULAR and class-related instead)
- Clear naming
- Restore contexts after lambda/callable reference are processed
The test has been failing before this change because after
callable reference is resolved, its tower data context has been left
erroneously in the SPECIAL-related entry
If we want to analyse some function's call, we need to know about its
contracts, otherwise resolving the following code would be broken.
Computing return type of function is a prerequisite to using it in any
sensible way, so it's the best place to resolve it to CONTRACTS
KT-50733
This commit fixes a failing visibility check
(FirSymbolByPsiTestGenerated.testBackingField) for the backing field.
Merge-request: KT-MR-6389
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
Using `ownerLookupTag` might be wrong in case of private constuctors
of inner classes: their owner is an Inner class, but expected
dispach receiver is Outer
- use-site should be contained within the class that owns callee symbol
- class-representative of dispatch receiver value
should be exactly the same as a container class of a callee (not its subtype)
Previously we always generated factories for contextful lambdas:
```kt
fun foo(a: Int) = { a }
```
```js
function foo(a_38) {
return foo$lambda(a_38);
}
// factory!
function foo$lambda($a) {
return function () {
return $a;
};
}
```
After this patch, the generated code for `foo` is more concise:
```js
function foo(a) {
return function() { return a; };
}
```
The problem that this function has been solving (resolving declarations
to a somewhat adequate resolve phase) should be solved in another place;
moreover, right now it is the only scope that uses that function, which
is non-consistent
It leads to further infer type variable into those upper bounds which is forbidden
Substituted upper bounds is ok because specific substituted types came from constraints of other proper positions, or if specific substituted type is from declared upper bound too, then there should be another declared upper bound with no substitution
^KT-51464 Fixed
^KT-47986 Fixed
Sorting invokes descriptor renderer, so the fewer descriptors we are
sorting, the better. This helps to save a few percent of compilation
time in a synthetic project from KT-52326.