You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A ternary between arrays crashes: Sorts (Array Int Int) and Bool are incompatible #558
Description
A conditional expression (c ? x : y) whose branches are arrays crashes the verifier when the result is checked against a length refinement.
Minimal reproducer
importliquidjava.specification.Refinement;
publicclassTern {
staticvoidone(@Refinement("length(a) == 1") int[] a) {}
staticvoidpick(booleanb) {
int[] a = b ? newint[1] : newint[1];
one(a); // should pass
}
}
Result on main:
Error: Sorts (Array Int Int) and Bool are incompatible
If the condition mentions args (boolean b = args.length > 0; inside main), the same program instead fails with Not Found Error: Variable 'args' could not be found, which also only happens with the array ternary.
Expected
The program passes: both branches have length 1. A branch array's facts should hold for the result under that branch's condition. Found while reviewing #540.
Activity