Fix error type for implicit invoke with function literal argument
#KT-11401 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
class TestClass {
|
||||
companion object {
|
||||
inline operator fun <T> invoke(task: () -> T) = task()
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val test1 = TestClass { "K" }
|
||||
if (test1 != "K") return "fail1, 'test1' == $test1"
|
||||
|
||||
val ok = "OK"
|
||||
|
||||
val x = TestClass { return ok }
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
class TestClass {
|
||||
inline operator fun <T> invoke(task: () -> T) = task()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val test = TestClass()
|
||||
val ok = "OK"
|
||||
|
||||
val x = test { return ok }
|
||||
}
|
||||
Reference in New Issue
Block a user