Typechecker logic fixed for one-branch ifs and 'return x' for Unit-returning functions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user