Skip to content

Commit

Permalink
test case for
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-herrmann committed Oct 24, 2024
1 parent 16beb44 commit f45e77e
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -646,4 +646,28 @@ public static void gain(String[] args) {
+ "A pattern variable with the same name is already defined in the statement\n"
+ "----------\n");
}

public void testGH3074() {
runNegativeTest(
new String[] {
"Example.java",
"""
class Example<T> {
private void foo(String x) {
if (x instanceof Example<String> es) {
}
}
}
"""
},
"""
----------
1. ERROR in Example.java (at line 3)
if (x instanceof Example<String> es) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Incompatible conditional operand types String and Example<String>
----------
""");
}
}

0 comments on commit f45e77e

Please sign in to comment.