CallableBuilder: fix PIEAE
#EA-214253 Fix
This commit is contained in:
+5
-3
@@ -445,6 +445,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
|||||||
if (containingElement is KtBlockExpression && (callableInfo as? PropertyInfo)?.writable == true) {
|
if (containingElement is KtBlockExpression && (callableInfo as? PropertyInfo)?.writable == true) {
|
||||||
originalElement as KtBinaryExpression
|
originalElement as KtBinaryExpression
|
||||||
} else null
|
} else null
|
||||||
|
val pointerOfAssignmentToReplace = assignmentToReplace?.createSmartPointer()
|
||||||
|
|
||||||
val ownerTypeString = if (isExtension) {
|
val ownerTypeString = if (isExtension) {
|
||||||
val renderedType = receiverTypeCandidate!!.renderedTypes.first()
|
val renderedType = receiverTypeCandidate!!.renderedTypes.first()
|
||||||
@@ -575,9 +576,10 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assignmentToReplace != null) {
|
val newInitializer = pointerOfAssignmentToReplace?.element
|
||||||
(declaration as KtProperty).initializer = assignmentToReplace.right
|
if (newInitializer != null) {
|
||||||
return assignmentToReplace.replace(declaration) as KtCallableDeclaration
|
(declaration as KtProperty).initializer = newInitializer.right
|
||||||
|
return newInitializer.replace(declaration) as KtCallableDeclaration
|
||||||
}
|
}
|
||||||
|
|
||||||
val container = if (containingElement is KtClass && callableInfo.isForCompanion) {
|
val container = if (containingElement is KtClass && callableInfo.isForCompanion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user