Fix error type for implicit invoke with function literal argument
#KT-11401 Fixed
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// !CHECK_TYPE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE
|
||||
|
||||
object TestClass {
|
||||
inline operator fun <T> invoke(task: () -> T) = task()
|
||||
}
|
||||
|
||||
fun test(s: String): String {
|
||||
val a = TestClass { TestClass { TestClass } }
|
||||
a checkType { _<TestClass>() }
|
||||
|
||||
<!UNREACHABLE_CODE!>val b =<!> TestClass { return s }
|
||||
<!UNREACHABLE_CODE!>b checkType { _<Nothing>() }<!>
|
||||
}
|
||||
Reference in New Issue
Block a user