FIR: Fix capturing of flexible types
This commit is contained in:
@@ -6,6 +6,6 @@ import java.util.stream.IntStream
|
||||
|
||||
fun main() {
|
||||
val xs = IntStream.range(0, 10).mapToObj { it.toString() }
|
||||
.<!INAPPLICABLE_CANDIDATE!>collect<!>(Collectors.toList())
|
||||
.collect(Collectors.toList())
|
||||
<!UNRESOLVED_REFERENCE!>xs[0]<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import java.util.stream.Collectors
|
||||
import java.util.stream.Stream
|
||||
|
||||
fun test(a: Stream<String>) {
|
||||
a.<!INAPPLICABLE_CANDIDATE!>collect<!>(Collectors.toList()) <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><MutableList<String>>() }
|
||||
a.collect(Collectors.toList()) checkType { <!UNRESOLVED_REFERENCE!>_<!><MutableList<String>>() }
|
||||
// actually the inferred type is platform
|
||||
a.<!INAPPLICABLE_CANDIDATE!>collect<!>(Collectors.toList()) <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><List<String?>>() }
|
||||
a.collect(Collectors.toList()) checkType { <!UNRESOLVED_REFERENCE!>_<!><List<String?>>() }
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ interface A : Collection<String> {
|
||||
}
|
||||
|
||||
fun foo(x: List<String>, y: A) {
|
||||
x.stream().filter { it.length > 0 }.<!INAPPLICABLE_CANDIDATE!>collect<!>(Collectors.toList())
|
||||
x.stream().filter { it.length > 0 }.collect(Collectors.toList())
|
||||
y.stream().filter { it.length > 0 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user