Prohibit inline data classes
`CONFLICTING_JVM_DECLARATIONS` diagnostics are reported because we're trying to generate functions from `Any` once for inline class and once for data class #KT-25760 Fixed
This commit is contained in:
@@ -183,11 +183,12 @@ object ModifierCheckerCore {
|
||||
result += incompatibilityRegister(PRIVATE_KEYWORD, PROTECTED_KEYWORD, PUBLIC_KEYWORD, INTERNAL_KEYWORD)
|
||||
// Abstract + open + final + sealed: incompatible
|
||||
result += incompatibilityRegister(ABSTRACT_KEYWORD, OPEN_KEYWORD, FINAL_KEYWORD, SEALED_KEYWORD)
|
||||
// data + open, data + inner, data + abstract, data + sealed
|
||||
// data + open, data + inner, data + abstract, data + sealed, data + inline
|
||||
result += incompatibilityRegister(DATA_KEYWORD, OPEN_KEYWORD)
|
||||
result += incompatibilityRegister(DATA_KEYWORD, INNER_KEYWORD)
|
||||
result += incompatibilityRegister(DATA_KEYWORD, ABSTRACT_KEYWORD)
|
||||
result += incompatibilityRegister(DATA_KEYWORD, SEALED_KEYWORD)
|
||||
result += incompatibilityRegister(DATA_KEYWORD, INLINE_KEYWORD)
|
||||
// open is redundant to abstract & override
|
||||
result += redundantRegister(ABSTRACT_KEYWORD, OPEN_KEYWORD)
|
||||
// abstract is redundant to sealed
|
||||
|
||||
+2
@@ -29,3 +29,5 @@ final inline class D0(val x: Int)
|
||||
<!INLINE_CLASS_NOT_FINAL!>open<!> inline class D1(val x: Int)
|
||||
<!INLINE_CLASS_NOT_FINAL!>abstract<!> inline class D2(val x: Int)
|
||||
<!INLINE_CLASS_NOT_FINAL!>sealed<!> inline class D3(val x: Int)
|
||||
|
||||
<!INCOMPATIBLE_MODIFIERS!>inline<!> <!INCOMPATIBLE_MODIFIERS!>data<!> class <!CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS, CONFLICTING_JVM_DECLARATIONS!>D4(val x: String)<!>
|
||||
|
||||
+10
@@ -154,3 +154,13 @@ public sealed inline class D3 {
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final data inline class D4 {
|
||||
public constructor D4(/*0*/ x: kotlin.String)
|
||||
public final val x: kotlin.String
|
||||
public final operator /*synthesized*/ fun component1(): kotlin.String
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ...): D4
|
||||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user