KT-2752: fix old tests, add test for clashing between class and its companion object
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
val foo: dynamic = 1
|
val foo: dynamic = 1
|
||||||
|
|
||||||
fun foo() {
|
fun bar() {
|
||||||
class C {
|
class C {
|
||||||
val foo: dynamic = 1
|
val foo: dynamic = 1
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package
|
package
|
||||||
|
|
||||||
public val foo: dynamic = 1
|
public val foo: dynamic = 1
|
||||||
public fun foo(): kotlin.Unit
|
public fun bar(): kotlin.Unit
|
||||||
|
|||||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ class A {
|
|||||||
fun Int.invoke(a: String, b: Int)<!> = "OK"
|
fun Int.invoke(a: String, b: Int)<!> = "OK"
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
val foo = 0
|
val baz = 0
|
||||||
|
|
||||||
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
<!WRONG_ANNOTATION_TARGET!>@nativeInvoke<!>
|
||||||
object Obj {}
|
object Obj {}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ package
|
|||||||
|
|
||||||
public final class A {
|
public final class A {
|
||||||
public constructor A()
|
public constructor A()
|
||||||
@kotlin.js.nativeInvoke() public final val foo: kotlin.Int = 0
|
@kotlin.js.nativeInvoke() public final val baz: kotlin.Int = 0
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||||
@kotlin.js.nativeInvoke() public final fun foo(): kotlin.Unit
|
@kotlin.js.nativeInvoke() public final fun foo(): kotlin.Unit
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||||
|
|||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package foo
|
||||||
|
|
||||||
|
class A {
|
||||||
|
fun foo() = 23
|
||||||
|
|
||||||
|
val bar = 123
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun foo() = 42
|
||||||
|
|
||||||
|
val bar = 142
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
assertEquals(23, A().foo())
|
||||||
|
assertEquals(42, A.foo())
|
||||||
|
|
||||||
|
assertEquals(123, A().bar)
|
||||||
|
assertEquals(142, A.bar)
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user