Debian Codegraph @

framework/tests/whole-program-inference/non-annotated/StringConcatenationTest.java

raw
1 import testlib.wholeprograminference.qual.*;
2
3 public class StringConcatenationTest {
4
5 private String options_str;
6 private String options_str2;
7
8 void foo() {
9 options_str = getSibling1();
10 options_str2 += getSibling1();
11 }
12
13 void test() {
14 // :: error: (argument.type.incompatible)
15 expectsSibling1(options_str);
16 // :: error: (argument.type.incompatible)
17 expectsSibling1(options_str2);
18 }
19
20 void expectsSibling1(@Sibling1 String t) {}
21
22 @Sibling1 String getSibling1() {
23 // :: warning: (cast.unsafe)
24 return (@Sibling1 String) " ";
25 }
26 }