Prohibit implicit overrides with lesser visibility
A non-abstract super-declaration is allowed to stand as 'an implementation' of a fake override only if its visibility is not less than visibilities of all other super-declarations #KT-2491 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
trait T {
|
||||
public fun foo()
|
||||
}
|
||||
|
||||
open class C {
|
||||
protected fun foo() {}
|
||||
}
|
||||
|
||||
class <!CANNOT_INFER_VISIBILITY!>D<!> : C(), T
|
||||
|
||||
val obj: C = <!CANNOT_INFER_VISIBILITY!>object<!> : C(), T {}
|
||||
+1
-1
@@ -7,7 +7,7 @@ interface JavaInterface {
|
||||
// FILE: kotlin.kt
|
||||
|
||||
trait KotlinTrait {
|
||||
fun foo(someOtherName: Int) {}
|
||||
public fun foo(someOtherName: Int) {}
|
||||
}
|
||||
|
||||
class BothTraitsSubclass : JavaInterface, KotlinTrait
|
||||
|
||||
Reference in New Issue
Block a user