[Commonizer] Add tests for overloading purely by different upper bounds

This commit is contained in:
Dmitriy Dolovov
2021-02-12 15:51:08 +03:00
parent 90cdb9203f
commit 0af31abb04
12 changed files with 359 additions and 0 deletions
@@ -0,0 +1,45 @@
expect interface I1
expect interface I2
expect interface I3<T>
expect fun <T : I1> functionWithValueParameter(value: T): Unit
expect fun <T : I2> functionWithValueParameter(value: T): Unit
expect fun <T : I3<String>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<in String>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<out String>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<Int>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<in Int>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<out Int>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<Any>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<in Any>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<out Any>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<Any?>> functionWithValueParameter(value: T): Unit
expect fun <T : I3<*>> functionWithValueParameter(value: T): Unit
expect fun <T : Any> functionWithValueParameter(value: T): Unit
expect fun <T> functionWithValueParameter(value: T): Unit
expect fun functionWithValueParameter(value: I1): Unit
expect fun functionWithValueParameter(value: I2): Unit
expect fun functionWithValueParameter(value: Any): Unit
expect fun functionWithValueParameter(value: Any?): Unit
expect fun functionWithValueParameter(): Unit
expect fun <T : I1> T.functionWithReceiver(): Unit
expect fun <T : I2> T.functionWithReceiver(): Unit
expect fun <T : I3<String>> T.functionWithReceiver(): Unit
expect fun <T : I3<in String>> T.functionWithReceiver(): Unit
expect fun <T : I3<out String>> T.functionWithReceiver(): Unit
expect fun <T : I3<Int>> T.functionWithReceiver(): Unit
expect fun <T : I3<in Int>> T.functionWithReceiver(): Unit
expect fun <T : I3<out Int>> T.functionWithReceiver(): Unit
expect fun <T : I3<Any>> T.functionWithReceiver(): Unit
expect fun <T : I3<in Any>> T.functionWithReceiver(): Unit
expect fun <T : I3<out Any>> T.functionWithReceiver(): Unit
expect fun <T : I3<Any?>> T.functionWithReceiver(): Unit
expect fun <T : I3<*>> T.functionWithReceiver(): Unit
expect fun <T : Any> T.functionWithReceiver(): Unit
expect fun <T> T.functionWithReceiver(): Unit
expect fun I1.functionWithReceiver(): Unit
expect fun I2.functionWithReceiver(): Unit
expect fun Any.functionWithReceiver(): Unit
expect fun Any?.functionWithReceiver(): Unit
expect fun functionWithReceiver(): Unit
@@ -0,0 +1,45 @@
actual interface I1
actual interface I2
actual interface I3<T>
actual fun <T : I1> functionWithValueParameter(value: T) = Unit
actual fun <T : I2> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Any?>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<*>> functionWithValueParameter(value: T) = Unit
actual fun <T : Any> functionWithValueParameter(value: T) = Unit
actual fun <T> functionWithValueParameter(value: T) = Unit
actual fun functionWithValueParameter(value: I1) = Unit
actual fun functionWithValueParameter(value: I2) = Unit
actual fun functionWithValueParameter(value: Any) = Unit
actual fun functionWithValueParameter(value: Any?) = Unit
actual fun functionWithValueParameter() = Unit
actual fun <T : I1> T.functionWithReceiver() = Unit
actual fun <T : I2> T.functionWithReceiver() = Unit
actual fun <T : I3<String>> T.functionWithReceiver() = Unit
actual fun <T : I3<in String>> T.functionWithReceiver() = Unit
actual fun <T : I3<out String>> T.functionWithReceiver() = Unit
actual fun <T : I3<Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<in Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<out Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<in Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<out Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<Any?>> T.functionWithReceiver() = Unit
actual fun <T : I3<*>> T.functionWithReceiver() = Unit
actual fun <T : Any> T.functionWithReceiver() = Unit
actual fun <T> T.functionWithReceiver() = Unit
actual fun I1.functionWithReceiver() = Unit
actual fun I2.functionWithReceiver() = Unit
actual fun Any.functionWithReceiver() = Unit
actual fun Any?.functionWithReceiver() = Unit
actual fun functionWithReceiver() = Unit
@@ -0,0 +1,45 @@
actual interface I1
actual interface I2
actual interface I3<T>
actual fun <T : I1> functionWithValueParameter(value: T) = Unit
actual fun <T : I2> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out String>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out Int>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<in Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<out Any>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<Any?>> functionWithValueParameter(value: T) = Unit
actual fun <T : I3<*>> functionWithValueParameter(value: T) = Unit
actual fun <T : Any> functionWithValueParameter(value: T) = Unit
actual fun <T> functionWithValueParameter(value: T) = Unit
actual fun functionWithValueParameter(value: I1) = Unit
actual fun functionWithValueParameter(value: I2) = Unit
actual fun functionWithValueParameter(value: Any) = Unit
actual fun functionWithValueParameter(value: Any?) = Unit
actual fun functionWithValueParameter() = Unit
actual fun <T : I1> T.functionWithReceiver() = Unit
actual fun <T : I2> T.functionWithReceiver() = Unit
actual fun <T : I3<String>> T.functionWithReceiver() = Unit
actual fun <T : I3<in String>> T.functionWithReceiver() = Unit
actual fun <T : I3<out String>> T.functionWithReceiver() = Unit
actual fun <T : I3<Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<in Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<out Int>> T.functionWithReceiver() = Unit
actual fun <T : I3<Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<in Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<out Any>> T.functionWithReceiver() = Unit
actual fun <T : I3<Any?>> T.functionWithReceiver() = Unit
actual fun <T : I3<*>> T.functionWithReceiver() = Unit
actual fun <T : Any> T.functionWithReceiver() = Unit
actual fun <T> T.functionWithReceiver() = Unit
actual fun I1.functionWithReceiver() = Unit
actual fun I2.functionWithReceiver() = Unit
actual fun Any.functionWithReceiver() = Unit
actual fun Any?.functionWithReceiver() = Unit
actual fun functionWithReceiver() = Unit
@@ -0,0 +1,45 @@
interface I1
interface I2
interface I3<T>
fun <T : I1> functionWithValueParameter(value: T) = Unit
fun <T : I2> functionWithValueParameter(value: T) = Unit
fun <T : I3<String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Any?>> functionWithValueParameter(value: T) = Unit
fun <T : I3<*>> functionWithValueParameter(value: T) = Unit
fun <T : Any> functionWithValueParameter(value: T) = Unit
fun <T> functionWithValueParameter(value: T) = Unit
fun functionWithValueParameter(value: I1) = Unit
fun functionWithValueParameter(value: I2) = Unit
fun functionWithValueParameter(value: Any) = Unit
fun functionWithValueParameter(value: Any?) = Unit
fun functionWithValueParameter() = Unit
fun <T : I1> T.functionWithReceiver() = Unit
fun <T : I2> T.functionWithReceiver() = Unit
fun <T : I3<String>> T.functionWithReceiver() = Unit
fun <T : I3<in String>> T.functionWithReceiver() = Unit
fun <T : I3<out String>> T.functionWithReceiver() = Unit
fun <T : I3<Int>> T.functionWithReceiver() = Unit
fun <T : I3<in Int>> T.functionWithReceiver() = Unit
fun <T : I3<out Int>> T.functionWithReceiver() = Unit
fun <T : I3<Any>> T.functionWithReceiver() = Unit
fun <T : I3<in Any>> T.functionWithReceiver() = Unit
fun <T : I3<out Any>> T.functionWithReceiver() = Unit
fun <T : I3<Any?>> T.functionWithReceiver() = Unit
fun <T : I3<*>> T.functionWithReceiver() = Unit
fun <T : Any> T.functionWithReceiver() = Unit
fun <T> T.functionWithReceiver() = Unit
fun I1.functionWithReceiver() = Unit
fun I2.functionWithReceiver() = Unit
fun Any.functionWithReceiver() = Unit
fun Any?.functionWithReceiver() = Unit
fun functionWithReceiver() = Unit
@@ -0,0 +1,45 @@
interface I1
interface I2
interface I3<T>
fun <T : I1> functionWithValueParameter(value: T) = Unit
fun <T : I2> functionWithValueParameter(value: T) = Unit
fun <T : I3<String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out String>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out Int>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<in Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<out Any>> functionWithValueParameter(value: T) = Unit
fun <T : I3<Any?>> functionWithValueParameter(value: T) = Unit
fun <T : I3<*>> functionWithValueParameter(value: T) = Unit
fun <T : Any> functionWithValueParameter(value: T) = Unit
fun <T> functionWithValueParameter(value: T) = Unit
fun functionWithValueParameter(value: I1) = Unit
fun functionWithValueParameter(value: I2) = Unit
fun functionWithValueParameter(value: Any) = Unit
fun functionWithValueParameter(value: Any?) = Unit
fun functionWithValueParameter() = Unit
fun <T : I1> T.functionWithReceiver() = Unit
fun <T : I2> T.functionWithReceiver() = Unit
fun <T : I3<String>> T.functionWithReceiver() = Unit
fun <T : I3<in String>> T.functionWithReceiver() = Unit
fun <T : I3<out String>> T.functionWithReceiver() = Unit
fun <T : I3<Int>> T.functionWithReceiver() = Unit
fun <T : I3<in Int>> T.functionWithReceiver() = Unit
fun <T : I3<out Int>> T.functionWithReceiver() = Unit
fun <T : I3<Any>> T.functionWithReceiver() = Unit
fun <T : I3<in Any>> T.functionWithReceiver() = Unit
fun <T : I3<out Any>> T.functionWithReceiver() = Unit
fun <T : I3<Any?>> T.functionWithReceiver() = Unit
fun <T : I3<*>> T.functionWithReceiver() = Unit
fun <T : Any> T.functionWithReceiver() = Unit
fun <T> T.functionWithReceiver() = Unit
fun I1.functionWithReceiver() = Unit
fun I2.functionWithReceiver() = Unit
fun Any.functionWithReceiver() = Unit
fun Any?.functionWithReceiver() = Unit
fun functionWithReceiver() = Unit
@@ -0,0 +1,26 @@
expect interface I1
expect interface I2
expect interface I3<T>
expect object Holder {
val <T : I1> T.propertyWithReceiver: Unit
val <T : I2> T.propertyWithReceiver: Unit
val <T : I3<String>> T.propertyWithReceiver: Unit
val <T : I3<in String>> T.propertyWithReceiver: Unit
val <T : I3<out String>> T.propertyWithReceiver: Unit
val <T : I3<Int>> T.propertyWithReceiver: Unit
val <T : I3<in Int>> T.propertyWithReceiver: Unit
val <T : I3<out Int>> T.propertyWithReceiver: Unit
val <T : I3<Any>> T.propertyWithReceiver: Unit
val <T : I3<in Any>> T.propertyWithReceiver: Unit
val <T : I3<out Any>> T.propertyWithReceiver: Unit
val <T : I3<Any?>> T.propertyWithReceiver: Unit
val <T : I3<*>> T.propertyWithReceiver: Unit
val <T : Any> T.propertyWithReceiver: Unit
val <T> T.propertyWithReceiver: Unit
val I1.propertyWithReceiver: Unit
val I2.propertyWithReceiver: Unit
val Any.propertyWithReceiver: Unit
val Any?.propertyWithReceiver: Unit
val propertyWithReceiver: Unit
}
@@ -0,0 +1,26 @@
actual interface I1
actual interface I2
actual interface I3<T>
actual object Holder {
actual val <T : I1> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I2> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Any?>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<*>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : Any> T.propertyWithReceiver: Unit get() = Unit
actual val <T> T.propertyWithReceiver: Unit get() = Unit
actual val I1.propertyWithReceiver: Unit get() = Unit
actual val I2.propertyWithReceiver: Unit get() = Unit
actual val Any.propertyWithReceiver: Unit get() = Unit
actual val Any?.propertyWithReceiver: Unit get() = Unit
actual val propertyWithReceiver: Unit get() = Unit
}
@@ -0,0 +1,26 @@
actual interface I1
actual interface I2
actual interface I3<T>
actual object Holder {
actual val <T : I1> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I2> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out String>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out Int>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<in Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<out Any>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<Any?>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : I3<*>> T.propertyWithReceiver: Unit get() = Unit
actual val <T : Any> T.propertyWithReceiver: Unit get() = Unit
actual val <T> T.propertyWithReceiver: Unit get() = Unit
actual val I1.propertyWithReceiver: Unit get() = Unit
actual val I2.propertyWithReceiver: Unit get() = Unit
actual val Any.propertyWithReceiver: Unit get() = Unit
actual val Any?.propertyWithReceiver: Unit get() = Unit
actual val propertyWithReceiver: Unit get() = Unit
}
@@ -0,0 +1,26 @@
interface I1
interface I2
interface I3<T>
object Holder {
val <T : I1> T.propertyWithReceiver: Unit get() = Unit
val <T : I2> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Any?>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<*>> T.propertyWithReceiver: Unit get() = Unit
val <T : Any> T.propertyWithReceiver: Unit get() = Unit
val <T> T.propertyWithReceiver: Unit get() = Unit
val I1.propertyWithReceiver: Unit get() = Unit
val I2.propertyWithReceiver: Unit get() = Unit
val Any.propertyWithReceiver: Unit get() = Unit
val Any?.propertyWithReceiver: Unit get() = Unit
val propertyWithReceiver: Unit get() = Unit
}
@@ -0,0 +1,26 @@
interface I1
interface I2
interface I3<T>
object Holder {
val <T : I1> T.propertyWithReceiver: Unit get() = Unit
val <T : I2> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out String>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out Int>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<in Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<out Any>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<Any?>> T.propertyWithReceiver: Unit get() = Unit
val <T : I3<*>> T.propertyWithReceiver: Unit get() = Unit
val <T : Any> T.propertyWithReceiver: Unit get() = Unit
val <T> T.propertyWithReceiver: Unit get() = Unit
val I1.propertyWithReceiver: Unit get() = Unit
val I2.propertyWithReceiver: Unit get() = Unit
val Any.propertyWithReceiver: Unit get() = Unit
val Any?.propertyWithReceiver: Unit get() = Unit
val propertyWithReceiver: Unit get() = Unit
}
@@ -17,4 +17,6 @@ class FunctionCommonizationFromSourcesTest : AbstractCommonizationFromSourcesTes
fun testSpecifics() = doTestSuccessfulCommonization()
fun testSignaturesWithNullableTypealiases() = doTestSuccessfulCommonization()
fun testOverloadingByUpperBounds() = doTestSuccessfulCommonization()
}
@@ -15,4 +15,6 @@ class PropertyCommonizationFromSourcesTest : AbstractCommonizationFromSourcesTes
fun testSetters() = doTestSuccessfulCommonization()
fun testLiftingUpConst() = doTestSuccessfulCommonization()
fun testOverloadingByUpperBounds() = doTestSuccessfulCommonization()
}