fun useWorkshop(workshop: Workshop) {
val event = workshop.makeEvent(date)
val permalink = workshop.permalink
val makeEventRef = Workshop::makeEvent
val permalinkPropRef = Workshop::permalink
}
open class C
class D: C()
fun C.foo() = "c"
fun D.foo() = "d"
fun main() {
val d = D()
print(d.foo()) // d
val c: C = d
print(c.foo()) // c
print(D().foo()) // d
print((D() as C).foo()) // c
}
fun foo(`this$receiver`: C) = "c"
fun foo(`this$receiver`: D) = "d"
fun main() {
val d = D()
print(foo(d)) // d
val c: C =d
print(foo(c)) // c
print(foo(D())) // d
print(foo(D() as C)) // c
}
inline fun CharSequence?.isNullOrBlank(): Boolean {
contract {
returns(false) implies (this@isNullOrBlank != null)
}
return this == null || this.isBlank()
}
public fun Iterable<Int>.sum(): Int {
var sum: Int = 0
for (element in this) {
sum += element
}
return sum
}