Skip to content

Commit e1fdda8

Browse files
committed
another test
1 parent cc54c7f commit e1fdda8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

nullaway/src/test/java/com/uber/nullaway/jspecify/GenericMethodLambdaOrMethodRefArgTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,28 @@ static void test() {
435435
.doTest();
436436
}
437437

438+
@Test
439+
public void genericMethodMethodRefWildCard() {
440+
makeHelperWithInferenceFailureWarning()
441+
.addSourceLines(
442+
"Test.java",
443+
"""
444+
import org.jspecify.annotations.*;
445+
import java.util.function.Function;
446+
@NullMarked
447+
class Test {
448+
class Foo<T extends @Nullable Object> {}
449+
static <T, R> R invokeWithReturn(Function <? super T, ? extends @Nullable R> mapper) {
450+
throw new RuntimeException();
451+
}
452+
static @Nullable String m(Integer i) { throw new RuntimeException(); }
453+
static void test() {
454+
String x = invokeWithReturn(Test::m);
455+
}
456+
}""")
457+
.doTest();
458+
}
459+
438460
private CompilationTestHelper makeHelperWithInferenceFailureWarning() {
439461
return makeTestHelperWithArgs(
440462
JSpecifyJavacConfig.withJSpecifyModeArgs(

0 commit comments

Comments
 (0)