use of org.eclipse.xtext.xbase.XIfExpression in project xtext-xtend by eclipse.
the class ErrorTest method testErrorModel_076.
@Test
public void testErrorModel_076() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def String m(boolean b) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("switch \'a\' {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("case \'b\': \'a\'");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("case \'c\': {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("if ");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("return \'b\'");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("else");
_builder.newLine();
_builder.append("\t\t\t\t\t");
_builder.append("return \'c\'");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.processWithoutException(_builder);
final IResolvedTypes resolvedTypes = this.typeResolver.resolveTypes(file);
final XIfExpression ifExpression = IteratorExtensions.<XIfExpression>head(Iterators.<XIfExpression>filter(file.eAllContents(), XIfExpression.class));
Assert.assertNull(ifExpression.getThen());
Assert.assertNull(ifExpression.getElse());
Assert.assertNotNull(resolvedTypes.getActualType(ifExpression));
}
Aggregations