protected & internal are now forbidden in interfaces
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5f43628f1b
commit
cba6870f52
@@ -0,0 +1,7 @@
|
||||
interface My {
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> val x: Int
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> val xxx: Int
|
||||
get() = 0
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> fun foo(): Int
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>internal<!> fun bar() = 42
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public interface My {
|
||||
internal abstract val x: kotlin.Int
|
||||
internal open val xxx: kotlin.Int
|
||||
internal open fun bar(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal abstract fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -17,5 +17,5 @@ enum class Our(protected val x: Int) {
|
||||
}
|
||||
|
||||
interface Their {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 7
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 7
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
interface T {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>internal<!> var foo: Long
|
||||
}
|
||||
|
||||
interface U {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> var foo: Long
|
||||
}
|
||||
|
||||
interface V : T, U {
|
||||
<!CANNOT_INFER_VISIBILITY!>override var foo: Long<!>
|
||||
}
|
||||
|
||||
interface <!CANNOT_INFER_VISIBILITY!>W<!> : T, U
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package
|
||||
|
||||
public interface T {
|
||||
internal abstract var foo: kotlin.Long
|
||||
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 U {
|
||||
protected abstract var foo: kotlin.Long
|
||||
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 V : T, U {
|
||||
public abstract override /*2*/ var foo: kotlin.Long
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface W : T, U {
|
||||
public abstract override /*2*/ /*fake_override*/ var foo: kotlin.Long
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
interface T {
|
||||
public var foo: Short
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>internal<!> set
|
||||
}
|
||||
|
||||
interface U {
|
||||
public var foo: Short
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> set
|
||||
}
|
||||
|
||||
interface V : T, U {
|
||||
<!CANNOT_INFER_VISIBILITY!>override var foo: Short<!>
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package
|
||||
|
||||
public interface T {
|
||||
public abstract var foo: kotlin.Short
|
||||
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 U {
|
||||
public abstract var foo: kotlin.Short
|
||||
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 V : T, U {
|
||||
public abstract override /*2*/ var foo: kotlin.Short
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+2
-2
@@ -6,7 +6,7 @@ open class C {
|
||||
}
|
||||
|
||||
interface T {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
}
|
||||
|
||||
class G : C(), T {
|
||||
@@ -18,7 +18,7 @@ open class A {
|
||||
}
|
||||
|
||||
interface B {
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() {}
|
||||
}
|
||||
|
||||
interface D {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
interface Test<in I, out O> {
|
||||
val internal_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
public val public_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> val protected_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> val protected_val: <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!PRIVATE_PROPERTY_IN_INTERFACE!>private<!> val private_val: I
|
||||
|
||||
var interlan_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
public var public_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> var protected_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> var protected_private_set: <!TYPE_VARIANCE_CONFLICT!>O<!>
|
||||
private set
|
||||
<!PRIVATE_PROPERTY_IN_INTERFACE!>private<!> var private_private_set: O
|
||||
private set
|
||||
|
||||
fun internal_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
public fun public_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun protected_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun protected_fun(i: <!TYPE_VARIANCE_CONFLICT!>O<!>) : <!TYPE_VARIANCE_CONFLICT!>I<!>
|
||||
<!PRIVATE_FUNCTION_WITH_NO_BODY!>private<!> fun private_fun(i: O) : I
|
||||
}
|
||||
Reference in New Issue
Block a user