Switch tests for default lambda inlining on language level 1.2
This commit is contained in:
Vendored
+1
-1
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(crossinline inlineLambda: () -> String = { "OK" }, noinline noInlineLambda: () -> String = { inlineLambda() }): String {
|
||||
return noInlineLambda()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
fun ok() = "OK"
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(lambda: () -> String = ::ok): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -1,4 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@@ -8,8 +9,6 @@ class A(val value: String) {
|
||||
fun ok() = value
|
||||
}
|
||||
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(a: A, lambda: (A) -> String = A::ok): String {
|
||||
return lambda(a)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
class A(val value: String) {
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(lambda: () -> String = { value }): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@@ -10,7 +11,6 @@ interface A {
|
||||
|
||||
fun test() = inlineFun()
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
private inline fun inlineFun(lambda: () -> String = { value }): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,11 +1,11 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
//WITH_RUNTIME
|
||||
package test
|
||||
|
||||
object X {
|
||||
@JvmStatic
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(capturedParam: String, lambda: () -> String = { capturedParam }): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(crossinline inlineLambda: () -> String, noinline noInlineLambda: () -> String = { inlineLambda() }): String {
|
||||
return noInlineLambda()
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(capturedParam: String, lambda: () -> String = { capturedParam }): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(capturedParam: String, lambda: () -> Any = { capturedParam as Any }): Any {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(lambda: () -> Any = { "OK" as Any }): Any {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@@ -6,7 +7,6 @@ open class A(val value: String)
|
||||
|
||||
class B(value: String): A(value)
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun <T : A> inlineFun(capturedParam: T, lambda: () -> T = { capturedParam }): T {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,8 +1,8 @@
|
||||
// FILE: 1.kt
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
package test
|
||||
|
||||
@Suppress("NOT_YET_SUPPORTED_IN_INLINE")
|
||||
inline fun inlineFun(lambda: () -> String = { "OK" }): String {
|
||||
return lambda()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user