Typechecker logic fixed for one-branch ifs and 'return x' for Unit-returning functions

This commit is contained in:
Andrey Breslav
2011-04-07 14:43:25 +04:00
parent e61e908ab7
commit 30d8349272
7 changed files with 39 additions and 15 deletions
@@ -101,6 +101,9 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
assertType("if (true) null else null", "Nothing?");
assertType("if (true) 1 else '1'", "Any");
assertType("if (true) else '1'", "Unit");
assertType("if (true) else a = 0", "Unit");
}
public void testWhen() throws Exception {