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:
Svetlana Isakova
2012-08-16 18:02:21 +04:00
parent fc858aec59
commit d2e33c8900
11 changed files with 245 additions and 9 deletions
@@ -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!>}<!>