NI: take into account an extension function annotation during CST calculation
This commit is contained in:
+24
-2
@@ -1,8 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER -CAST_NEVER_SUCCEEDS
|
||||
// ISSUE: KT-36819
|
||||
|
||||
// Case 1
|
||||
|
||||
fun <K> select(vararg x: K) = x[0]
|
||||
interface A
|
||||
class B: A
|
||||
@@ -18,8 +19,29 @@ fun main() {
|
||||
val x3 = select(id1(Out(B())), id2(Out(C())))
|
||||
}
|
||||
|
||||
// Case 2
|
||||
|
||||
fun <R> fold(initial: R, operation: (R) -> Unit) {}
|
||||
|
||||
fun foo() {
|
||||
fold({ x: Int -> x }) { acc -> }
|
||||
}
|
||||
|
||||
// Case 3
|
||||
|
||||
class Foo
|
||||
|
||||
typealias X = Foo.(Foo.() -> Unit) -> Unit
|
||||
|
||||
fun bar() {
|
||||
val y = when {
|
||||
false -> { _ ->
|
||||
Unit
|
||||
}
|
||||
true -> null as X
|
||||
else -> { x ->
|
||||
x()
|
||||
Unit
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user