[FIR] Hide local type for return type of single expression function ^KT-51418 Fixed

This commit is contained in:
Ivan Kochurkin
2022-04-06 17:48:38 +03:00
committed by teamcity
parent 0ecba0ad0b
commit 05bed8f751
10 changed files with 126 additions and 27 deletions
@@ -0,0 +1,30 @@
// FIR_IDENTICAL
// ISSUE: KT-51418
abstract class A<T>
private fun fPrivate() = test("private")
fun fPublic() = test("public")
private fun <T> test(t: T) = object : A<T>() {
fun bar(): T = t
}
fun main() {
fPrivate().bar()
fPublic().<!UNRESOLVED_REFERENCE!>bar<!>()
test(1).bar()
}
class FieldTest {
var result = ""
private val test = object {
fun bar() = object {
fun qux() = object {
}.also { result += "b" }
}.also { result += "a" }
}.also { result += "!" }
private val ttt = test.bar()
private val qqq = ttt.qux()
}
@@ -0,0 +1,25 @@
package
private fun fPrivate(): test.`<no name provided>`<kotlin.String>
public fun fPublic(): A<kotlin.String>
public fun main(): kotlin.Unit
private fun </*0*/ T> test(/*0*/ t: T): test.`<no name provided>`<T>
public abstract class A</*0*/ T> {
public constructor A</*0*/ T>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class FieldTest {
public constructor FieldTest()
private final val qqq: FieldTest.test.`<no name provided>`.bar.`<no name provided>`.qux.`<no name provided>`
public final var result: kotlin.String
private final val test: FieldTest.test.`<no name provided>`
private final val ttt: FieldTest.test.`<no name provided>`.bar.`<no name provided>`
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}