Revert "K2: fix internal visibility checks for overrides #KT-53197 Fixed"
This reverts commit 166965e559.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1
|
||||
// FILE: A.kt
|
||||
|
||||
open class A {
|
||||
internal open fun foo() : Int = 1
|
||||
}
|
||||
|
||||
open class AG<T> {
|
||||
internal open fun bar(arg: T) = arg
|
||||
}
|
||||
|
||||
// MODULE: m2(m1)
|
||||
// FILE: B.kt
|
||||
|
||||
class B : A() {
|
||||
fun foo() : String = ""
|
||||
}
|
||||
|
||||
class BG : AG<String>() {
|
||||
fun bar(arg: Int) = arg
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
// -- Module: <m1> --
|
||||
package
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal open fun foo(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class AG</*0*/ T> {
|
||||
public constructor AG</*0*/ T>()
|
||||
internal open fun bar(/*0*/ arg: T): T
|
||||
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
|
||||
}
|
||||
|
||||
// -- Module: <m2> --
|
||||
package
|
||||
|
||||
public final class B : A {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class BG : AG<kotlin.String> {
|
||||
public constructor BG()
|
||||
public final fun bar(/*0*/ arg: kotlin.Int): kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun bar(/*0*/ arg: kotlin.String): kotlin.String
|
||||
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
|
||||
}
|
||||
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitInvisibleAbstractMethodsInSuperclasses
|
||||
// MODULE: base
|
||||
// FILE: Base.kt
|
||||
package base
|
||||
|
||||
abstract class Base {
|
||||
fun foo(): String {
|
||||
return internalFoo()
|
||||
}
|
||||
internal abstract fun internalFoo(): String
|
||||
}
|
||||
|
||||
open class BaseWithOverride : Base() {
|
||||
override fun internalFoo(): String = ""
|
||||
}
|
||||
|
||||
// MODULE: intermediate(base)
|
||||
// FILE: Intermediate.kt
|
||||
package intermediate
|
||||
import base.*
|
||||
|
||||
abstract class Intermediate : Base()
|
||||
|
||||
// MODULE: impl(base, intermediate)
|
||||
// FILE: Impl.kt
|
||||
package impl
|
||||
import base.*
|
||||
import intermediate.*
|
||||
|
||||
<!INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_ERROR!>class ImplDirectFromBase<!> : Base()
|
||||
|
||||
<!INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_ERROR!>object ImplObjDirectFromBase<!> : Base()
|
||||
|
||||
class ImplDirectFromBaseWithOverride : BaseWithOverride()
|
||||
|
||||
<!INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_ERROR!>class ImplDirectFromBaseWithOverrid<!> : Base() {
|
||||
<!NOTHING_TO_OVERRIDE!>override<!> fun internalFoo(): String = ""
|
||||
}
|
||||
|
||||
<!INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_ERROR!>class ImplViaIntermediate<!> : Intermediate()
|
||||
|
||||
fun foo() {
|
||||
ImplDirectFromBase().foo()
|
||||
ImplObjDirectFromBase.foo()
|
||||
ImplDirectFromBaseWithOverride().foo()
|
||||
ImplViaIntermediate().foo()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitInvisibleAbstractMethodsInSuperclasses
|
||||
// MODULE: base
|
||||
// FILE: Base.kt
|
||||
|
||||
Reference in New Issue
Block a user