Skip to content

Fix Field Initialization - #281

Open
rcosta358 wants to merge 1 commit into
fix-npe-3from
fix-field-initialization
Open

Fix Field Initialization#281
rcosta358 wants to merge 1 commit into
fix-npe-3from
fix-field-initialization

Conversation

@rcosta358

Copy link
Copy Markdown
Collaborator

Description

This PR makes constructors preserve state refinements when an object is assigned directly to a class field.
Field initializers were visited but their refinement metadata was not transferred to the field’s symbolic instance.

Example

public class Test {

    private final Obj obj = new Obj();

    public void test() {
        obj.foo(); // reports state refinement error but should pass
    }
}

@Ghost("boolean ready")
class Obj {

    @StateRefinement(to = "ready(this)")
    Obj() {}

    @StateRefinement(from = "ready(this)")
    void foo() {}
}

Related Issue

None.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Checklist

  • Added/updated tests under liquidjava-example/src/main/java/testSuite/ (Correct* / Error*)
  • mvn test passes locally
  • Updated docs/README if behavior or API changed

@rcosta358 rcosta358 self-assigned this Aug 6, 2026
@rcosta358 rcosta358 added the bug Something isn't working label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant