Skip to content

Commit 8164d79

Browse files
1 parent 027d411 commit 8164d79

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/LambdaExpressionsTest.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7882,6 +7882,42 @@ public void testGHIssue625() {
78827882
);
78837883
}
78847884

7885+
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=551882
7886+
// Invalid receiver type class X; not a subtype of implementation type interface Y
7887+
public void testBug551882() {
7888+
this.runConformTest(
7889+
new String[] {
7890+
"Foo.java",
7891+
"class X {\n" +
7892+
"}\n" +
7893+
"\n" +
7894+
"interface Y {\n" +
7895+
" void foo();\n" +
7896+
"}\n" +
7897+
"\n" +
7898+
"class Z extends X implements Y {\n" +
7899+
"\n" +
7900+
" @Override\n" +
7901+
" public void foo() {\n" +
7902+
" }\n" +
7903+
" \n" +
7904+
"}\n" +
7905+
"public class Foo {\n" +
7906+
"\n" +
7907+
" <T extends X & Y> void run(T t) {\n" +
7908+
" Runnable r = t::foo;\n" +
7909+
" r.run();\n" +
7910+
" }\n" +
7911+
" \n" +
7912+
" public static void main(String[] args) {\n" +
7913+
" new Foo().run(new Z() {});\n" +
7914+
" }\n" +
7915+
"\n" +
7916+
"}\n"},
7917+
""
7918+
);
7919+
}
7920+
78857921
public static Class testClass() {
78867922
return LambdaExpressionsTest.class;
78877923
}

0 commit comments

Comments
 (0)