dd264cff50
In this commit we have a lot of change in test data. This was caused by the way where we evaluate constants. We split constant evaluation into two distinct parts: only necessary evaluations for `fir2ir` (like const val and annotations) and optimizations for lowering. Now we don't do all constant evaluation on `fir2ir`, but IR dump is executed after this phase, so test data changed. #KT-58923
78 lines
1.4 KiB
Kotlin
Vendored
78 lines
1.4 KiB
Kotlin
Vendored
typealias Some = Function1<Any, String?>
|
|
object Factory {
|
|
private constructor() /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
fun foo(a: String): String {
|
|
return "Alpha"
|
|
}
|
|
|
|
fun foo(a: String, f: Function1<Any, String?>): String {
|
|
return "Omega"
|
|
}
|
|
|
|
}
|
|
|
|
interface Base {
|
|
|
|
}
|
|
|
|
interface Delegate : Base {
|
|
abstract fun bar()
|
|
|
|
}
|
|
|
|
interface Derived : Delegate {
|
|
|
|
}
|
|
|
|
data class DataClass : Derived, Delegate {
|
|
constructor(delegate: Delegate) /* primary */ {
|
|
super/*Any*/()
|
|
/* <init>() */
|
|
|
|
}
|
|
|
|
override fun bar() {
|
|
<this>.#delegate.bar()
|
|
}
|
|
|
|
val delegate: Delegate
|
|
field = delegate
|
|
get
|
|
|
|
operator fun component1(): Delegate {
|
|
return <this>.#delegate
|
|
}
|
|
|
|
fun copy(delegate: Delegate = <this>.#delegate): DataClass {
|
|
return DataClass(delegate = delegate)
|
|
}
|
|
|
|
override operator fun equals(other: Any?): Boolean {
|
|
when {
|
|
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
|
|
}
|
|
when {
|
|
other !is DataClass -> return false
|
|
}
|
|
val tmp0_other_with_cast: DataClass = other as DataClass
|
|
when {
|
|
EQEQ(arg0 = <this>.#delegate, arg1 = tmp0_other_with_cast.#delegate).not() -> return false
|
|
}
|
|
return true
|
|
}
|
|
|
|
override fun hashCode(): Int {
|
|
return <this>.#delegate.hashCode()
|
|
}
|
|
|
|
override fun toString(): String {
|
|
return "DataClass(" + "delegate=" + <this>.#delegate + ")"
|
|
}
|
|
|
|
}
|