Files
kotlin-fork/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt
T
svtk 95ca2d8f98 Fixed bug with property and function name clash.
Complete type inference dependent on function literals and expected type
for variable as function calls not for 'invoke' calls
2013-11-25 19:42:07 +04:00

37 lines
652 B
Kotlin

package d
import java.util.ArrayList
fun box(): String {
ListTag().test(listOf("a", "b"))
return "OK"
}
fun ListTag.test(list: List<String>) {
for (item in list) {
item() {
a {
text = item
}
}
}
}
open class HtmlTag
open class ListTag : HtmlTag() {}
class LI : ListTag() {}
public fun ListTag.item(body: LI.() -> Unit): Unit {}
fun HtmlTag.a(contents: A.() -> Unit) {}
trait A : HtmlTag {
public var text: String
}
fun listOf(vararg strings: String): List<String> {
val list = ArrayList<String>()
for (s in strings) {
list.add(s)
}
return list
}