type inference with functional literal params changed
if there are function literals without declared parameter types, try adding constraint with current substituted result first (known type parameters), if there is error, try adding constraint with 'dont_care' substitution
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package n
|
||||
|
||||
//+JDK
|
||||
import java.util.*
|
||||
|
||||
fun expected<T>(t: T, <!UNUSED_PARAMETER!>f<!>: () -> T) : T = t
|
||||
|
||||
fun test(arrayList: ArrayList<Int>, list: List<Int>) {
|
||||
val <!UNUSED_VARIABLE!>t<!> = expected(arrayList, { list.reverse() })
|
||||
}
|
||||
|
||||
fun <T> List<T>.reverse() : List<T> = this
|
||||
Reference in New Issue
Block a user