[NI] Properly detecting suitability of candidate for builder inference
#KT-41430 Fixed
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// ISSUE: KT-41430
|
||||
|
||||
class A
|
||||
|
||||
fun test_1(list: List<Set<A>>) {
|
||||
list.<!AMBIGUITY!>flatMapTo<!>(mutableSetOf()) { <!UNRESOLVED_REFERENCE!>it<!> }
|
||||
}
|
||||
|
||||
fun test_2(list: List<Set<A>>) {
|
||||
sequence<A> {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ERROR CLASS: Ambiguity: flatMapTo, [kotlin/collections/flatMapTo, kotlin/collections/flatMapTo]")!>list.<!AMBIGUITY!>flatMapTo<!>(mutableSetOf()) { <!UNRESOLVED_REFERENCE!>it<!> }<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun test_3(list: List<Set<A>>) {
|
||||
sequence {
|
||||
list.<!AMBIGUITY!>flatMapTo<!>(mutableSetOf()) { <!UNRESOLVED_REFERENCE!>it<!> }
|
||||
yield(A())
|
||||
}
|
||||
}
|
||||
|
||||
fun test_4(list: List<Set<A>>) {
|
||||
sequence {
|
||||
yield(A())
|
||||
list.<!AMBIGUITY!>flatMapTo<!>(mutableSetOf()) { <!UNRESOLVED_REFERENCE!>it<!> }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// ISSUE: KT-41430
|
||||
|
||||
class A
|
||||
|
||||
fun test_1(list: List<Set<A>>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
}
|
||||
|
||||
fun test_2(list: List<Set<A>>) {
|
||||
sequence<A> {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
}
|
||||
}
|
||||
|
||||
fun test_3(list: List<Set<A>>) {
|
||||
sequence {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
yield(A())
|
||||
}
|
||||
}
|
||||
|
||||
fun test_4(list: List<Set<A>>) {
|
||||
sequence {
|
||||
yield(A())
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableSet<A>")!>list.flatMapTo(mutableSetOf()) { it }<!>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun test_1(/*0*/ list: kotlin.collections.List<kotlin.collections.Set<A>>): kotlin.Unit
|
||||
public fun test_2(/*0*/ list: kotlin.collections.List<kotlin.collections.Set<A>>): kotlin.Unit
|
||||
public fun test_3(/*0*/ list: kotlin.collections.List<kotlin.collections.Set<A>>): kotlin.Unit
|
||||
public fun test_4(/*0*/ list: kotlin.collections.List<kotlin.collections.Set<A>>): kotlin.Unit
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user