Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
msridhar committed Sep 29, 2023
1 parent dc76857 commit 81dbea0
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ public void nestedGenericTypes() {
" abstract R apply(P p);",
" }",
" }",
" static void positiveParam(Wrapper<@Nullable String>.Fn<String> p1) {",
" // BUG: Diagnostic contains: Cannot assign from type Test.Wrapper<@Nullable String>.Fn<String> to type Test.Wrapper<String>.Fn<String>",
" Wrapper<String>.Fn<String> p2 = p1;",
" static void param(@Nullable Wrapper<String>.Fn<String> p) {}",
" static void positiveParam() {",
" Wrapper<@Nullable String>.Fn<String> x = null;",
" // BUG: Diagnostic contains: Cannot pass parameter of type Test.Wrapper<@Nullable String>.Fn<String>",
" param(x);",
" }",
" static void positiveAssign() {",
" Wrapper<@Nullable String>.Fn<String> p1 = null;",
Expand All @@ -219,6 +221,18 @@ public void nestedGenericTypes() {
" // BUG: Diagnostic contains: Cannot return expression of type Test.Wrapper<@Nullable String>.Fn<String>",
" return p1;",
" }",
" static void negativeParam() {",
" Wrapper<String>.Fn<String> x = null;",
" param(x);",
" }",
" static void negativeAssign() {",
" Wrapper<@Nullable String>.Fn<String> p1 = null;",
" Wrapper<@Nullable String>.Fn<String> p2 = p1;",
" }",
" static @Nullable Wrapper<@Nullable String>.Fn<String> negativeReturn() {",
" Wrapper<@Nullable String>.Fn<String> p1 = null;",
" return p1;",
" }",
"}")
.doTest();
}
Expand Down Expand Up @@ -1058,7 +1072,7 @@ public void overrideExplicitlyTypedAnonymousClass() {

@Ignore("https://github.com/uber/NullAway/issues/836")
@Test
public void anonymousNestedClasses() {
public void overrideAnonymousNestedClass() {
makeHelper()
.addSourceLines(
"Test.java",
Expand Down

0 comments on commit 81dbea0

Please sign in to comment.