switch expression: fix typo in type calculation (IDEA-204188)

This commit is contained in:
Anna.Kozlova
2018-12-13 18:01:51 +01:00
parent 3f7ca646a3
commit 67422555d5
2 changed files with 11 additions and 1 deletions
@@ -108,4 +108,14 @@ no instance(s) of type variable(s) exist so that Integer conforms to String">()
default -> throw new IllegalArgumentException();
};
}
static void test(boolean b, int i) {
Class<?> c = (b ?
switch (i) {
case 1 -> true;
default -> 0;
} : 1).getClass();
System.out.println(c.getCanonicalName());
}
}