mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
More fair handle of PsiDisjunctionType; introduce variable for multi-catch types
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user