KT-1406 wrong generation of receiver for ext.fun called inside closure

This commit is contained in:
Alex Tkachman
2012-02-24 16:24:16 +02:00
parent 17d34e9d49
commit 6146ec4268
4 changed files with 36 additions and 1 deletions
@@ -0,0 +1,26 @@
package pack
import java.util.Collection
import java.util.ArrayList
import java.util.regex.Pattern
class C{
public fun foo(){
val items : Collection<Item> = java.util.Collections.singleton(Item()).sure()
val result = ArrayList<Item>()
val pattern: Pattern? = Pattern.compile("...")
items.filterTo(result) {
pattern.sure().matcher(it.name()).sure().matches()
}
}
private fun Item.name() : String = ""
}
class Item{
}
fun box() : String {
C().foo()
return "OK"
}