Correctness check in JetPsiFactory.createExpression

This commit is contained in:
Valentin Kipyatkov
2015-05-18 14:45:58 +03:00
parent 0dc92c3ee8
commit 5a737b8973
7 changed files with 25 additions and 16 deletions
@@ -149,11 +149,11 @@ public class JetTypeCheckerTest extends JetLiteFixture {
}
public void testWhen() throws Exception {
assertType("when (1) { is 1 -> 2; } ", "Int");
assertType("when (1) { is 1 -> 2; is 1 -> '2'} ", "Comparable<out Any?>");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; is 1 -> null} ", "Comparable<out Any?>?");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; else -> null} ", "Comparable<out Any?>?");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; is 1 -> when(2) {is 1 -> null}} ", "Comparable<out Any?>?");
assertType("when (1) { is 1 -> 2; }", "Int");
assertType("when (1) { is 1 -> 2; is 1 -> '2'}", "Comparable<out Any?>");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; is 1 -> null}", "Comparable<out Any?>?");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; else -> null}", "Comparable<out Any?>?");
assertType("when (1) { is 1 -> 2; is 1 -> '2'; is 1 -> when(2) {is 1 -> null}}", "Comparable<out Any?>?");
}
public void testTry() throws Exception {