JET-34 Require a return statement in a function with a block body
JET-77 Require a return type annotation for non-Unit returning functions with block bodies
This commit is contained in:
@@ -57,7 +57,7 @@ public class PatternMatchingTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testNoReturnType() throws Exception {
|
||||
loadText("fun foo(x: String) = when(x) { is * => return \"x\" }");
|
||||
loadText("fun foo(x: String) = when(x) { is * => \"x\" }");
|
||||
Method foo = generateFunction();
|
||||
assertEquals("x", foo.invoke(null, ""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user