[FIR] Implement new completion mode calculator

Note that `testDelegates` now fails due to KT-37638 and
    `testSimpleIn` fails due to problems with type parameters
    of inner classes
This commit is contained in:
Dmitriy Novozhilov
2020-03-20 15:20:09 +03:00
parent ea02855ba6
commit 5f9f01fe4e
14 changed files with 340 additions and 111 deletions
@@ -0,0 +1,2 @@
Failures detected in FirBodyResolveTransformerAdapter, file: /simpleIn.fir.kt
Cause: java.lang.RuntimeException: While resolving call R|<local>/outer|.set#(R?C|/infer|<R|kotlin/Any|>(String()))
@@ -1,30 +0,0 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
interface I {
fun foo()
}
data class Pair<X, Y>(val fst: X, val snd: Y)
class A(f: Pair<Int, (I) -> Unit>? = null)
class B(f: ((I) -> Unit)? = null)
fun main() {
val cond = true
A(
if (cond) {
Pair(1, { baz -> baz.<!UNRESOLVED_REFERENCE!>foo<!>() })
} else {
null
}
)
<!INAPPLICABLE_CANDIDATE!>B<!>(
if (cond) {
{ baz -> baz.<!UNRESOLVED_REFERENCE!>foo<!>() }
} else {
null
}
)
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE