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
tests
  • Loading branch information
msridhar committed Apr 11, 2025
commit 7cb0f47f3ec0e1b9be3df7fd728e3293689c1a4e
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,45 @@ public void issue1129() {
.doTest();
}

@Test
public void callWithConstructorReceiver() {
makeHelper()
.addSourceLines(
"Test.java",
"import org.jspecify.annotations.NullMarked;",
"import org.jspecify.annotations.Nullable;",
"@NullMarked",
"public class Test {",
" private static class Inner<T extends @Nullable Object> {",
" Inner<T> identity() { return this; }",
" }",
" Inner<@Nullable Object> mThing = new Inner<@Nullable Object>().identity();",
"}")
.doTest();
}

@Test
public void newNullableWithArg() {
makeHelper()
.addSourceLines(
"Test.java",
"import org.jspecify.annotations.NullMarked;",
"import org.jspecify.annotations.Nullable;",
"@NullMarked",
"public class Test {",
" private static class Wrapper<T extends @Nullable String> {",
" private final T value;",
" Wrapper(T value) {",
" this.value = value;",
" }",
" }",
" Wrapper<@Nullable String> testConstructorCall() {",
" return new Wrapper<@Nullable String>(null);",
" }",
"}")
.doTest();
}

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