Skip to content

A float ghost crashes the verifier: "Ghost not implemented for type float" #443

Open

Description

@CatarinaGamboa

Declaring a float ghost crashes the verifier when the ghost needs its default value. The result should be either support for the type or a proper error at the @Ghost annotation.

Reproducer:

import liquidjava.specification.Ghost;
import liquidjava.specification.StateRefinement;

@Ghost("float level")
class Tank {
    @StateRefinement(to = "true")
    public void fill() {}
}

public class Main {
    public static void main(String[] args) { Tank t = new Tank(); t.fill(); }
}

Found on main @ f7f366c (also on 1a506fe):

Exception in thread "main" java.lang.RuntimeException:
Error while checking CtConstructorImpl
  on null
  at (no source position: CtConstructorImpl)
  with Ghost not implemented for type float
	at liquidjava.processor.refinement_checker.TypeChecker.scan(TypeChecker.java:99)
	...

int and boolean ghosts get defaults (0, false); double was not tried. Expected: a default for float too (or a user-facing error naming the supported ghost types).

Found while cataloguing spec forms for co-specification (probe V19 there). Low priority.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions