View | Details | Raw Unified | Return to bug 108783
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+29 lines)
Lines 23522-23526 Link Here
23522
		},
23522
		},
23523
		"");
23523
		"");
23524
}
23524
}
23525
// Runnable masks Iterable in multiple bounds
23526
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=108783
23527
public void test812() {
23528
  this.runConformTest(
23529
    new String[] {
23530
      "X.java",
23531
      "import java.util.Arrays;\n" +
23532
      "import java.util.Iterator;\n" +
23533
      "import java.util.List;\n" +
23534
      "\n" +
23535
      "public class X implements Iterable<String>, Runnable {\n" +
23536
      " public <T extends Runnable & Iterable<String>> void foo(T t) {\n" +
23537
      "   for (String s : t)\n" +
23538
      "     System.out.println(s);\n" +
23539
      " }\n" +
23540
      " public void run() { /* */ }\n" +
23541
      " private List<String> list = Arrays.asList(new String[] { \"a\", \"b\" });\n" +
23542
      " public Iterator<String> iterator() {\n" +
23543
      "   return this.list.iterator();\n" +
23544
      " }\n" +
23545
      " public static void main(String... args) {\n" +
23546
      "   X x = new X();\n" +
23547
      "   x.foo(x);\n" +
23548
      " }\n" +
23549
      "}"
23550
    },
23551
    "a\n" +
23552
    "b");
23553
}
23525
}
23554
}
23526
23555

Return to bug 108783