Fix callable reference to member of generic class
This commit is contained in:
@@ -326,7 +326,7 @@ public class ClosureCodegen extends MemberCodegen<JetElement> {
|
||||
if (generateBody) {
|
||||
mv.visitCode();
|
||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||
Method method = typeMapper.mapSignature(descriptor).getAsmMethod();
|
||||
Method method = typeMapper.mapSignature(descriptor.getOriginal()).getAsmMethod();
|
||||
iv.aconst(method.getName() + method.getDescriptor());
|
||||
iv.areturn(JAVA_STRING_TYPE);
|
||||
FunctionCodegen.endVisit(iv, "function reference getSignature", element);
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
var result = "Fail"
|
||||
|
||||
class A<T> {
|
||||
fun foo(t: T) {
|
||||
result = t as String
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
(A<String>::foo).call(A<String>(), "OK")
|
||||
return result
|
||||
}
|
||||
+6
@@ -2799,6 +2799,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("memberOfGenericClass.kt")
|
||||
public void testMemberOfGenericClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/memberOfGenericClass.kt");
|
||||
doTestWithStdlib(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("platformStatic.kt")
|
||||
public void testPlatformStatic() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/platformStatic.kt");
|
||||
|
||||
Reference in New Issue
Block a user