interface Int<T> { void method(T x); }
class Sub implements Int<Xyz> {
public void method(Xyz x) { x.inInt(); }
}
interface Xint { void inInt(); }
class Xyz implements Xint {
public void inInt() { }
}
Execute "use interface" for Xyz to use Xint. It produces:
interface Int<T> { void method(T x); }
class Sub implements Int<Xyz> {
public void method(Xint x) { x.inInt(); }
}
interface Xint { void inInt(); }
class Xyz implements Xint {
public void inInt() { }
}
This breaks the code because the refactoring changed the signature of method() without changing the type argument to Int. I imagine this could break code in more subtle ways that wouldn't be caught by the compiler.
Description
interface Int<T> { void method(T x); }
class Sub implements Int<Xyz> {
public void method(Xyz x) { x.inInt(); }
}
interface Xint { void inInt(); }
class Xyz implements Xint {
public void inInt() { }
}
Execute "use interface" for Xyz to use Xint. It produces:
interface Int<T> { void method(T x); }
class Sub implements Int<Xyz> {
public void method(Xint x) { x.inInt(); }
}
interface Xint { void inInt(); }
class Xyz implements Xint {
public void inInt() { }
}
This breaks the code because the refactoring changed the signature of method() without changing the type argument to Int. I imagine this could break code in more subtle ways that wouldn't be caught by the compiler.