Always complete calls not related to the builder inference
^KT-47830 Fixed
This commit is contained in:
committed by
teamcityserver
parent
dc8dbad0bc
commit
cf3bd016be
+1
-4
@@ -94,10 +94,7 @@ class BuilderInferenceSession(
|
||||
return subResolvedAtoms?.any { it.hasPostponed() } == true
|
||||
}
|
||||
|
||||
val isUnrestrictedBuilderInferenceSupported =
|
||||
callComponents.languageVersionSettings.supportsFeature(LanguageFeature.UnrestrictedBuilderInference)
|
||||
|
||||
if (!isUnrestrictedBuilderInferenceSupported && !candidate.isSuitableForBuilderInference()) {
|
||||
if (!candidate.isSuitableForBuilderInference()) {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ fun f1(): Sequence<List<Int>> = sequence {
|
||||
}
|
||||
|
||||
fun f2(): Sequence<List<Int>> = sequence {
|
||||
select(yield(myEmptyList()), yield(myEmptyList()))
|
||||
select(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>yield<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myEmptyList<!>()), yield(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myEmptyList<!>()))
|
||||
}
|
||||
|
||||
fun f3(): Sequence<List<Int>> = sequence {
|
||||
if (true) yield(myEmptyList()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
|
||||
else yield(myEmptyList()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
|
||||
if (true) <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>yield<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myEmptyList<!>()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
|
||||
else yield(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>myEmptyList<!>()) // [NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER] Not enough information to infer type variable T
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+14
-14
@@ -40,7 +40,7 @@ fun <R> select(vararg x: R) = x[0]
|
||||
fun poll0(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar, ::foo)
|
||||
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ fun poll01(): Flow<String> {
|
||||
fun poll02(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar3, ::foo3)
|
||||
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ fun poll03(): Flow<String> {
|
||||
fun poll04(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(::bar5, ::foo5)
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ fun poll05(): Flow<String> {
|
||||
fun poll06(): Flow<String> {
|
||||
return flow {
|
||||
val inv = select(foo7(), <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!>)
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
inv
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,14 +138,14 @@ fun poll16(flag: Boolean): Flow<String> {
|
||||
fun poll17(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = if (flag) { foo7() } else { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> }
|
||||
inv
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun poll2(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar else -> ::foo }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ fun poll21(flag: Boolean): Flow<String> {
|
||||
fun poll22(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 else -> ::foo3 }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ fun poll26(flag: Boolean): Flow<String> {
|
||||
fun poll3(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar false -> ::foo }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ fun poll31(flag: Boolean): Flow<String> {
|
||||
fun poll32(flag: Boolean): Flow<String> {
|
||||
return flow {
|
||||
val inv = when (flag) { true -> ::bar3 false -> ::foo3 }
|
||||
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>inv<!>()
|
||||
inv()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ fun poll55(): Flow<String> {
|
||||
fun poll56(): Flow<String> {
|
||||
return flow {
|
||||
val inv = try { <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::Foo7<!> } catch (e: Exception) { foo7() } finally { foo7() }
|
||||
inv
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ fun poll8(): Flow<String> {
|
||||
|
||||
fun poll81(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar2 <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> setOf(::foo2)
|
||||
val inv = ::bar2 <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(::foo2)
|
||||
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
|
||||
}
|
||||
}
|
||||
@@ -459,7 +459,7 @@ fun poll82(): Flow<String> {
|
||||
|
||||
fun poll83(): Flow<String> {
|
||||
return flow {
|
||||
val inv = ::bar4 <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> setOf(::foo4)
|
||||
val inv = ::bar4 <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(::foo4)
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
@@ -487,8 +487,8 @@ fun poll86(): Flow<String> {
|
||||
|
||||
fun poll87(): Flow<String> {
|
||||
return flow {
|
||||
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>in<!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>setOf<!>(<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>foo7<!>())
|
||||
<!TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR!>inv<!>
|
||||
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> setOf(foo7())
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ fun test_2() {
|
||||
fun test_3() {
|
||||
sequence {
|
||||
yield(materialize<Int>())
|
||||
<!TYPE_MISMATCH, TYPE_MISMATCH!>materialize()<!>
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materialize<!>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// ISSUE: KT-41308, KT-47830
|
||||
|
||||
fun main() {
|
||||
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>sequence<!> {
|
||||
sequence {
|
||||
val list: List<String>? = null
|
||||
val outputList = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.List<kotlin.String>")!>list ?: listOf()<!>
|
||||
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, NONE_APPLICABLE!>yieldAll<!>(outputList)
|
||||
yieldAll(outputList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ fun test_2(list: List<Set<A>>) {
|
||||
|
||||
fun test_3(list: List<Set<A>>) {
|
||||
sequence {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Type is unknown")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
yield(A())
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,6 @@ fun test_3(list: List<Set<A>>) {
|
||||
fun test_4(list: List<Set<A>>) {
|
||||
sequence {
|
||||
yield(A())
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>"), TYPE_MISMATCH, TYPE_MISMATCH!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user