Skip to content

Program incorrectly rejected #536

Open

Description

@Cz-zbj

Description
This program should be accepted, the counter example is wrong:

-1/2 * -2 really is ==1.

Minimal reproducer

public class MethodRefinementExample {

    @Refinement("_ == a / b")
    public static int divide(int a, @Refinement("b != 0") int b) {
        return a / b;
    }

    @Refinement("_ == a")
    public static int what(int a, @Refinement("b != 0") int b, @Refinement("c == a / b") int c) {
        return c*b;
    }

    public static void main(String[] args) {
        int result = divide(6, 2);
        int result2 = what(6, 2, 3);
        System.out.println(result);
    }
}

Environment

  • LiquidJava version / commit: 0.07
  • Java version (java -version):
openjdk 21.0.13.0.3 2026-10-24
OpenJDK Runtime Environment (build 21.0.13.0.3+1-1-24.04.1-Ubuntu)
OpenJDK 64-Bit Server VM (build 21.0.13.0.3+1-1-24.04.1-Ubuntu, mixed mode, sharing)
  • OS: linux

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

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions