framework/tests/whole-program-inference/non-annotated/ParameterInferenceTest.java
raw| 1 | import testlib.wholeprograminference.qual.*; |
| 2 | |
| 3 | public class ParameterInferenceTest { |
| 4 | |
| 5 | void test1() { |
| 6 | @Parent int parent = (@Parent int) 0; |
| 7 | expectsParentNoSignature(parent); |
| 8 | } |
| 9 | |
| 10 | void expectsParentNoSignature(int t) { |
| 11 | // :: error: (assignment.type.incompatible) |
| 12 | @Parent int parent = t; |
| 13 | } |
| 14 | |
| 15 | void test2() { |
| 16 | @Top int top = (@Top int) 0; |
| 17 | // :: error: (argument.type.incompatible) |
| 18 | expectsTopNoSignature(top); |
| 19 | } |
| 20 | |
| 21 | void expectsTopNoSignature(int t) {} |
| 22 | } |