More fair handle of PsiDisjunctionType; introduce variable for multi-catch types

This commit is contained in:
Roman Shevchenko
2011-02-17 17:52:04 +01:00
parent b417cb4606
commit 6b44b057fa
12 changed files with 171 additions and 63 deletions

View File

@@ -0,0 +1,11 @@
class C {
static class E1 extends Exception { }
static class E2 extends Exception { }
void m() {
try { }
catch (E1 | E2 ex) {
final Exception e = ex;
}
}
}

View File

@@ -0,0 +1,11 @@
class C {
static class E1 extends Exception { }
static class E2 extends Exception { }
void m() {
try { }
catch (E1 | E2 ex) {
<caret>ex;
}
}
}

View File

@@ -0,0 +1,12 @@
class C {
interface B<T> { }
static class E1 extends Exception implements B<Integer> { }
static class E2 extends Exception implements B<Long> { }
void m() {
try { }
catch (E1 | E2 ex) {
final B<? extends Number> b = ex;
}
}
}

View File

@@ -0,0 +1,12 @@
class C {
interface B<T> { }
static class E1 extends Exception implements B<Integer> { }
static class E2 extends Exception implements B<Long> { }
void m() {
try { }
catch (E1 | E2 ex) {
<caret>ex;
}
}
}