[NI] Relax rules for call completion: require at least one constraint

It's enough to have at least one good constraint.

 Note that the whole algorithm can be a bit more general:
 we could check also Out<T>, In<T> and verify that T has good only
 lower constraint or upper constraint, but there are questions for
 types like Inv<Out<T>>, where T should have lower and upper constraints

 #KT-31514 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-05-28 19:53:22 +03:00
parent 848640253a
commit f702417655
13 changed files with 94 additions and 8 deletions
@@ -995,7 +995,7 @@ private fun findSafelyReachableReturns(methodNode: MethodNode, sourceFrames: Arr
if (!insn.isMeaningful || insn.opcode in SAFE_OPCODES || insn.isInvisibleInDebugVarInsn(methodNode) ||
isInlineMarker(insn)) {
setOf()
setOf<Int>()
} else null
}
@@ -175,7 +175,7 @@ class PsiSourceCompilerForInline(private val codegen: ExpressionCodegen, overrid
codegen.parentCodegen.className
else
state.typeMapper.mapImplementationOwner(descriptor).internalName,
if (isLambda) emptyList() else additionalInnerClasses,
if (isLambda) emptyList<ClassDescriptor>() else additionalInnerClasses,
isLambda
)