fix for 1345
This commit is contained in:
@@ -431,6 +431,14 @@ public class FunctionCodegen {
|
||||
private static void checkOverride(CodegenContext owner, GenerationState state, ClassBuilder v, Method jvmSignature, FunctionDescriptor functionDescriptor, FunctionDescriptor overriddenFunction) {
|
||||
Method method = state.getTypeMapper().mapSignature(functionDescriptor.getName(), functionDescriptor).getAsmMethod();
|
||||
Method overriden = state.getTypeMapper().mapSignature(overriddenFunction.getName(), overriddenFunction.getOriginal()).getAsmMethod();
|
||||
|
||||
if(overriddenFunction.getModality() == Modality.ABSTRACT) {
|
||||
Set<? extends FunctionDescriptor> overriddenFunctions = overriddenFunction.getOverriddenDescriptors();
|
||||
for (FunctionDescriptor of : overriddenFunctions) {
|
||||
checkOverride(owner, state, v, jvmSignature, overriddenFunction, of.getOriginal());
|
||||
}
|
||||
}
|
||||
|
||||
if(differentMethods(method, overriden)) {
|
||||
int flags = ACC_PUBLIC | ACC_BRIDGE; // TODO.
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
trait Creator<T> {
|
||||
fun create() : T
|
||||
}
|
||||
|
||||
class Actor(val code: String = "OK")
|
||||
|
||||
trait Factory : Creator<Actor>
|
||||
|
||||
class MyFactory() : Factory {
|
||||
override fun create(): Actor = Actor()
|
||||
}
|
||||
|
||||
fun box() : String = MyFactory().create().code
|
||||
@@ -303,4 +303,8 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
blackBoxFile("regressions/kt633.kt");
|
||||
}
|
||||
|
||||
|
||||
public void testKt1345() throws Exception {
|
||||
blackBoxFile("regressions/kt1345.kt");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user