Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/inferInFunctionLiterals.kt
T
Svetlana Isakova a4bb47a73f 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
2012-07-20 19:34:55 +04:00

12 lines
278 B
Kotlin

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