48fe9fb2c0
Previously the code was operating under the assumption that if the
implementation of some function (both the implementation and the function come
from supertypes) does not have a proper return type (the one which is a subtype
of return type of all declarations of this function in the supertypes), then
there's necessarily at least one abstract declaration of the function, such
that the implementation's return type is not a subtype of the return type of
that declaration. The assertion makes sense when the hierarchy above the
current class does not have any errors: we should report at least one function
as being "not implemented" in the current class.
However, as demonstrated by the test case, if there's an error already in the
supertypes with regard to overridability of members, this assertion may be
wrong. Reporting the "not implemented" error in such case is in fact not
necessary because of the already existing error ("return type mismatch" in the
test) in the supertypes
#KT-12482 Fixed
32 lines
1.4 KiB
Plaintext
Vendored
32 lines
1.4 KiB
Plaintext
Vendored
package
|
|
|
|
public interface A {
|
|
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 fun test(): kotlin.String
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
public interface B : A {
|
|
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*/ fun test(): kotlin.Unit
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
public open class C : A {
|
|
public constructor C()
|
|
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 test(): kotlin.String
|
|
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|
|
|
|
public final class D : C, B {
|
|
public constructor D()
|
|
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
public open override /*2*/ /*fake_override*/ fun test(): kotlin.String
|
|
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
|
}
|