Refactoring + minor fixes: destructure intention

This commit is contained in:
Mikhail Glukhikh
2016-10-04 20:27:36 +03:00
parent dd7d7a5fc7
commit 70949d10da
11 changed files with 223 additions and 157 deletions
@@ -244,12 +244,7 @@ class KtPsiFactory(private val project: Project) {
return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtDestructuringDeclaration
}
fun createDestructuringParameterForLoop(text: String): KtParameter {
val dummyFun = createFunction("fun foo() { for ($text in foo) {} }")
return ((dummyFun.bodyExpression as KtBlockExpression).statements.first() as KtForExpression).loopParameter!!
}
fun createDestructuringParameterForLambda(text: String): KtParameter {
fun createDestructuringParameter(text: String): KtParameter {
val dummyFun = createFunction("fun foo() = { $text -> }")
return (dummyFun.bodyExpression as KtLambdaExpression).functionLiteral.valueParameters.first()
}