use of org.eclipse.xtend.core.xtend.XtendConstructor in project xtext-xtend by eclipse.
the class XtendValidationTest method testVarArgMustBeLast_3.
@Test
public void testVarArgMustBeLast_3() throws Exception {
XtendConstructor constr = constructor("new(int x, String... myParam) { }");
helper.assertNoErrors(constr);
}
use of org.eclipse.xtend.core.xtend.XtendConstructor in project xtext-xtend by eclipse.
the class XtendCopyQualifiedNameServiceTest method testJvmConstructor_4.
@Test
public void testJvmConstructor_4() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("new () {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("this(<String>newArrayList)");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("new (java.util.List<?> list) {");
_builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile xtendFile = this.parseHelper.parse(_builder, this.getResourceSet());
final XtendTypeDeclaration xtendType = IterableExtensions.<XtendTypeDeclaration>head(xtendFile.getXtendTypes());
XtendMember _head = IterableExtensions.<XtendMember>head(xtendType.getMembers());
XExpression _expression = ((XtendConstructor) _head).getExpression();
final XBlockExpression expression = ((XBlockExpression) _expression);
this.assertCopyQualifiedName(expression.getExpressions().get(0), "Foo(ArrayList<String>)");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendConstructor in project xtext-xtend by eclipse.
the class XtendCopyQualifiedNameServiceTest method testJvmConstructor_3.
@Test
public void testJvmConstructor_3() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo extends Bar {");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("new (java.util.List<?> list) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("super(list)");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("new () {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("super(<String>newArrayList)");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("new (java.util.List<?> list) {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile xtendFile = this.parseHelper.parse(_builder, this.getResourceSet());
final XtendTypeDeclaration xtendType = IterableExtensions.<XtendTypeDeclaration>head(xtendFile.getXtendTypes());
XtendMember _head = IterableExtensions.<XtendMember>head(xtendType.getMembers());
XExpression _expression = ((XtendConstructor) _head).getExpression();
final XBlockExpression expression = ((XBlockExpression) _expression);
this.assertCopyQualifiedName(expression.getExpressions().get(0), "Bar(List<?>)");
XtendMember _head_1 = IterableExtensions.<XtendMember>head(IterableExtensions.<XtendMember>tail(xtendType.getMembers()));
XExpression _expression_1 = ((XtendConstructor) _head_1).getExpression();
final XBlockExpression expression2 = ((XBlockExpression) _expression_1);
this.assertCopyQualifiedName(expression2.getExpressions().get(0), "Bar(ArrayList<String>)");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations