Skip to content

Commit

Permalink
Poly upDet iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
t-rasmud committed Apr 24, 2020
1 parent 872d640 commit e9403e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ protected void replace(
if (replacements.contains(factory.DET)) {
type.replaceAnnotations(replacements);
} else if (replacements.contains(factory.ORDERNONDET)
|| replacements.contains(factory.NONDET)) {
|| replacements.contains(factory.NONDET)
|| replacements.contains(factory.POLYDET_UPDET)) {
type.replaceAnnotation(factory.NONDET);
}
return;
Expand Down
12 changes: 12 additions & 0 deletions checker/tests/determinism/PolyUpDetIteration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.util.*;
import org.checkerframework.checker.determinism.qual.*;

public class PolyUpDetIteration {
void f(@PolyDet List<@PolyDet String> list) {
@PolyDet("upDet") Set<@PolyDet String> set = new HashSet<>(list);
for (String elt : set) {
// :: error: (assignment.type.incompatible)
@PolyDet("up") String s = elt;
}
}
}

0 comments on commit e9403e1

Please sign in to comment.