framework/tests/all-systems/java8inference/Issue2975.java
raw| 1 | import java.io.Closeable; |
| 2 | import java.util.function.Consumer; |
| 3 | |
| 4 | class Issue2975<T extends AutoCloseable> { |
| 5 | static class Child extends Issue2975<Closeable> { |
| 6 | Wrapper y = new Wrapper(Child::takesCloseable); |
| 7 | |
| 8 | private static void takesCloseable(Closeable rhs) {} |
| 9 | } |
| 10 | |
| 11 | protected class Wrapper { |
| 12 | protected Wrapper() {} |
| 13 | |
| 14 | protected Wrapper(Consumer<T> makeExpression) {} |
| 15 | |
| 16 | protected Wrapper method(Consumer<T> makeExpression) { |
| 17 | throw new RuntimeException(); |
| 18 | } |
| 19 | } |
| 20 | } |