Fix Kotlin build after fixing when-related type checking issues.
Filed: KT-10752, KT-10755.
This commit is contained in:
+4
-3
@@ -455,19 +455,20 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
||||
"private "
|
||||
else ""
|
||||
|
||||
val declaration : KtNamedDeclaration = when (callableInfo.kind) {
|
||||
val declaration: KtNamedDeclaration = when (callableInfo.kind) {
|
||||
CallableKind.FUNCTION, CallableKind.SECONDARY_CONSTRUCTOR -> {
|
||||
val body = when {
|
||||
containingElement is KtClass && containingElement.isInterface() && !config.isExtension -> ""
|
||||
else -> "{}"
|
||||
}
|
||||
@Suppress("USELESS_CAST") // KT-10755
|
||||
if (callableInfo is FunctionInfo) {
|
||||
val operatorModifier = if (callableInfo.isOperator) "operator " else ""
|
||||
val infixModifier = if (callableInfo.isInfix) "infix " else ""
|
||||
psiFactory.createFunction("$modifiers$infixModifier${operatorModifier}fun<> $header $body")
|
||||
psiFactory.createFunction("$modifiers$infixModifier${operatorModifier}fun<> $header $body") as KtNamedDeclaration
|
||||
}
|
||||
else {
|
||||
psiFactory.createSecondaryConstructor("${modifiers}constructor$paramList $body")
|
||||
psiFactory.createSecondaryConstructor("${modifiers}constructor$paramList $body") as KtNamedDeclaration
|
||||
}
|
||||
}
|
||||
CallableKind.CLASS_WITH_PRIMARY_CONSTRUCTOR -> {
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ internal fun getTargetParentByQualifier(
|
||||
if (qualifierDescriptor.fqName != file.packageFqName) {
|
||||
JavaPsiFacade.getInstance(project).findPackage(qualifierDescriptor.fqName.asString())
|
||||
}
|
||||
else file // KT-9972
|
||||
else file as PsiElement // KT-9972
|
||||
else ->
|
||||
null
|
||||
}
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ private fun ExtractionData.analyzeControlFlow(
|
||||
+ outDeclarations.map { it.renderForMessage(bindingContext)!! }).sorted()
|
||||
return controlFlow to ErrorMessage.MULTIPLE_OUTPUT.addAdditionalInfo(outValuesStr)
|
||||
}
|
||||
OutputValueBoxer::AsList
|
||||
{ outputValues -> OutputValueBoxer.AsList(outputValues) } // KT-8596
|
||||
}
|
||||
|
||||
else -> controlFlow.boxerFactory
|
||||
|
||||
Reference in New Issue
Block a user