Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Nov 19, 2023
1 parent 3a7a4c3 commit ae1cbb4
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,28 @@ public void annotationAppliedToTypeParameter() {
"import java.util.List;",
"import java.util.ArrayList;",
"import org.checkerframework.checker.nullness.qual.Nullable;",
"import org.checkerframework.checker.nullness.qual.NonNull;",
"class TypeArgumentAnnotation {",
" List<@Nullable String> fSafe = new ArrayList<>();",
" @Nullable List<String> fUnsafe = new ArrayList<>();",
" void useParamSafe(List<@Nullable String> list) {",
" list.hashCode();",
" }",
" void unsafeCall() {",
" // BUG: Diagnostic contains: passing @Nullable parameter",
" useParamSafe(null);",
" }",
" void useParamUnsafe(@Nullable List<String> list) {",
" // BUG: Diagnostic contains: dereferenced",
" list.hashCode();",
" }",
" void useParamUnsafeNonNullElements(@Nullable List<@NonNull String> list) {",
" // BUG: Diagnostic contains: dereferenced",
" list.hashCode();",
" }",
" void safeCall() {",
" useParamUnsafeNonNullElements(null);",
" }",
" void useFieldSafe() {",
" fSafe.hashCode();",
" }",
Expand Down

0 comments on commit ae1cbb4

Please sign in to comment.