Override/Implement actions are now inherits visibility.

This commit is contained in:
Sergey Lukjanov
2012-04-04 19:15:25 +04:00
parent 9b04e85282
commit d4cce32008
9 changed files with 63 additions and 11 deletions
@@ -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() {
}
}
}