Add "Add getter/setter" quick fix for uninitialized property
#KT-30078 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
efcc6f0967
commit
f861b10798
@@ -255,7 +255,10 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
|
||||
}
|
||||
|
||||
fun createPropertyGetter(expression: KtExpression): KtPropertyAccessor {
|
||||
val property = createProperty("val x get() = 1")
|
||||
val property = if (expression is KtBlockExpression)
|
||||
createProperty("val x get() {\nreturn 1\n}")
|
||||
else
|
||||
createProperty("val x get() = 1")
|
||||
val getter = property.getter!!
|
||||
val bodyExpression = getter.bodyExpression!!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user