Description
A private static final int field used as an argument to a refined parameter produces a syntax error about ghost declarations, although the code declares no ghost.
Minimal reproducer
import liquidjava.specification.Refinement;
public class Repro {
private static final int BUFFER = 64;
static void use(@Refinement("_ > 0") int n) {}
public static void main(String[] args) {
use(BUFFER);
}
}
Expected
Correct! Passed Verification. (BUFFER == 64 > 0).
Actual
Running LiquidJava on: <repro dir>
Syntax Error: Invalid ghost declaration, expected e.g. @Ghost("int size")
Reproduced on main at 8816186 (liquidjava-verifier 0.0.35), and on 0.0.33.
Context
Found while turning real open-source Java code into study examples for the error-message study: real code hits this constantly, so the examples have to be rewritten around it or cannot be verified. Named constants are the idiomatic way to write these values, so examples had to replace them with literals.
Description
A
private static final intfield used as an argument to a refined parameter produces a syntax error about ghost declarations, although the code declares no ghost.Minimal reproducer
Expected
Correct! Passed Verification.(BUFFER == 64 > 0).Actual
Reproduced on
mainat 8816186 (liquidjava-verifier 0.0.35), and on 0.0.33.Context
Found while turning real open-source Java code into study examples for the error-message study: real code hits this constantly, so the examples have to be rewritten around it or cannot be verified. Named constants are the idiomatic way to write these values, so examples had to replace them with literals.