Redundant/conflicting projections
This commit is contained in:
@@ -36,8 +36,8 @@ fun test1() {
|
||||
|
||||
val i = both(1, "")
|
||||
val j = both(id(1), id(""))
|
||||
i : Comparable<out Any?>
|
||||
j : Comparable<out Any?>
|
||||
i : Comparable<*>
|
||||
j : Comparable<*>
|
||||
}
|
||||
|
||||
fun list<T>(value: T) : ArrayList<T> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//+JDK
|
||||
package d
|
||||
|
||||
public fun <T> Collection<out T>.filterToMy(result : MutableList<in T>, filter : (T) -> Boolean) : Collection<out T> {
|
||||
public fun <T> MutableCollection<out T>.filterToMy(result : MutableList<in T>, filter : (T) -> Boolean) : MutableCollection<out T> {
|
||||
for (t in this){
|
||||
if (filter(t)){
|
||||
result.add(t)
|
||||
@@ -11,13 +11,13 @@ public fun <T> Collection<out T>.filterToMy(result : MutableList<in T>, filter :
|
||||
return this
|
||||
}
|
||||
|
||||
fun foo(result: MutableList<in String>, val collection: Collection<String>, prefix : String){
|
||||
fun foo(result: MutableList<in String>, val collection: MutableCollection<String>, prefix : String){
|
||||
collection.filterToMy(result, {it.startsWith(prefix)})
|
||||
}
|
||||
|
||||
fun test(result: MutableList<in Any>, val collection: Collection<String>, prefix : String){
|
||||
fun test(result: MutableList<in Any>, val collection: MutableCollection<String>, prefix : String){
|
||||
val c = collection.filterToMy(result, {it.startsWith(prefix)})
|
||||
c: Collection<out String>
|
||||
c: MutableCollection<out String>
|
||||
}
|
||||
|
||||
//from library
|
||||
|
||||
Reference in New Issue
Block a user