[NI] Transform anonymous types of expected type for delegation

This commit is contained in:
Mikhail Zarechenskiy
2017-08-21 00:26:00 +03:00
parent 1a05df204e
commit 9f2bf066b9
11 changed files with 130 additions and 13 deletions
@@ -0,0 +1,23 @@
// WITH_RUNTIME
val b: First by lazy {
object : First { }
}
private val withoutType by lazy {
object : First { }
}
private val withTwoSupertypes by lazy {
object : First, Second { }
}
interface First
interface Second
fun box(): String {
b
withoutType
withTwoSupertypes
return "OK"
}
@@ -0,0 +1,23 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
val b: First by lazy {
object : First { }
}
private val withoutType by lazy {
object : First { }
}
private val withTwoSupertypes by lazy {
object : First, Second { }
}
interface First
interface Second
fun <T> lazy(initializer: () -> T): Lazy<T> = TODO()
interface Lazy<out T> {
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()
}
@@ -0,0 +1,25 @@
package
public val b: First
private val withTwoSupertypes: withTwoSupertypes.<anonymous>.<no name provided>
private val withoutType: withoutType.<anonymous>.<no name provided>
public fun </*0*/ T> lazy(/*0*/ initializer: () -> T): Lazy<T>
public interface First {
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 interface Lazy</*0*/ out T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open operator fun getValue(/*0*/ thisRef: kotlin.Any?, /*1*/ property: kotlin.reflect.KProperty<*>): T
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface Second {
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
}