55a58e54fe
The only case when behavior is change is described at computeNonTrivialTypeArgumentForScopeSubstitutor The idea is to avoid depending on the presence of @UnsafeVariance and instead approximate captured types in covariant argument positions before building substitution scopes It's correct because for Captured(*) <: Supertype, Out<Captured(*)> <: Out<Supertype> and when we've got @UnsafeVariance value parameters at Out, it's ok to allow passing Supertype there. ^KT-57602 Fixed ^KT-54894 Fixed
45 lines
1.7 KiB
Plaintext
Vendored
45 lines
1.7 KiB
Plaintext
Vendored
FILE: complex.kt
|
|
public abstract interface AutoCloseable : R|kotlin/Any| {
|
|
public abstract fun close(): R|kotlin/Unit|
|
|
|
|
}
|
|
internal final fun R|AutoCloseable?|.closeFinally(cause: R|kotlin/Throwable?|): R|kotlin/Unit| {
|
|
^closeFinally when () {
|
|
==(this@R|/closeFinally|, Null(null)) -> {
|
|
}
|
|
==(R|<local>/cause|, Null(null)) -> {
|
|
this@R|/closeFinally|.R|/AutoCloseable.close|()
|
|
}
|
|
else -> {
|
|
try {
|
|
this@R|/closeFinally|.R|/AutoCloseable.close|()
|
|
}
|
|
catch (closeException: R|kotlin/Throwable|) {
|
|
R|<local>/cause|.R|kotlin/Throwable.addSuppressed|(R|<local>/closeException|)
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
public final inline fun <reified T : R|kotlin/Any|> R|kotlin/collections/List<*>|.firstIsInstanceOrNull(): R|T?| {
|
|
{
|
|
lval <iterator>: R|kotlin/collections/Iterator<kotlin/Any?>| = this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Any?>|>|()
|
|
while(R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.hasNext: R|kotlin/Boolean|>|()) {
|
|
lval element: R|kotlin/Any?| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Any?|>|()
|
|
{
|
|
when () {
|
|
(R|<local>/element| is R|T|) -> {
|
|
^firstIsInstanceOrNull R|<local>/element|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
^firstIsInstanceOrNull Null(null)
|
|
}
|