GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Variable 'this' could not be found when a ghost-refined method is called on another call's result · Issue #478 · liquid-java/liquidjava Open DescriptionSummaryA method whose parameter refinement mentions the receiver's ghost ( Minimal reproducer
import liquidjava.specification.ExternalRefinementsFor; import liquidjava.specification.Ghost; import liquidjava.specification.Refinement; import liquidjava.specification.StateRefinement; @ExternalRefinementsFor("java.util.ArrayList") @Ghost("int size") public interface ArrayListRefinements<E> { @StateRefinement(to = "size(this) == 0") void ArrayList(); @StateRefinement(to = "size(this) == size(old(this)) + 1") boolean add(E e); E get(@Refinement("_ >= 0 && _ < size(this)") int index); @Refinement("_ == size(this) && _ >= 0") int size(); }
import java.util.ArrayList; import java.util.HashMap; public class Client { public static void main(String[] args) { HashMap<String, ArrayList<String>> m = new HashMap<>(); ArrayList<String> l = new ArrayList<>(); l.add("a"); m.put("k", l); String s = m.get("k").get(0); // Not Found Error: Variable 'this' could not be found } } Expected: a refinement error at Seen on 1a506fe and Why it matters: real codeChained reads from a map of lists are common. One of five mined GitHub methods using Found while checking mined client code against JDK specs (liquid-java/co-specification, verifier probe V38). ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |