Do not report redeclaration when outer class and default object's members clash
Previously we prohibited classes and properties with the same name (now it's unnecessary) Add test for backends that they support qualified (by default object name) member references inside class body
This commit is contained in:
-11
@@ -1,11 +0,0 @@
|
||||
enum class E {
|
||||
<!REDECLARATION!>FIRST<!>
|
||||
|
||||
<!REDECLARATION!>SECOND<!>
|
||||
|
||||
default object {
|
||||
class <!REDECLARATION!>FIRST<!>
|
||||
|
||||
val <!REDECLARATION!>SECOND<!> = this
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package kt2247
|
||||
|
||||
class B {
|
||||
default object {
|
||||
class Y {
|
||||
}
|
||||
}
|
||||
|
||||
class Y {
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
enum class E {
|
||||
FIRST
|
||||
|
||||
SECOND
|
||||
|
||||
default object {
|
||||
class FIRST
|
||||
|
||||
val SECOND = this
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
default object B {
|
||||
class <!REDECLARATION!>G<!>
|
||||
val <!REDECLARATION!>G<!> = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal default object B {
|
||||
private constructor B()
|
||||
internal final val G: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
internal final class G {
|
||||
public constructor G()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
//KT-2247 Report name clashes between inner classes and members of default object
|
||||
|
||||
package kt2247
|
||||
|
||||
class B {
|
||||
default object {
|
||||
class <!REDECLARATION!>Y<!> {
|
||||
}
|
||||
}
|
||||
|
||||
class <!REDECLARATION!>Y<!> {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user