multiple inheritance and throws clauses
Brought to you by:
nfortescue
The pizza compiler fails the following javac regression
test
/*
* @test @(#)T4528315.java 1.1 02/06/28
* @bug 4528315
* @summary Multiple method inheritance and throws clauses
* @author gafter
*
* @compile T4528315.java
*/
class E1 extends Exception {}
class E2 extends Exception {}
class E3 extends Exception {}
class E4 extends E1 {}
interface I1 {
void foo() throws E1, E2;
}
interface I2 {
void foo() throws E3, E4;
}
interface I3 extends I1, I2 {
// void foo() throws E4;
}
class Blah {
public void foo(I3 i3) {
try {
i3.foo();
} catch (E4 e4) {
}
}
}
Logged In: YES
user_id=608545
Also this one:
/*
* @test @(#)ThrowsIntersection_1.java 1.2 00/10/12
* @bug 4042259
* @summary Check that a class can inherit multiple methods
with conflicting throws clauses.
* @author maddox
*
* @compile ThrowsIntersection_1.java
*/
class Ex1 extends Exception {}
class Ex2 extends Exception {}
interface a {
int m1() throws Ex1;
}
interface b {
int m1() throws Ex2;
}
// Either order should work
abstract class c1 implements a, b {}
abstract class c2 implements b, a {}
class d extends c1 {
public int m1() {
return 1;
}
}
class e extends c2 {
public int m1() {
return 1;
}
}