use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ValidationBug433213Test method test_02.
@Test
public void test_02() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def <T> m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("new Object {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("def T m2() {}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.parser.parse(_builder);
final XtendTypeDeclaration c = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
XtendMember _head = IterableExtensions.<XtendMember>head(c.getMembers());
final XtendFunction m = ((XtendFunction) _head);
XExpression _expression = m.getExpression();
final XBlockExpression body = ((XBlockExpression) _expression);
XExpression _head_1 = IterableExtensions.<XExpression>head(body.getExpressions());
final AnonymousClass anon = ((AnonymousClass) _head_1);
XtendMember _head_2 = IterableExtensions.<XtendMember>head(anon.getMembers());
final XtendFunction m2 = ((XtendFunction) _head_2);
final JvmTypeReference returnType = m2.getReturnType();
final JvmType t = returnType.getType();
Assert.assertNotNull("notNull", t);
Assert.assertFalse("t.eIsProxy", t.eIsProxy());
this.helper.assertNoErrors(file);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class CustomClassesTest method testEnumLiteralDefaults.
@Test
public void testEnumLiteralDefaults() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("enum Foo { BAR }");
final XtendEnum enumeration = this.enumeration(_builder.toString());
final XtendMember literal = enumeration.getMembers().get(0);
Assert.assertTrue(literal.isStatic());
Assert.assertTrue(literal.isFinal());
Assert.assertEquals(JvmVisibility.PUBLIC, literal.getVisibility());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class CustomClassesTest method testFieldInAnnotationDefaults.
@Test
public void testFieldInAnnotationDefaults() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("annotation Foo { int foo }");
XtendMember _get = this.annotationType(_builder.toString()).getMembers().get(0);
final XtendField field = ((XtendField) _get);
Assert.assertTrue(field.isFinal());
Assert.assertTrue(field.isStatic());
Assert.assertEquals(JvmVisibility.PUBLIC, field.getVisibility());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class CustomClassesTest method testFieldInInterfaceDefaults.
@Test
public void testFieldInInterfaceDefaults() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("interface Foo { int foo }");
XtendMember _get = this.interfaze(_builder.toString()).getMembers().get(0);
final XtendField field = ((XtendField) _get);
Assert.assertTrue(field.isFinal());
Assert.assertTrue(field.isStatic());
Assert.assertEquals(JvmVisibility.PUBLIC, field.getVisibility());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class CustomNestedClassesTest method clazz.
@Override
protected XtendClass clazz(final String string) throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C { ");
_builder.append(string);
_builder.append(" }");
XtendMember _head = IterableExtensions.<XtendMember>head(this.file(_builder.toString()).getXtendTypes().get(0).getMembers());
return ((XtendClass) _head);
}
Aggregations