Don't recognize nullable function types as inlinable
#KT-19679 Fixed
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun build(func: () -> Unit, noinline pathFunc: (() -> String)? = null) {
|
||||
func()
|
||||
|
||||
pathFunc?.invoke()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
build({ result = "OK" })
|
||||
|
||||
return result
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
inline fun build(noinline pathFunc: (() -> String)? = null) {
|
||||
pathFunc?.invoke()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
build ()
|
||||
return "OK"
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
@Suppress("NULLABLE_INLINE_PARAMETER")
|
||||
inline fun build(func: () -> Unit, pathFunc: (() -> String)? = null) {
|
||||
func()
|
||||
|
||||
pathFunc?.invoke()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
build ({ result = "OK" })
|
||||
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user