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,15 @@
|
||||
package a
|
||||
|
||||
trait Closeable {}
|
||||
class C : Closeable {}
|
||||
|
||||
public inline fun <T: Closeable, R> T.use1(block: (T)-> R) : R {
|
||||
return block(this)
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
C().<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>use1<!> {
|
||||
w -> // ERROR here
|
||||
<!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user