Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/possibleCycleOnConstraints.kt
T
Svetlana Isakova db91928984 test fixes after refactorings
expected return type for function literal cannot depend on expected type of outer function
2013-02-08 15:10:43 +04:00

13 lines
508 B
Kotlin

package a
import java.util.*
fun g<T> (<!UNUSED_PARAMETER!>f<!>: () -> List<T>) : T {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun test() {
//here possibly can be a cycle on constraints
val <!UNUSED_VARIABLE!>x<!> = g { Collections.<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>() }
val <!UNUSED_VARIABLE!>y<!> = g<Int> { Collections.emptyList() }
val <!UNUSED_VARIABLE!>z<!> : List<Int> = g { Collections.<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>() }
}