Override/Implement actions are now inherits visibility.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
open class A() {
|
||||
protected open fun protectedFun() { }
|
||||
internal open fun internalFun() {}
|
||||
public open fun publicFun() {}
|
||||
}
|
||||
|
||||
trait B {
|
||||
protected open val protectedProperty : Int
|
||||
internal open val internalProperty : Int
|
||||
public open val publicProperty : Int
|
||||
}
|
||||
|
||||
class C : A(), B {
|
||||
<caret>
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
open class A() {
|
||||
protected open fun protectedFun() { }
|
||||
internal open fun internalFun() {}
|
||||
public open fun publicFun() {}
|
||||
}
|
||||
|
||||
trait B {
|
||||
protected open val protectedProperty : Int
|
||||
internal open val internalProperty : Int
|
||||
public open val publicProperty : Int
|
||||
}
|
||||
|
||||
class C : A(), B {
|
||||
|
||||
override fun internalFun() {
|
||||
super<A>.internalFun()
|
||||
}
|
||||
override val internalProperty : Int = 0
|
||||
protected override fun protectedFun() {
|
||||
super<A>.protectedFun()
|
||||
}
|
||||
protected override val protectedProperty : Int = 0
|
||||
public override fun publicFun() {
|
||||
super<A>.publicFun()
|
||||
}
|
||||
public override val publicProperty : Int = 0
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import foo.Intf
|
||||
|
||||
class Impl(): Intf {
|
||||
|
||||
override fun getFooBar() : String? {
|
||||
public override fun getFooBar() : String? {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import foo.Intf
|
||||
|
||||
class Impl(): Intf {
|
||||
|
||||
override fun fooBar(i : Int, s : Array<String?>?, foo : Any?) {
|
||||
public override fun fooBar(i : Int, s : Array<String?>?, foo : Any?) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import foo.A
|
||||
|
||||
class C : A() {
|
||||
|
||||
override fun getAnswer(array : Array<String?>?, number : Int, value : Any?) : Int {
|
||||
public override fun getAnswer(array : Array<String?>?, number : Int, value : Any?) : Int {
|
||||
return super<A>.getAnswer(array, number, value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,4 @@ class SomeTest : Test {
|
||||
fun some() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ trait Test {
|
||||
|
||||
class SomeTest : Test {
|
||||
val hello = 12
|
||||
override fun test() {
|
||||
public override fun test() {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
override val testProp : Int = 0
|
||||
protected override val testProp : Int = 0
|
||||
|
||||
/**
|
||||
* test
|
||||
@@ -16,4 +16,4 @@ class SomeTest : Test {
|
||||
fun some() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user