Fixed KT-2071: Cannot Introduce Variable from function literal.

This commit is contained in:
Alexander.Podkhalyuzin
2012-05-23 15:58:55 +04:00
parent b5b9f7ba98
commit b9267dc7cf
6 changed files with 87 additions and 15 deletions
@@ -50,6 +50,13 @@ public class JetPsiFactory {
return property.getInitializer();
}
public static JetValueArgumentList createCallArguments(Project project, String text) {
JetProperty property = createProperty(project, "val x = foo" + text);
JetExpression initializer = property.getInitializer();
JetCallExpression callExpression = (JetCallExpression) initializer;
return callExpression.getValueArgumentList();
}
public static JetTypeReference createType(Project project, String type) {
JetProperty property = createProperty(project, "val x : " + type);
return property.getPropertyTypeRef();