protected & internal are now forbidden in interfaces
This commit is contained in:
committed by
Mikhail Glukhikh
parent
5f43628f1b
commit
cba6870f52
@@ -1,15 +0,0 @@
|
||||
open class A() {
|
||||
protected open fun protectedFun() { }
|
||||
internal open fun internalFun() {}
|
||||
public open fun publicFun() {}
|
||||
}
|
||||
|
||||
interface B {
|
||||
protected open val protectedProperty : Int
|
||||
internal open val internalProperty : Int
|
||||
public open val publicProperty : Int
|
||||
}
|
||||
|
||||
class C : A(), B {
|
||||
<caret>
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
open class A() {
|
||||
protected open fun protectedFun() { }
|
||||
internal open fun internalFun() {}
|
||||
public open fun publicFun() {}
|
||||
}
|
||||
|
||||
interface B {
|
||||
protected open val protectedProperty : Int
|
||||
internal open val internalProperty : Int
|
||||
public open val publicProperty : Int
|
||||
}
|
||||
|
||||
class C : A(), B {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
<selection><caret>return super.equals(other)</selection>
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return super.hashCode()
|
||||
}
|
||||
|
||||
override fun internalFun() {
|
||||
super.internalFun()
|
||||
}
|
||||
|
||||
override val internalProperty: Int
|
||||
get() = throw UnsupportedOperationException()
|
||||
|
||||
override fun protectedFun() {
|
||||
super.protectedFun()
|
||||
}
|
||||
|
||||
override val protectedProperty: Int
|
||||
get() = throw UnsupportedOperationException()
|
||||
|
||||
override fun publicFun() {
|
||||
super.publicFun()
|
||||
}
|
||||
|
||||
override val publicProperty: Int
|
||||
get() = throw UnsupportedOperationException()
|
||||
|
||||
override fun toString(): String {
|
||||
return super.toString()
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
interface Test {
|
||||
public open fun test()
|
||||
protected open val testProp : Int
|
||||
public open val testProp : Int
|
||||
}
|
||||
|
||||
class SomeTest : Test {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
interface Test {
|
||||
public open fun test()
|
||||
protected open val testProp : Int
|
||||
public open val testProp : Int
|
||||
}
|
||||
|
||||
class SomeTest : Test {
|
||||
|
||||
Reference in New Issue
Block a user