Closed panacekcz closed 6 years ago
When two indices are merged using Math.max, the result is also an index.
Math.max
void m(int[] a, @IndexFor("#1") int i1, @IndexFor("#1") int i2){ int v = a[Math.max(i1,i2)]; }
Will a polymorphic qualifier work?
A solution based on polymorphic qualifier or special handling in the checker should be easy. Might also apply to Math.min and others.
Math.min
Math.min already has a special support. https://github.com/typetools/checker-framework/blob/951cb42b38faac05d9419ade07be87893643dd5c/checker/src/org/checkerframework/checker/index/upperbound/UpperBoundAnnotatedTypeFactory.java#L411
Fixed by typetools#1472.
When two indices are merged using
Math.max
, the result is also an index.Will a polymorphic qualifier work?