1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
receiver type with the proper substitution. Before it was set to the
class itself (since the class was usually passed as a new dispatch
receiver)
Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
Consider the following code:
```
fun test(a: List<String>) {
a.first()
}
```
The dispatch receiver type of `first` in this case is `List<T>` before
this change. After this change, it's `List<String>`.
In addition, this change also replace the dispatch receiver type with
the more specific type if available. For example, consider the following
```
class MyList: ArrayList<String>()
fun test(a: MyList) {
a.get(0)
}
```
The dispatch receiver type of `get` is `MyList`, instead of
`ArrayList<String>`. That is, a fake override is created in this case.
JavaSymbolProvider uses KotlinPsiElementFinderWrapper for finding classes.
CliFinder looks for Java classing assuming that class with ClassId=a/b/C
lives in directory a/b and do not look into real package name of Java class.
This causes that we may find some classes which we should not see from current scope.
Also, the IDE implementation works correctly here (it also checks file package)
which cause different behaviour of FIR IDE and FIR
This change also requires to fix testdata and make Java classes live
in directory consistent with file package
Previously the callee reference of a delegated constructor call is
always the same as the call itself. This violates the contract that no
two FIR elements can have identical sources. In addition, this sets the
entire call expression as the source of the callee expression.
This change instead sets the proper constructor ref as the callee.
Also fixed EXPLICIT_DELEGATION_CALL_REQUIRED type. It should be an error
instead of a warning.
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
Several tests are affected by the usage of fixation direction calculator in FIR.
Restored to mimimize test data changes.
It is unnecessary in FE10 because a type variable with unknown type
is inferred into an error type, but affects test data in FIR where
Nothing/Any is selected by direction (as a temporary measure).
CR candidate in spec test is Unresolved in FIR because top-level CRs are resolved as call arguments.
Resolution ambiguity is also present in FE10 when CR is wrapped into an id call.
Before this commit, we had effective visibility as a part of FIR status,
so it was integrated into the full pipeline. In this commit,
we introduced "effective visibility as a service" which is now used
only by exposed visibility checker. This allows us to make the thing
universal for all FIR nodes, including nodes for Java / deserialized.