use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_004.
@Test
public void testErrorModel_004() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class TestXtend {");
_builder.newLine();
_builder.append("\t");
_builder.append("val static int a = 4");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("@Click(#[ a, a ])");
_builder.newLine();
_builder.append("\t");
_builder.append("def m");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
XtendTypeDeclaration _head = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
final XtendClass clazz = ((XtendClass) _head);
final XtendMember lastMember = IterableExtensions.<XtendMember>last(clazz.getMembers());
final EList<XAnnotation> annotations = lastMember.getAnnotations();
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(IterableExtensions.<XAnnotation>head(annotations));
Assert.assertNotNull(resolvedTypes.getActualType(IterableExtensions.<XAnnotation>head(annotations)));
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_002.
@Test
public void testErrorModel_002() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class TestXtend {");
_builder.newLine();
_builder.append("\t");
_builder.append("val static int a = 4");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("@");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
XtendTypeDeclaration _head = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
final XtendClass clazz = ((XtendClass) _head);
final XtendMember lastMember = IterableExtensions.<XtendMember>last(clazz.getMembers());
final EList<XAnnotation> annotations = lastMember.getAnnotations();
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(IterableExtensions.<XAnnotation>head(annotations));
Assert.assertNotNull(resolvedTypes.getActualType(IterableExtensions.<XAnnotation>head(annotations)));
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_018.
@Test
public void testErrorModel_018() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def m(@");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
final XtendTypeDeclaration c = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
XtendMember _head = IterableExtensions.<XtendMember>head(c.getMembers());
final XtendFunction function = ((XtendFunction) _head);
final XtendParameter param = IterableExtensions.<XtendParameter>head(function.getParameters());
final XAnnotation annotation = IterableExtensions.<XAnnotation>head(param.getAnnotations());
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(annotation);
Assert.assertNotNull(resolvedTypes.getActualType(annotation));
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_011.
@Test
public void testErrorModel_011() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("annotation { ");
_builder.newLine();
_builder.append("\t");
_builder.append("val inferred = \'bar\'");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
final XtendTypeDeclaration annotation = IterableExtensions.<XtendTypeDeclaration>last(file.getXtendTypes());
XtendMember _head = IterableExtensions.<XtendMember>head(annotation.getMembers());
final XtendField field = ((XtendField) _head);
final XExpression initializer = field.getInitialValue();
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(initializer);
Assert.assertNotNull(resolvedTypes.getActualType(initializer));
}
use of org.eclipse.xtend.core.xtend.XtendMember in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_016.
@Test
public void testErrorModel_016() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class <T> {");
_builder.newLine();
_builder.append("\t");
_builder.append("val String s");
_builder.newLine();
_builder.append(" ");
_builder.append("new(String ^new) {");
_builder.newLine();
_builder.append(" ");
_builder.append("s = ^new");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
final XtendTypeDeclaration unnamed = IterableExtensions.<XtendTypeDeclaration>head(file.getXtendTypes());
XtendMember _last = IterableExtensions.<XtendMember>last(unnamed.getMembers());
final XtendConstructor constructor = ((XtendConstructor) _last);
XExpression _expression = constructor.getExpression();
final XBlockExpression body = ((XBlockExpression) _expression);
XExpression _head = IterableExtensions.<XExpression>head(body.getExpressions());
final XAssignment assignment = ((XAssignment) _head);
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(assignment);
Assert.assertNotNull(resolvedTypes.getActualType(assignment));
}
Aggregations