Skip to content

Commit

Permalink
more tests and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Dec 31, 2022
1 parent f300953 commit f43a69a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nullaway/src/test/java/com/uber/nullaway/NullAwayCoreTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,20 @@ public void typeUseAnnotationOnArray() {
.addSourceLines(
"Test.java",
"package com.uber;",
"import java.util.Set;",
"import org.checkerframework.checker.nullness.qual.Nullable;",
"class Test {",
" // ok only for backwards compat",
" @Nullable Object[] foo1 = null;",
" // ok according to spec",
" Object @Nullable[] foo2 = null;",
" // ok only for backwards compat",
" @Nullable Object [][] foo3 = null;",
" // ok according to spec",
" Object @Nullable [][] foo4 = null;",
" // NOT ok; @Nullable applies to first array dimension",
" // BUG: Diagnostic contains: assigning @Nullable expression",
" Object [] @Nullable [] foo5 = null;",
"}")
.doTest();
}
Expand Down

0 comments on commit f43a69a

Please sign in to comment.