Skip to content

Commit

Permalink
Handle nested anonymous classes in field initializers. Fixes #210.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmdietl committed Apr 5, 2022
1 parent 0658fd6 commit d6e0f26
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions checker/tests/tainting/NestedAnonymous.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import org.checkerframework.checker.tainting.qual.Tainted;
import org.checkerframework.checker.tainting.qual.Untainted;

class NestedAnonymous {
Object o1 = new @Tainted Object() {};
Object o2 = new Outer.@Tainted Inner() {};

// :: error: (assignment.type.incompatible)
Outer.@Untainted Inner unt = new Outer.@Tainted Inner() {};

static class Outer {
static class Inner {}
}
}
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 3.21.4-eisop2 (April ?, 2022)
**Implementation details:**

**Closed issues:**
eisop#210.


Version 3.21.4-eisop1 (April 4, 2022)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ protected TargetType[] validTargets() {
TargetType.CONSTRUCTOR_REFERENCE,
TargetType.METHOD_REFERENCE_TYPE_ARGUMENT,
TargetType.CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
TargetType.METHOD_FORMAL_PARAMETER
TargetType.METHOD_FORMAL_PARAMETER,
TargetType.CLASS_EXTENDS
};
}

Expand Down

0 comments on commit d6e0f26

Please sign in to comment.