tests for obsolete/fixed issues
#KT-1038 fixed #KT-1127 fixed #KT-1145 fixed #KT-1410 fixed #KT-1718 fixed #KT-2286 fixed #KT-1431 fixed #KT-2394 fixed
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// KT-1410 Compiler does automatically infer type argument when using variance
|
||||
//+JDK
|
||||
package d
|
||||
|
||||
import java.util.Collection
|
||||
import java.util.List
|
||||
|
||||
public fun <T> Collection<out T>.filterToMy(result : List<in T>, filter : (T) -> Boolean) : Collection<out T> {
|
||||
for (t in this){
|
||||
if (filter(t)){
|
||||
result.add(t)
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
fun foo(result: List<in String>, val collection: Collection<String>, prefix : String){
|
||||
collection.filterToMy(result, {it.startsWith(prefix)})
|
||||
}
|
||||
|
||||
fun test(result: List<in Any>, val collection: Collection<String>, prefix : String){
|
||||
val c = collection.filterToMy(result, {it.startsWith(prefix)})
|
||||
c: Collection<out String>
|
||||
}
|
||||
|
||||
//from library
|
||||
fun String.startsWith(<!UNUSED_PARAMETER!>prefix<!>: String) : Boolean {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
Reference in New Issue
Block a user