KT-2841 Can't infer a type for function literal parameter if the return type is error
#KT-2841 fixed
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package a
|
||||
|
||||
trait Closeable {
|
||||
fun close() {}
|
||||
}
|
||||
|
||||
class C : Closeable
|
||||
|
||||
public inline fun <T: Closeable, R> T.use(block: (t: T)-> R) : R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
C().<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use<!> {
|
||||
it.close()
|
||||
<!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user