data + open / inner / abstract / sealed are now forbidden
This commit is contained in:
committed by
Mikhail Glukhikh
parent
3725ef8cdf
commit
fff434d377
-13
@@ -1,13 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
<!DEPRECATED_MODIFIER_PAIR!>open<!> <!DEPRECATED_MODIFIER_PAIR!>data<!> class A(private val x: Int)
|
||||
|
||||
class B : A(1) {
|
||||
fun component1(): String = ""
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val b = B()
|
||||
checkSubtype<String>(b.component1())
|
||||
checkSubtype<Int>((checkSubtype<A>(b)).<!INVISIBLE_MEMBER!>component1<!>())
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(): kotlin.Unit
|
||||
|
||||
@kotlin.data() public open class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int)
|
||||
private final val x: kotlin.Int
|
||||
private final operator /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): 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
|
||||
}
|
||||
|
||||
public final class B : A {
|
||||
public constructor B()
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val x: kotlin.Int
|
||||
public final fun component1(): kotlin.String
|
||||
public final override /*1*/ /*fake_override*/ fun copy(/*0*/ x: kotlin.Int = ...): 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
|
||||
}
|
||||
@@ -2,7 +2,7 @@ interface Allowed
|
||||
|
||||
open class NotAllowed
|
||||
|
||||
<!DEPRECATED_MODIFIER_PAIR!>abstract<!> <!DEPRECATED_MODIFIER_PAIR!>data<!> class Base(val x: Int)
|
||||
<!INCOMPATIBLE_MODIFIERS!>abstract<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class Base(val x: Int)
|
||||
|
||||
class Derived: Base(42)
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class Outer {
|
||||
<!DEPRECATED_MODIFIER_PAIR!>inner<!> <!DEPRECATED_MODIFIER_PAIR!>data<!> class Inner(val x: Int)
|
||||
<!INCOMPATIBLE_MODIFIERS!>inner<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class Inner(val x: Int)
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION, DEPRECATED_MODIFIER_PAIR!>inner<!> <!DEPRECATED_MODIFIER_PAIR!>data<!> class Outer(val x: Int)
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>inner<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class Outer(val x: Int)
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DEPRECATED_MODIFIER_PAIR!>sealed<!> <!DEPRECATED_MODIFIER_PAIR!>data<!> class My(val x: Int) {
|
||||
<!INCOMPATIBLE_MODIFIERS!>sealed<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class My(val x: Int) {
|
||||
object Your: My(1)
|
||||
class His(y: Int): My(y)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user