blob: 31d5eccd47a9a0c5688a202d3cd5d1d01108e8d2 [file] [log] [blame]
import org.checkerframework.checker.testchecker.wholeprograminference.qual.Sibling1;
import org.checkerframework.checker.testchecker.wholeprograminference.qual.Sibling2;
public class CompoundTypeTest {
// The default type for fields is @DefaultType.
Object[] field;
void assign() {
field = getCompoundType();
}
void test() {
// :: warning: (argument)
expectsCompoundType(field);
}
void expectsCompoundType(@Sibling1 Object @Sibling2 [] obj) {}
@Sibling1 Object @Sibling2 [] getCompoundType() {
@SuppressWarnings("cast.unsafe")
@Sibling1 Object @Sibling2 [] out = (@Sibling1 Object @Sibling2 []) new Object[1];
return out;
}
}