Frontend part of KT-910 Type of try/catch/finally

This commit is contained in:
Svetlana Isakova
2012-05-18 15:20:37 +04:00
parent b49fa2ab82
commit 2d601cf4a2
3 changed files with 33 additions and 8 deletions
@@ -158,7 +158,8 @@ public class JetTypeCheckerTest extends JetLiteFixture {
public void testTry() throws Exception {
assertType("try {1} finally{2}", "Int");
assertType("try {1} catch (e : Exception) {'a'} finally{2}", "Int");
assertType("try {1} catch (e : Exception) {'a'} finally{2}", "Any");
assertType("try {1} catch (e : Exception) {2} finally{'a'}", "Int");
assertType("try {1} catch (e : Exception) {'a'} finally{'2'}", "Any");
assertType("try {1} catch (e : Exception) {'a'}", "Any");
assertType("try {1} catch (e : Exception) {'a'} catch (e : Exception) {null}", "Any?");