jdk-24/test/langtools/tools/javac/InconsistentInheritedSignature.java

18 lines
444 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 4041948
* @summary javac previously allowed interfaces to inherit methods with
* inconsistent signatures.
* @author turnidge
*
* @compile/fail/ref=InconsistentInheritedSignature.out -XDrawDiagnostics InconsistentInheritedSignature.java
2007-12-01 00:00:00 +00:00
*/
interface I1{
int f();
}
interface I2 {
void f() ;
}
// error: Return types conflict.
interface InconsistentInheritedSignature extends I1,I2 { }