default -> companion: replace all mentions of default and default object

This commit is contained in:
Pavel V. Talanov
2015-03-16 14:56:06 +03:00
parent a0783757e8
commit 06916d98c6
1019 changed files with 2468 additions and 2469 deletions
@@ -1,5 +1,5 @@
class C() {
default object {
companion object {
fun create() = C()
}
}
@@ -1,7 +1,7 @@
class C() {
fun getInstance(): Runnable = C
default object: Runnable {
companion object: Runnable {
override fun run(): Unit {
}
}
@@ -3,11 +3,11 @@ abstract open class Default {
}
class MyInt() {
default object : Default {
companion object : Default {
override fun defaultValue(): Int = 610
}
}
fun toDefault<T : Any>(t: T) where default object T : Default = T.defaultValue()
fun toDefault<T : Any>(t: T) where class object T : Default = T.defaultValue()
fun box(): String = if (toDefault<MyInt>(MyInt()) == 610) "OK" else "fail"