Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/regressions/kt2741.kt
T
Mikhail Glukhikh 7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00

12 lines
461 B
Kotlin
Vendored

//KT-2741 Compiler can't infer a type of a function literal parameter when its body contains errors
package a
fun <T, R: Comparable<R>> Iterable<T>._sortBy(<!UNUSED_PARAMETER!>f<!>: (T) -> R): List<T> = throw Exception()
fun <T> _arrayList(vararg <!UNUSED_PARAMETER!>values<!>: T) : List<T> = throw Exception()
class _Pair<A>(val a: A)
fun test() {
_arrayList(_Pair(1))._sortBy { <!UNUSED_ANONYMOUS_PARAMETER!>it<!> -> <!UNRESOLVED_REFERENCE!>xxx<!> }
}