-
Notifications
You must be signed in to change notification settings - Fork 428
Closed
Labels
False Positive (false warning or imprecision)enhancementgood first issueA beginner-friendly place to start contributing to the Checker FrameworkA beginner-friendly place to start contributing to the Checker Framework
Milestone
Description
Currently, the return type of Map.keySet() is Set<@KeyFor("this")>, with this appropriately viewpoint-adapted.
However, the keys should be "this" and all the keys on the receiver's key type.
A test case appears at checker/tests/nullness/KeyForMultiple.java
The current output is
$ch/bin/javac -processor nullness KeyForMultiple.java
KeyForMultiple.java:21: error: [assignment.type.incompatible] incompatible types in assignment.
Set<@KeyFor({"sharedBooks", "sharedCounts1"}) String> otherChars1 = sharedCounts1.keySet();
^
found : Set<@KeyFor("sharedCounts1") String>
required: Set<@KeyFor({"sharedBooks", "sharedCounts1"}) String>
KeyForMultiple.java:39: error: [assignment.type.incompatible] incompatible types in assignment.
Set<@KeyFor({"sharedBooks", "sharedCounts2"}) String> otherChars2 = sharedCounts2.keySet();
^
found : Set<@KeyFor("sharedCounts2") String>
required: Set<@KeyFor({"sharedBooks", "sharedCounts2"}) String>
2 errors
(This seems to be the same as issue #414, but that issue was closed as fixed, and the problem still exists.)
Metadata
Metadata
Assignees
Labels
False Positive (false warning or imprecision)enhancementgood first issueA beginner-friendly place to start contributing to the Checker FrameworkA beginner-friendly place to start contributing to the Checker Framework