[FE] Don't throw assertion in OverrideResolver if directOverridden is empty
Those descriptors may be empty in case user made a mistake and tried to delegate implementation of abstract class instead of interface (and we don't add functions from abstract class to overriden descriptors of fake overrides in case of delegation by) #KT-40510 Fixed
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// ISSUE: KT-40510
|
||||
|
||||
// FILE: foo/A.java
|
||||
package foo;
|
||||
|
||||
public abstract class A {
|
||||
// package-private
|
||||
abstract void foo();
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import foo.A
|
||||
|
||||
class DelegatedA(val a: A) : A by a
|
||||
@@ -0,0 +1,14 @@
|
||||
// ISSUE: KT-40510
|
||||
|
||||
// FILE: foo/A.java
|
||||
package foo;
|
||||
|
||||
public abstract class A {
|
||||
// package-private
|
||||
abstract void foo();
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import foo.A
|
||||
|
||||
class DelegatedA(val a: A) : <!DELEGATION_NOT_TO_INTERFACE!>A<!> by a
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public final class DelegatedA : foo.A {
|
||||
public constructor DelegatedA(/*0*/ a: foo.A)
|
||||
public final val a: foo.A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open /*delegation*/ fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package foo {
|
||||
|
||||
public abstract class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public/*package*/ abstract fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user