Don't check suitability of a builder inference call if unrestricted builder inference is enabled

^KT-42139 Fixed
This commit is contained in:
Victor Petukhov
2021-06-03 13:15:41 +03:00
parent f8fbbc01b6
commit 19c07e048a
10 changed files with 81 additions and 13 deletions
@@ -40,7 +40,7 @@ fun <R> select(vararg x: R) = x[0]
fun poll0(): Flow<String> {
return flow {
val inv = select(::bar, ::foo)
inv()
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
}
}
@@ -54,7 +54,7 @@ fun poll01(): Flow<String> {
fun poll02(): Flow<String> {
return flow {
val inv = select(::bar3, ::foo3)
inv()
<!DEBUG_INFO_MISSING_UNRESOLVED!>inv()<!>
}
}
@@ -68,7 +68,7 @@ fun poll03(): Flow<String> {
fun poll04(): Flow<String> {
return flow {
val inv = select(::bar5, ::foo5)
inv
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>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<!>)
inv
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>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<!> }
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
inv
}
}
fun poll2(flag: Boolean): Flow<String> {
return flow {
val inv = when (flag) { true -> ::bar else -> ::foo }
inv()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>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 }
inv()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>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 }
inv()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>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 }
inv()
<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>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() }
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
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!>in<!> setOf(foo7())
<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>inv<!>
val inv = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>::<!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo7<!><!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>in<!> <!TYPE_INFERENCE_ONLY_INPUT_TYPES!>setOf<!>(<!TYPE_INFERENCE_ONLY_INPUT_TYPES!>foo7<!>())
<!TYPE_INFERENCE_ONLY_INPUT_TYPES!>inv<!>
}
}