summaryrefslogtreecommitdiff
path: root/test/files/run/t7398.scala
blob: dd59697b71347a2851cb45f6508d14b25c2cf8a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import scala.tools.partest._

object Test extends CompilerTest {
  import global._

  // This way we auto-pass on non-java8 since there's nothing to check
  override lazy val units: List[CompilationUnit]  = testUnderJavaAtLeast("1.8") {
    javaCompilationUnits(global)(defaultMethodSource)
  } otherwise {
    Nil
  }

  private def defaultMethodSource = """
public interface Iterator<E> {
    boolean hasNext();
    E next();
    default void remove() {
        throw new UnsupportedOperationException("remove");
    }
    default void forEachRemaining(Consumer<? super E> action) {
        throw new UnsupportedOperationException("forEachRemaining");
    }
}
  """

  // We're only checking we can parse it.
  def check(source: String, unit: global.CompilationUnit): Unit = ()
}