new inference: most specific with same functional interface presence

(cherry picked from commit f05ae78f4cfd030258264d717d7522ab0930d9a5)
This commit is contained in:
Anna Kozlova
2014-03-12 10:17:33 +01:00
parent 465325a6a6
commit 7d747c8cef
3 changed files with 52 additions and 8 deletions
@@ -0,0 +1,33 @@
abstract class HighlightTestInfo {
protected final String[] filePaths;
public HighlightTestInfo(Disposable <warning descr="Parameter 'buf' is never used">buf</warning>, String... filePaths) {
this.filePaths = filePaths;
}
protected abstract HighlightTestInfo doTest();
}
class StreamMain {
private Disposable <warning descr="Private field 'testRootDisposable' is never assigned">testRootDisposable</warning>;
public HighlightTestInfo testFile(String... filePath) {
return new HighlightTestInfo(getTestRootDisposable(), filePath) {
public HighlightTestInfo doTest() {
return this;
}
};
}
public Disposable getTestRootDisposable() {
return testRootDisposable;
}
}
interface Disposable {
void dispose();
interface Parent extends Disposable {
void beforeTreeDispose();
}
}