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
Consider the following code, which is checked in as checker/tests/index/Issue3207.java:
import org.checkerframework.checker.index.qual.LTLengthOf;
import org.checkerframework.common.value.qual.MinLen;
public class Issue3207 {
void m(int @MinLen(1) [] arr) {
@LTLengthOf("arr") int j = 0;
}
void m2(int @MinLen(1) [] @MinLen(1) [] arr) {
@LTLengthOf("arr[0]") int j = 0;
}
void m3(int @MinLen(1) [] @MinLen(1) [] arr) {
int @MinLen(1) [] arr0 = arr[0];
@LTLengthOf("arr0") int j = 0;
}
}
The Index Checker issues the following error for method m2:
Issue3207.java:15: error: [assignment.type.incompatible] incompatible types in assignment.
@LTLengthOf("arr[0]") int j = 0;
^
found : @UpperBoundUnknown int
required: @LTLengthOf(value="arr[0]") int
1 error
I believe the problem is in UpperBoundVisitor.relaxedCommonAssignment. Its documentation lists two heuristics, but the first one seems to apply only to NEW_ARRAY expressions rather than all expressions of type @MinLen(...).
The text was updated successfully, but these errors were encountered:
Consider the following code, which is checked in as
checker/tests/index/Issue3207.java
:The Index Checker issues the following error for method
m2
:I believe the problem is in
UpperBoundVisitor.relaxedCommonAssignment
. Its documentation lists two heuristics, but the first one seems to apply only toNEW_ARRAY
expressions rather than all expressions of type@MinLen(...)
.The text was updated successfully, but these errors were encountered: