Skip to content

Commit

Permalink
Add a repro test case for Iterable/Object[] overloads in `AvoidOb…
Browse files Browse the repository at this point in the history
…jectArrays`.

#klippy4apis

PiperOrigin-RevId: 518671124
  • Loading branch information
kluever authored and Error Prone Team committed Mar 22, 2023
1 parent 7f9ce8b commit baba0c5
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -76,6 +76,22 @@ public void methodParam_staticMethods() {
.doTest();
}

@Test
public void methodParam_instanceMethods_withIterableOverload() {
compilationHelper
.addSourceLines(
"IterableSubject.java",
"public class IterableSubject {",
" public final void containsAnyIn(Iterable<?> expected) {",
" }",
// TODO(b/273948064): we shouldn't fire here because there's an Iterable overload
" // BUG: Diagnostic contains: consider an Iterable<Object> instead",
" public final void containsAnyIn(Object[] expected) {",
" }",
"}")
.doTest();
}

@Test
public void returnType_instanceMethods() {
compilationHelper
Expand Down

0 comments on commit baba0c5

Please sign in to comment.