This commit handles "subclass: super-interface by delegate-expression".
During Psi2Fir, for each delegate, we add to the subclass a synthetic
field (which has type super-interface), and an assignment of the
delegate-expression to the synthetic field in the primary constructor,
so that the delegate-expression can be resolved and transformed along
the way.
During Fir2Ir, we look up delegatable members from the super-interface
and generate corresponding functions/properties for the subclass.
TODO: support for generic delegatable members and generic
super-interface.
Don't add `Unit` if variable has an upper constraint T <: A.
It's impossible to coerce variable T to Unit as constraint system will
be always contradictory: T := Unit => Unit should be subtype of A
#KT-39900 Fixed
Before that commit we desugared `a ?: b` as
when (val elvis = a) {
null -> b
else -> elvis
}
It was incorrect, because `a` should be resolved in dependent mode,
but when it was `elvis` initializer it was resolved in independent
mode, so we can't infer type for `a` in some complex cases
- DeprecatedSinceKotlin annotation should only be applicable when
there's `@Deprecated` annotation on the same declaration
- Deprecation level shouldn't be specified in the relevant
`@Deprecated` annotation
- Check that warningSince <= errorSince <= hiddenSince
This annotation will be used in the standard library to prevent the new
compiler from reporting deprecation diagnostics in case an older API
version is used (where the declaration was not deprecated yet).
#KT-23575 Fixed
For Java, they have rather different semantics considering "overrides"
and obtaining functions/properties from supertypes
See the Java statics implementation
The problem was that we didn't incorporate T == Foo into K <: Inv<out T>.
It happened because of optimisation that isn't applicable here as we
already have projection in the initial type
#KT-39777 Fixed
NB: The test data change at testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.fir.kt
is correct: see the relevant non-fir test, the call shouldn't be applicable
^KT-39008 Fixed
It would allow ConeKotlinType.scope return FirTypeScope
and thus pulling down org.jetbrains.kotlin.fir.scopes.FirScope#processOverriddenFunctions
(See the following commits)
It's important to have ambiguity in these cases to introduce overload
resolution by suspend-modifier without breaking changes in future
Relates to #KT-23610