panacekcz / checker-framework

Pluggable type-checking for Java
http://checkerframework.org/
Other
0 stars 0 forks source link

Casts in Value checker #2

Open panacekcz opened 7 years ago

panacekcz commented 7 years ago
void intcasts( @IntVal(1) int i){
    @IntVal(3) int zi = (@IntVal(2) int)i;
}

ignores the cast and gives

error: [assignment.type.incompatible] incompatible types in assignment.
        @IntVal(3) int zi = (@IntVal(2) int)i;
                            ^
  found   : @IntVal(1) int
  required: @IntVal(3L) int