Intention to simplify for using destructing declaration
This commit is contained in:
@@ -216,6 +216,10 @@ class KtPsiFactory(private val project: Project) {
|
||||
return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtDestructuringDeclaration
|
||||
}
|
||||
|
||||
fun createDestructuringDeclarationInFor(text: String): KtDestructuringDeclaration {
|
||||
return ((createFunction("fun foo() {for ($text in foo) {} }").bodyExpression as KtBlockExpression).statements.first() as KtForExpression).destructuringParameter!!
|
||||
}
|
||||
|
||||
fun createDestructuringParameter(text: String): KtDestructuringDeclaration {
|
||||
val dummyFun = createFunction("fun foo() { for ($text in foo) {} }")
|
||||
return ((dummyFun.bodyExpression as KtBlockExpression).statements.first() as KtForExpression).destructuringParameter!!
|
||||
|
||||
Reference in New Issue
Block a user