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
+3 -3
View File
@@ -30,7 +30,7 @@ import java.util.*
}
class HTML() : TagWithText("html") {
default object : Factory<HTML> {
companion object : Factory<HTML> {
override fun create() = HTML()
}
@@ -40,7 +40,7 @@ import java.util.*
}
class Head() : TagWithText("head") {
default object : Factory<Head> {
companion object : Factory<Head> {
override fun create() = Head()
}
@@ -53,7 +53,7 @@ import java.util.*
}
class Body() : BodyTag("body") {
default object : Factory<Body> {
companion object : Factory<Body> {
override fun create() = Body()
}
+1 -1
View File
@@ -1,7 +1,7 @@
enum class E {
ENTRY
default object {
companion object {
fun foo(): E = ENTRY
fun bar(): Array<E> = values()
fun baz(): E = valueOf("ENTRY")
+3 -3
View File
@@ -1,10 +1,10 @@
package Jet86
class A {
default object {
companion object {
val x = 1
}
<error descr="[MANY_DEFAULT_OBJECTS] Only one default object is allowed per class">default</error> object Another { // error
<error descr="[MANY_COMPANION_OBJECTS] Only one companion object is allowed per class">companion</error> object Another { // error
val x = 1
}
}
@@ -14,7 +14,7 @@ class B() {
}
object b {
<error descr="[DEFAULT_OBJECT_NOT_ALLOWED] A default object is not allowed here">default</error> object {
<error descr="[COMPANION_OBJECT_NOT_ALLOWED] A companion object is not allowed here">companion</error> object {
val x = 1
}
// error
@@ -11,7 +11,7 @@ class B {
}
class C {
default <warning textAttributesKey="DEPRECATED_ATTRIBUTES">class object G</warning> {
companion <warning textAttributesKey="DEPRECATED_ATTRIBUTES">class object G</warning> {
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ trait B {
class C() : A(), B
class D() {
default object : A(), B {}
companion object : A(), B {}
}
class Test1<T : A>()
@@ -3,7 +3,7 @@ import kotlin.platform.platformStatic
platformStatic
class <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">A</error> {
platformStatic
default <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">object</error> {
companion <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">object</error> {
platformStatic fun a1() {
}
@@ -18,21 +18,21 @@ class <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not su
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and default objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
}
}
}
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and default objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
}
}
platformStatic
trait <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not support 'platformStatic'">B</error> {
default object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and default objects of classes can be annotated with 'platformStatic'">platformStatic fun a1()</error> {
companion object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a1()</error> {
}
}
@@ -45,13 +45,13 @@ trait <error descr="[PLATFORM_STATIC_ILLEGAL_USAGE] This declaration does not su
fun test() {
val <warning descr="[UNUSED_VARIABLE] Variable 's' is never used">s</warning> = object {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and default objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a3()</error> {
}
}
}
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and default objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
<error descr="[PLATFORM_STATIC_NOT_IN_OBJECT] Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'">platformStatic fun a4()</error> {
}
}
@@ -1,19 +1,19 @@
class B {
default object <error>A</error> {
companion object <error>A</error> {
}
val <error>A</error> = this
}
class C {
default <error>object A</error> {
companion <error>object A</error> {
<error>val A</error> = this
}
}
class D {
default <error>object A</error> {
companion <error>object A</error> {
<error>val `OBJECT$`</error> = this
}
@@ -1,5 +1,5 @@
class C {
default object {
companion object {
<error>val x</error> = 1
<error>fun getX()</error> = 1
}
@@ -3,7 +3,7 @@ trait Bar {
}
class A {
default object : Bar
companion object : Bar
}
fun test() {