Intentions to generate accessors for a property #KT-17322 Fixed

This commit is contained in:
Toshiaki Kameyama
2017-09-05 14:01:47 +03:00
committed by Mikhail Glukhikh
parent fe0f44da94
commit 5a5a27b983
55 changed files with 539 additions and 1 deletions
@@ -262,7 +262,10 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
}
fun createPropertySetter(expression: KtExpression): KtPropertyAccessor {
val property = createProperty("val x get() = 1\nset(value) = TODO()")
val property = if (expression is KtBlockExpression)
createProperty("val x get() = 1\nset(value) {\n field = value\n }")
else
createProperty("val x get() = 1\nset(value) = TODO()")
val setter = property.setter!!
val bodyExpression = setter.bodyExpression!!