Skip to content

Commit

Permalink
Add test for type arguments in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
oxkitsune authored and Stephan202 committed May 25, 2023
1 parent 0dcb8c1 commit d0452ab
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ void matches() {
" return new ArrayList<>();",
" }",
"",
" Foo negative4() {",
" return new Foo(\"foo\");",
" }",
"",
" <E> ImmutableSet<E> positive1() {",
" // BUG: Diagnostic contains:",
" return ImmutableSet.<E>builder().build();",
Expand All @@ -40,9 +44,26 @@ void matches() {
" return new ImmutableSet.Builder<E>().build();",
" }",
"",
" Foo positive3() {",
" // BUG: Diagnostic contains:",
" return new <List<Object>>Foo(List.of());",
" }",
"",
" private static <T> T alwaysNull() {",
" return null;",
" }",
"",
" public static class Foo {",
" private final Object value;",
"",
" public Foo(Object value) {",
" this.value = value;",
" }",
"",
" public <E extends List<Object>> Foo(E value) {",
" this.value = value;",
" }",
" }",
"}")
.doTest();
}
Expand Down

0 comments on commit d0452ab

Please sign in to comment.