[FIR] Restore variable fixation direction in call completion
Several tests are affected by the usage of fixation direction calculator in FIR. Restored to mimimize test data changes. It is unnecessary in FE10 because a type variable with unknown type is inferred into an error type, but affects test data in FIR where Nothing/Any is selected by direction (as a temporary measure). CR candidate in spec test is Unresolved in FIR because top-level CRs are resolved as call arguments. Resolution ambiguity is also present in FE10 when CR is wrapped into an id call.
This commit is contained in:
+2
-2
@@ -19,6 +19,6 @@ fun testFunctions() {
|
||||
|
||||
fun testNestedCalls() {
|
||||
id<String>(inferFromLambda { materialize() })
|
||||
<!INAPPLICABLE_CANDIDATE!>id<!><String>(inferFromLambda(fun() = materialize()))
|
||||
<!INAPPLICABLE_CANDIDATE!>id<!><String>(inferFromLambda2(fun() = materialize()))
|
||||
id<String>(inferFromLambda(fun() = materialize()))
|
||||
id<String>(inferFromLambda2(fun() = materialize()))
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,8 +7,7 @@ fun <T> foo() = foo() as T
|
||||
|
||||
fun <T> foo2(): T = TODO()
|
||||
|
||||
// TODO: "not enough information" should be reported on foo2() instead
|
||||
val test = foo2().<!UNRESOLVED_REFERENCE!>plus<!>("") as String
|
||||
val test = foo2().plus("") as String
|
||||
|
||||
fun <T> T.bar() = this
|
||||
val barTest = "".bar() as Number
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
@UseExperimental(ExperimentalTypeInference::class)
|
||||
fun <R> combined(
|
||||
check: () -> Unit,
|
||||
@BuilderInference block: TestInterface<R>.() -> Unit
|
||||
): R = TODO()
|
||||
|
||||
interface TestInterface<R> {
|
||||
fun emit(r: R)
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val ret = combined({ }) {
|
||||
<!INAPPLICABLE_CANDIDATE!>emit<!>(1)
|
||||
}
|
||||
}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATION -EXPERIMENTAL_IS_NOT_ENABLED -UNUSED_VARIABLE
|
||||
// WITH_RUNTIME
|
||||
|
||||
|
||||
Reference in New Issue
Block a user