From eec8ba0b01ca2d7fd74faba8b1f4e187691bb3ca Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 4 Jun 2014 14:55:23 +0200 Subject: Java 6-8 agnosticism for a test Under Java 8, the output contains newly added methods in j.u.Iterator. I've created cut down, test-local versions of the relevant types to decouple. --- .../presentation/ide-bug-1000531/src/CrashOnLoad.scala | 15 +++++++++++---- .../presentation/ide-bug-1000531/src/TestIterable.java | 7 +++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 test/files/presentation/ide-bug-1000531/src/TestIterable.java (limited to 'test/files/presentation/ide-bug-1000531') diff --git a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala index 878bbfa19e..3f59282083 100644 --- a/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala +++ b/test/files/presentation/ide-bug-1000531/src/CrashOnLoad.scala @@ -1,7 +1,14 @@ /** When this files is opened within the IDE, a typing error is reported. */ -class A[B] extends java.lang.Iterable[B] { +class A[B] extends TestIterable[B] { import scala.collection.JavaConversions._ - def iterator = Iterator.empty + def iterator: other.TestIterator[Nothing] = ??? - iterator. /*!*/ -} \ No newline at end of file + iterator./*!*/ +} + +object other { + trait TestIterator[T] { + def hasNext: Boolean + def next: T + } +} diff --git a/test/files/presentation/ide-bug-1000531/src/TestIterable.java b/test/files/presentation/ide-bug-1000531/src/TestIterable.java new file mode 100644 index 0000000000..84a6fe77f1 --- /dev/null +++ b/test/files/presentation/ide-bug-1000531/src/TestIterable.java @@ -0,0 +1,7 @@ +public abstract class TestIterable { + public abstract TestIterator iterator(); + public static abstract class TestIterator { + public abstract T next(); + public abstract boolean hasNext(); + } +} -- cgit v1.2.3