Fix for KT-11081: Reified type parameters are lost in anonymous object in inline function when using default value parameters

#KT-11081 Fixed
This commit is contained in:
Michael Bogdanov
2016-02-18 15:23:39 +03:00
parent 4c1c64fa08
commit 405c21a17e
5 changed files with 57 additions and 3 deletions
@@ -285,7 +285,8 @@ public class MethodInliner {
super.visitMethodInsn(opcode, changeOwnerForExternalPackage(owner, opcode), name, desc, itf);
}
}
else if (ReifiedTypeInliner.isNeedClassReificationMarker(new MethodInsnNode(opcode, owner, name, desc, false))) {
else if (ReifiedTypeInliner.isNeedClassReificationMarker(new MethodInsnNode(opcode, owner, name, desc, false)) &&
!isDefaultCompilation()) {
// we will put it if needed in anew processing
}
else {
@@ -372,7 +373,7 @@ public class MethodInliner {
) {
if (isInliningLambda || InlineCodegenUtil.GENERATE_SMAP) {
String varSuffix = inliningContext.isRoot() &&
!((RootInliningContext) inliningContext).isDefaultCompilation &&
!isDefaultCompilation() &&
!InlineCodegenUtil.isFakeLocalVariableForInline(name) ?
INLINE_FUN_VAR_SUFFIX : "";
String varName = !varSuffix.isEmpty() && name.equals("this") ? name + "_" : name;
@@ -440,7 +441,7 @@ public class MethodInliner {
if (frame != null) {
if (ReifiedTypeInliner.isNeedClassReificationMarker(cur)) {
awaitClassReification = true;
awaitClassReification = !isDefaultCompilation();
}
else if (cur.getType() == AbstractInsnNode.METHOD_INSN) {
if (InlineCodegenUtil.isFinallyStart(cur)) {
@@ -804,4 +805,7 @@ public class MethodInliner {
}
private boolean isDefaultCompilation() {
return inliningContext.isRoot() && ((RootInliningContext) inliningContext).isDefaultCompilation;
}
}