Fix for KT-6990: inline reified doesn't inline call in some cases
#KT-6990 Fixed
This commit is contained in:
@@ -354,6 +354,10 @@ public class InlineCodegen extends CallGenerator {
|
|||||||
parentCodegen
|
parentCodegen
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (isLambda) {
|
||||||
|
codegen.propagateChildReifiedTypeParametersUsages(parentCodegen.getReifiedTypeParametersUsages());
|
||||||
|
}
|
||||||
|
|
||||||
return createSMAPWithDefaultMapping(expression, parentCodegen.getOrCreateSourceMapper().getResultMappings());
|
return createSMAPWithDefaultMapping(expression, parentCodegen.getOrCreateSourceMapper().getResultMappings());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import test.*
|
||||||
|
|
||||||
|
class OK
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return inlineMeIfYouCan<OK>()!!
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
public inline fun <reified T : Any> inlineMeIfYouCan(): String? =
|
||||||
|
{
|
||||||
|
f {
|
||||||
|
T::class.java.getName()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
inline fun f(x: () -> String) = x()
|
||||||
+6
@@ -1090,6 +1090,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
|||||||
doTestMultiFileWithInlineCheck(fileName);
|
doTestMultiFileWithInlineCheck(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt6990.1.kt")
|
||||||
|
public void testKt6990() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt6990.1.kt");
|
||||||
|
doTestMultiFileWithInlineCheck(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt7017.1.kt")
|
@TestMetadata("kt7017.1.kt")
|
||||||
public void testKt7017() throws Exception {
|
public void testKt7017() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt");
|
||||||
|
|||||||
+6
@@ -1090,6 +1090,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
|||||||
doBoxTestWithInlineCheck(fileName);
|
doBoxTestWithInlineCheck(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt6990.1.kt")
|
||||||
|
public void testKt6990() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt6990.1.kt");
|
||||||
|
doBoxTestWithInlineCheck(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt7017.1.kt")
|
@TestMetadata("kt7017.1.kt")
|
||||||
public void testKt7017() throws Exception {
|
public void testKt7017() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user