Specialize diagnostic message for nested classes not allowed
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class A {
|
||||
inner class B {
|
||||
companion <!NESTED_OBJECT_NOT_ALLOWED!>object<!> { }
|
||||
companion <!NESTED_CLASS_NOT_ALLOWED(Companion object)!>object<!> { }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
class A {
|
||||
inner class I {
|
||||
companion <!NESTED_OBJECT_NOT_ALLOWED!>object A<!>
|
||||
companion <!NESTED_CLASS_NOT_ALLOWED(Companion object)!>object A<!>
|
||||
|
||||
<!MANY_COMPANION_OBJECTS!>companion<!> <!NESTED_OBJECT_NOT_ALLOWED!>object B<!>
|
||||
<!MANY_COMPANION_OBJECTS!>companion<!> <!NESTED_CLASS_NOT_ALLOWED(Companion object)!>object B<!>
|
||||
|
||||
<!MANY_COMPANION_OBJECTS!>companion<!> <!NESTED_OBJECT_NOT_ALLOWED!>object C<!>
|
||||
<!MANY_COMPANION_OBJECTS!>companion<!> <!NESTED_CLASS_NOT_ALLOWED(Companion object)!>object C<!>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class Outer {
|
||||
inner class Inner {
|
||||
annotation <!NESTED_CLASS_NOT_ALLOWED(Annotation class)!>class TestNestedAnnotation<!>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public final class Outer {
|
||||
public constructor Outer()
|
||||
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
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
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
|
||||
|
||||
public final annotation class TestNestedAnnotation : kotlin.Annotation {
|
||||
public constructor TestNestedAnnotation()
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Outer {
|
||||
inner class Inner {
|
||||
<!NESTED_CLASS_NOT_ALLOWED(Enum class)!>enum class TestNestedEnum<!>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public final class Outer {
|
||||
public constructor Outer()
|
||||
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
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
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
|
||||
|
||||
public final enum class TestNestedEnum : kotlin.Enum<Outer.Inner.TestNestedEnum> {
|
||||
private constructor TestNestedEnum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: Outer.Inner.TestNestedEnum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<Outer.Inner.TestNestedEnum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): Outer.Inner.TestNestedEnum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<Outer.Inner.TestNestedEnum>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// LANGUAGE_VERSION: 1.1
|
||||
|
||||
enum class Enum {
|
||||
ENTRY_WITH_CLASS {
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>inner<!> class TestInner
|
||||
|
||||
class TestNested
|
||||
|
||||
interface TestInterface
|
||||
|
||||
object TestObject
|
||||
|
||||
enum class TestEnumClass {
|
||||
OTHER_ENTRY
|
||||
}
|
||||
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>companion<!> object {}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package
|
||||
|
||||
public final enum class Enum : kotlin.Enum<Enum> {
|
||||
enum entry ENTRY_WITH_CLASS
|
||||
|
||||
private constructor Enum()
|
||||
public final override /*1*/ /*fake_override*/ val name: kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: Enum): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit
|
||||
public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class<Enum!>!
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): Enum
|
||||
public final /*synthesized*/ fun values(): kotlin.Array<Enum>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Outer {
|
||||
inner class Inner {
|
||||
<!NESTED_CLASS_NOT_ALLOWED(Interface)!>interface TestNestedInterface<!>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public final class Outer {
|
||||
public constructor Outer()
|
||||
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
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
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
|
||||
|
||||
public interface TestNestedInterface {
|
||||
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,12 +1,12 @@
|
||||
// SKIP_TXT
|
||||
class Outer {
|
||||
inner class Inner1 {
|
||||
<!NESTED_OBJECT_NOT_ALLOWED!>object Obj1<!>
|
||||
<!NESTED_CLASS_NOT_ALLOWED(Object)!>object Obj1<!>
|
||||
|
||||
companion <!NESTED_OBJECT_NOT_ALLOWED!>object Obj2<!>
|
||||
companion <!NESTED_CLASS_NOT_ALLOWED(Companion object)!>object Obj2<!>
|
||||
|
||||
inner class Inner2 {
|
||||
<!NESTED_OBJECT_NOT_ALLOWED!>object Obj3<!>
|
||||
<!NESTED_CLASS_NOT_ALLOWED(Object)!>object Obj3<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ enum class MyEnum {
|
||||
|
||||
class Outer {
|
||||
inner class Inner {
|
||||
<!NESTED_OBJECT_NOT_ALLOWED!>object C<!> {
|
||||
<!NESTED_CLASS_NOT_ALLOWED(Object)!>object C<!> {
|
||||
const val a = 18
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user