Skip to content

Difference in verification depending where the static method is place.  #3917

Description

@wadoon

Description

Consider the file Point3d.java. Method Point3d#test() is not verifiable, where as Use#m() is. Content-wise, they are identical.

public record Point3d(int x, int y, int z) {
    /*@ normal_behavior ensures true; requires true; */
    public static void test() {
        Point3d p = new Point3d(1, 2, 3);

        //boolean b= p.equals(p);
        // @assert b;

        //@ assert p.x() == 1;
        //@ assert p.y() == 2;
        //@ assert p.z() == 3;

        //@assert p.equals(p);

        Point3d q = new Point3d(p.x, p.y, p.z);
        //@assert p.equals(q);
        //@assert q.equals(p);
    }
}

class Use {
    /*@ normal_behavior ensures true; requires true; */
    public static void m() {
        Point3d p = new Point3d(1, 2, 3);

        //boolean b= p.equals(p);
        // @assert b;

        //@ assert p.x() == 1;
        //@ assert p.y() == 2;
        //@ assert p.z() == 3;

        //@assert p.equals(p);

        Point3d q = new Point3d(p.x, p.y, p.z);
        //@assert p.equals(q);
        //@assert q.equals(p);
    }
}

Reproducible

always

Steps to reproduce

Describe the steps needed to reproduce the issue.

  1. Load the example above.
  2. Prove Use#m() using auto
  3. Try to prove Point3d#test()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions