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
@@ -4,7 +4,7 @@ package foo
import kotlin.reflect.KMemberProperty
class A {
default object {
companion object {
val ref: KMemberProperty<A, String> = A::foo
}
@@ -3,7 +3,7 @@
package foo
class Foo() {
default object {
companion object {
val bar = "Foo.bar ";
var boo = "FAIL";
fun baz() = "Foo.baz() "
@@ -4,7 +4,7 @@ class A {
private val p: Int
get() = 4
default object B {
companion object B {
val p: Int
get() = 6
}
@@ -1,7 +1,7 @@
package foo
trait A {
default object {
companion object {
val OK: String = "OK"
}
}
@@ -1,13 +1,13 @@
package foo
trait Named {
default object Bar {
companion object Bar {
val g = "a";
}
}
class Foo {
default object {
companion object {
val g = "b";
}
}
@@ -16,11 +16,11 @@ fun box(): String {
assertEquals("a", Named.Bar.g, "Named.Bar.g")
assertEquals("a", Named.g, "Named.g")
assertEquals("b", Foo.Default.g, "Foo.Default.g")
assertEquals("b", Foo.Companion.g, "Foo.Companion.g")
assertEquals("b", Foo.g, "Foo.g")
assertEquals("b", foo(Foo), "foo(Foo)")
assertEquals("b", foo(Foo.Default), "foo(Foo.Default)")
assertEquals("b", foo(Foo.Companion), "foo(Foo.Companion)")
assertEquals("c", Named.ext(), "Named.ext()")
assertEquals("c", Named.Bar.ext(), "Named.Bar.ext()")
@@ -28,6 +28,6 @@ fun box(): String {
return "OK"
}
fun foo(f: Foo.Default) = f.g
fun foo(f: Foo.Companion) = f.g
fun Named.Bar.ext() = "c"
@@ -2,7 +2,7 @@ package foo
class A {
var a = 3
default object {
companion object {
var a = -2
}
}
@@ -2,7 +2,7 @@ package foo
class A {
val a = 3
default object {
companion object {
val a = 2
val b = 5
}
@@ -5,13 +5,13 @@ open class A {
fun foo(): Int {
return 5
}
default object: A() {
companion object: A() {
val c = a
}
}
class B {
default object: A() {
companion object: A() {
}
}
@@ -8,7 +8,7 @@ object A {
}
class B {
default object {
companion object {
val a = 21
fun foo() = 3
@@ -2,7 +2,7 @@ package foo
class A {
fun foo() = "O"
default object {
companion object {
fun bar() = "K"
}
@@ -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"
@@ -15,7 +15,7 @@ class InlineAll {
return s()
}
default object {
companion object {
inline fun inline(s: () -> String): String {
return s()
}
@@ -11,7 +11,7 @@ trait InlineTrait {
return s()
}
default object {
companion object {
inline final fun finalInline(s: () -> String): String {
return s()
}
@@ -7,7 +7,7 @@ fun f(x: Int): Int = x * 2
fun Int.f(): Int = this * 3
class A(var value: Int) {
default object {
companion object {
fun f(): Int = 5
}
@@ -3,7 +3,7 @@ package foo
native
class A(val c: Int) {
native
default object {
companion object {
val g: Int = noImpl
val c: String = noImpl
}
@@ -97,7 +97,7 @@ object Object {
var b: String = noImpl
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -109,7 +109,7 @@ object Object {
var b: String = noImpl
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -121,7 +121,7 @@ object Object {
var b: String
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -145,7 +145,7 @@ class Class {
var b: String = noImpl
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -162,14 +162,14 @@ class Class {
var b: String
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
}
}
default object {
companion object {
native("aaa")
val a: Trait = noImpl
var b: String = noImpl
@@ -190,7 +190,7 @@ trait Trait {
var b: String = noImpl
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -203,14 +203,14 @@ trait Trait {
var b: String
fun test(): Int = noImpl
default object {
companion object {
val a: String = noImpl
var b: String = noImpl
fun test(): Int = noImpl
}
}
default object {
companion object {
val a: Trait = noImpl
var b: String = noImpl
fun test(): Int = noImpl
@@ -24,7 +24,7 @@ fun Bar.test2(order: Int, dummy: Int, vararg args: Int): Boolean = noImpl
native
class Bar(val size: Int, order: Int = 0) {
fun test(order: Int, dummy: Int, vararg args: Int): Boolean = noImpl
default object {
companion object {
fun startNewTest(): Boolean = noImpl
var hasOrderProblem: Boolean = false
}
@@ -14,7 +14,7 @@ object B {
}
class C {
default object {
companion object {
fun ov() = "d"
}
object query {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun enum() { enum() }
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun eval() { eval() }
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun `for`() { `for`() }
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun `if`() { `if`() }
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun foo(export: String) {
assertEquals("123", export)
testRenamed("export", { export })
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun foo(extends: String) {
assertEquals("123", extends)
testRenamed("extends", { extends })
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun foo(`in`: String) {
assertEquals("123", `in`)
testRenamed("in", { `in` })
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
fun foo(`null`: String) {
assertEquals("123", `null`)
testRenamed("null", { `null` })
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val t: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val t: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val t: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val t: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val const: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val `continue`: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val debugger: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
val `do`: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
var default: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
var delete: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
var `else`: Int = 0
fun test() {
@@ -3,7 +3,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class TestClass {
default object {
companion object {
var `false`: Int = 0
fun test() {
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class delete { default object {} }
class delete { companion object {} }
fun box(): String {
testNotRenamed("delete", { delete })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class enum { default object {} }
class enum { companion object {} }
fun box(): String {
testNotRenamed("enum", { enum })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class `package` { default object {} }
class `package` { companion object {} }
fun box(): String {
testNotRenamed("package", { `package` })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
class `return` { default object {} }
class `return` { companion object {} }
fun box(): String {
testNotRenamed("return", { `return` })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
trait eval { default object {} }
trait eval { companion object {} }
fun box(): String {
testNotRenamed("eval", { eval })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
trait export { default object {} }
trait export { companion object {} }
fun box(): String {
testNotRenamed("export", { export })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
trait `super` { default object {} }
trait `super` { companion object {} }
fun box(): String {
testNotRenamed("super", { `super` })
@@ -2,7 +2,7 @@ package foo
// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT!
trait `this` { default object {} }
trait `this` { companion object {} }
fun box(): String {
testNotRenamed("this", { `this` })