key icon indicating copy to clipboard operation
key copied to clipboard

Assignable does not work correctly with Boxed types

Open fab918 opened this issue 1 year ago • 0 comments

Description

I was testing other basic cases and came across this problem, I didn't seem to find any issue that had already been reported.

@ assignable \nothing; should allow modification of a Boxed Type passed in parameter of a method.

Steps to reproduce

    //@ ensures \result == 4;
    //@ assignable \nothing;
    public int computeA(Integer a) {
        a = 4; // OK a is passed by value
        return a;
    }

What is your expected behavior and what was the actual behavior?

The proof doesn't succeed but it should work because, like String, Boxed types are immutable.

fab918 avatar Nov 28 '23 12:11 fab918