Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test case
  • Loading branch information
msridhar committed May 10, 2025
commit 71e1cd9fa6be947cf1539db00e88dd696963135c
Original file line number Diff line number Diff line change
Expand Up @@ -2388,6 +2388,36 @@ public void newNullableWithArgAndConstructorType() {
.doTest();
}

@Test
public void lambdaToNewNullable() {
makeHelper()
.addSourceLines(
"Foo.java",
"import org.jspecify.annotations.NullMarked;",
"import org.jspecify.annotations.Nullable;",
"@NullMarked",
"class Foo {",
" interface Supplier<T extends @Nullable Object> {",
" T get();",
" }",
" static class SupplierImpl<T2 extends @Nullable Object> implements Supplier<T2> {",
" Supplier<T2> impl;",
" SupplierImpl(Supplier<T2> delegate) {",
" impl = delegate;",
" }",
" @Override",
" public T2 get() {",
" return impl.get();",
" }",
" }",
" static void main() {",
" Supplier<@Nullable Foo> sup = () -> null;",
" new SupplierImpl<@Nullable Foo>(sup);",
" }",
"}")
.doTest();
}

@Test
public void issue1156() {
makeHelper()
Expand Down