Allow generic type parameter to have mixed constraints for @InlineOnly functions
#KT-19323 Fixed
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
|
||||
@<!INVISIBLE_MEMBER!>kotlin.internal.<!INVISIBLE_REFERENCE!>InlineOnly<!><!>
|
||||
public inline fun <C, R> C.ifEmpty(f: () -> R): R where C : Collection<*>, C : R = if (isEmpty()) f() else this
|
||||
|
||||
public fun <T> listOf(<!UNUSED_PARAMETER!>t<!>: T): List<T> = TODO()
|
||||
|
||||
|
||||
fun usage(c: List<String>) {
|
||||
val cn = c.ifEmpty { null }
|
||||
cn checkType { _<List<String>?>() }
|
||||
|
||||
val cs = c.ifEmpty { listOf("x") }
|
||||
cs checkType { _<List<String>>() }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> listOf(/*0*/ t: T): kotlin.collections.List<T>
|
||||
public fun usage(/*0*/ c: kotlin.collections.List<kotlin.String>): kotlin.Unit
|
||||
@kotlin.internal.InlineOnly public inline fun </*0*/ C : kotlin.collections.Collection<*>, /*1*/ R> C.ifEmpty(/*0*/ f: () -> R): R where C : R
|
||||
Reference in New Issue
Block a user