Don't copy interface member on DefaultImpl delegation generation, keep kind
Old logic is redundant and obsolete
This commit is contained in:
@@ -72,21 +72,17 @@ class InterfaceImplBodyCodegen(
|
|||||||
// If implementation is a default interface method (JVM 8 only)
|
// If implementation is a default interface method (JVM 8 only)
|
||||||
if (implementation.isDefinitelyNotDefaultImplsMethod()) continue
|
if (implementation.isDefinitelyNotDefaultImplsMethod()) continue
|
||||||
|
|
||||||
// We create a copy of the function with kind = DECLARATION so that FunctionCodegen will generate its body
|
|
||||||
val copy = memberDescriptor.copy(memberDescriptor.containingDeclaration, Modality.OPEN, memberDescriptor.visibility,
|
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, true)
|
|
||||||
|
|
||||||
if (memberDescriptor is FunctionDescriptor) {
|
if (memberDescriptor is FunctionDescriptor) {
|
||||||
generateDelegationToSuperDefaultImpls(copy as FunctionDescriptor, implementation as FunctionDescriptor)
|
generateDelegationToSuperDefaultImpls(memberDescriptor, implementation as FunctionDescriptor)
|
||||||
}
|
}
|
||||||
else if (memberDescriptor is PropertyDescriptor) {
|
else if (memberDescriptor is PropertyDescriptor) {
|
||||||
implementation as PropertyDescriptor
|
implementation as PropertyDescriptor
|
||||||
val getter = (copy as PropertyDescriptor).getter
|
val getter = memberDescriptor.getter
|
||||||
val implGetter = implementation.getter
|
val implGetter = implementation.getter
|
||||||
if (getter != null && implGetter != null) {
|
if (getter != null && implGetter != null) {
|
||||||
generateDelegationToSuperDefaultImpls(getter, implGetter)
|
generateDelegationToSuperDefaultImpls(getter, implGetter)
|
||||||
}
|
}
|
||||||
val setter = copy.setter
|
val setter = memberDescriptor.setter
|
||||||
val implSetter = implementation.setter
|
val implSetter = implementation.setter
|
||||||
if (setter != null && implSetter != null) {
|
if (setter != null && implSetter != null) {
|
||||||
generateDelegationToSuperDefaultImpls(setter, implSetter)
|
generateDelegationToSuperDefaultImpls(setter, implSetter)
|
||||||
|
|||||||
Reference in New Issue
Block a user