| 1 |
// Test case for Issue 813 |
| 2 |
// https://github.com/typetools/checker-framework/issues/813 |
| 3 |
// @skip-test |
| 4 |
|
| 5 |
import org.checkerframework.checker.initialization.qual.NotOnlyInitialized; |
| 6 |
import org.checkerframework.checker.initialization.qual.UnderInitialization; |
| 7 |
|
| 8 |
class Issue813 { |
| 9 |
static interface MyInterface {} |
| 10 |
|
| 11 |
static class MyClass { |
| 12 |
MyClass(@UnderInitialization MyInterface stuff) {} |
| 13 |
} |
| 14 |
|
| 15 |
static class Fails implements MyInterface { |
| 16 |
@NotOnlyInitialized MyClass bar = new MyClass(this); |
| 17 |
} |
| 18 |
|
| 19 |
static class Works implements MyInterface { |
| 20 |
@NotOnlyInitialized MyClass bar; |
| 21 |
|
| 22 |
{ |
| 23 |
bar = new MyClass(this); // works |
| 24 |
} |
| 25 |
} |
| 26 |
} |