Skip to content

Commit

Permalink
Actually test that hasExtraParameterForEnclosingInstance works.
Browse files Browse the repository at this point in the history
It does, but I got confused in #4225.

PiperOrigin-RevId: 594123682
  • Loading branch information
cpovirk authored and Error Prone Team committed Dec 28, 2023
1 parent 21c190a commit 5fa727a
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,22 @@ public void negativeNullMarkedTypeVariable() {
"}")
.doTest();
}

@Test
public void negativePrimitiveButEnclosingClass() {
conservativeHelper
.addSourceLines(
"Foo.java",
"import java.util.Optional;",
"class Foo {",
" class Bar {",
" Bar(int i) {}",
" }",
" void foo(Optional<Integer> o) {",
// It would be nice to catch this, but for now, at least, we don't.
" new Bar(o.orElse(null));",
" }",
"}")
.doTest();
}
}

0 comments on commit 5fa727a

Please sign in to comment.