use of org.eclipse.xtend.core.xtend.XtendFile in project xtext-xtend by eclipse.
the class ValidationBug409602Test method test_05.
@Test
public void test_05() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val ()=>int res = [|");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("if (\"\" == null) {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("1");
_builder.newLine();
_builder.append("\t\t");
_builder.append("]");
_builder.newLine();
_builder.append("\t\t");
_builder.append("return res");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.parser.parse(_builder);
this.helper.assertError(file, XbasePackage.Literals.XRETURN_EXPRESSION, IssueCodes.INVALID_RETURN);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendFile in project xtext-xtend by eclipse.
the class ValidationBug409602Test method test_07.
@Test
public void test_07() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def int m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("if (\"\" == null) {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("return");
_builder.newLine();
_builder.append("\t\t");
_builder.append("} else {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("return 1");
_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);
this.helper.assertError(file, XbasePackage.Literals.XRETURN_EXPRESSION, IssueCodes.INVALID_RETURN);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendFile in project xtext-xtend by eclipse.
the class ValidationBug409602Test method test_04.
@Test
public void test_04() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("[|");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("if (\"\" == null) {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("1");
_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);
this.helper.assertError(file, XbasePackage.Literals.XNUMBER_LITERAL, IssueCodes.INVALID_INNER_EXPRESSION);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendFile in project xtext-xtend by eclipse.
the class ValidationBug409602Test method test_16.
@Test
public void test_16() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val ()=>int res = [|");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("if (\"\" == null) {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return 1");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("} else {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("]");
_builder.newLine();
_builder.append("\t\t");
_builder.append("res");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.parser.parse(_builder);
this.helper.assertError(file, XbasePackage.Literals.XRETURN_EXPRESSION, IssueCodes.INVALID_RETURN);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtend.core.xtend.XtendFile in project xtext-xtend by eclipse.
the class ValidationBug409602Test method test_13.
@Test
public void test_13() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("def m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("val ()=>int res = [|");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("if (\"\" == null) {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("} else {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("return 1");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("]");
_builder.newLine();
_builder.append("\t\t");
_builder.append("res");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final XtendFile file = this.parser.parse(_builder);
this.helper.assertError(file, XbasePackage.Literals.XRETURN_EXPRESSION, IssueCodes.INVALID_RETURN);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations