KT-3853 ISE on resolving function implementation from trait from Java
The fix is simple and dirty, because the related code will be removed soon anyways. Fix is necessary for compiling Kara. #KT-3853 fixed
This commit is contained in:
@@ -369,6 +369,14 @@ public class FunctionCodegen extends GenerationStateAware {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
generateMethodParametersAnnotations(mv, functionDescriptor, jvmSignature);
|
||||
}
|
||||
|
||||
void generateMethodParametersAnnotations(
|
||||
MethodVisitor mv,
|
||||
FunctionDescriptor functionDescriptor,
|
||||
JvmMethodSignature jvmSignature
|
||||
) {
|
||||
Iterator<ValueParameterDescriptor> valueParameters = functionDescriptor.getValueParameters().iterator();
|
||||
List<JvmMethodParameterSignature> kotlinParameterTypes = jvmSignature.getKotlinParameterTypes();
|
||||
|
||||
|
||||
@@ -1362,6 +1362,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
}
|
||||
else if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
|
||||
writeAnnotationForDelegateToTraitImpl(fun, inheritedFun, mv);
|
||||
functionCodegen.generateMethodParametersAnnotations(mv, fun, typeMapper.mapSignature(fun));
|
||||
|
||||
Type returnType = methodToGenerate.getReturnType();
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
trait Trait {
|
||||
open fun f(a: String) {
|
||||
}
|
||||
}
|
||||
|
||||
open class Class : Trait {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
internal open class Class : test.Trait {
|
||||
/*primary*/ public constructor Class()
|
||||
internal open override /*1*/ /*fake_override*/ fun f(/*0*/ a: jet.String): jet.Unit
|
||||
}
|
||||
|
||||
internal trait Trait {
|
||||
internal open fun f(/*0*/ a: jet.String): jet.Unit
|
||||
}
|
||||
@@ -138,6 +138,11 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritTraitWithFunctionParam.kt")
|
||||
public void testInheritTraitWithFunctionParam() throws Exception {
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/class/InheritTraitWithFunctionParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritTraitWithParam.kt")
|
||||
public void testInheritTraitWithParam() throws Exception {
|
||||
doTestWithAccessors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt");
|
||||
|
||||
+5
@@ -140,6 +140,11 @@ public class LazyResolveNamespaceComparingTestGenerated extends AbstractLazyReso
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritTraitWithFunctionParam.kt")
|
||||
public void testInheritTraitWithFunctionParam() throws Exception {
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritTraitWithFunctionParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("InheritTraitWithParam.kt")
|
||||
public void testInheritTraitWithParam() throws Exception {
|
||||
doTestCheckingPrimaryConstructorsAndAccessors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt");
|
||||
|
||||
Reference in New Issue
Block a user