diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-09-11 11:40:57 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-09-11 11:40:57 -0700 |
commit | c71182816a97fefcc0a9bb14a8eb5509743010e1 (patch) | |
tree | a2bca956e1e2d7f4d68e0faf45c5de36cac26101 /test/files | |
parent | 1015d129a5ce69aad8c273734b23e35c7648b686 (diff) | |
parent | a1796aa5ed280203c1bfc086ee5a368ae628611d (diff) | |
download | scala-c71182816a97fefcc0a9bb14a8eb5509743010e1.tar.gz scala-c71182816a97fefcc0a9bb14a8eb5509743010e1.tar.bz2 scala-c71182816a97fefcc0a9bb14a8eb5509743010e1.zip |
Merge pull request #2923 from retronym/ticket/7825
SI-7825 Consider DEFAULTMETHOD when refchecking concreteness
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t7398.scala | 6 | ||||
-rw-r--r-- | test/files/run/t7825.scala | 34 |
2 files changed, 36 insertions, 4 deletions
diff --git a/test/files/run/t7398.scala b/test/files/run/t7398.scala index dd59697b71..493c4dcf40 100644 --- a/test/files/run/t7398.scala +++ b/test/files/run/t7398.scala @@ -3,11 +3,9 @@ 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") { + override lazy val units: List[CompilationUnit] = { + // This test itself does not depend on JDK8. javaCompilationUnits(global)(defaultMethodSource) - } otherwise { - Nil } private def defaultMethodSource = """ diff --git a/test/files/run/t7825.scala b/test/files/run/t7825.scala new file mode 100644 index 0000000000..65ca06fdfc --- /dev/null +++ b/test/files/run/t7825.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ + +object Test extends CompilerTest { + import global._ + + override lazy val units: List[CompilationUnit] = { + // We can test this on JDK6. + javaCompilationUnits(global)(defaultMethodSource) ++ compilationUnits(global)(scalaExtendsDefault) + } + + private def defaultMethodSource = """ +public interface Iterator<E> { + boolean hasNext(); + E next(); + default void remove() { + throw new UnsupportedOperationException("remove"); + } +} + """ + + private def scalaExtendsDefault = """ +object Test { + object X extends Iterator[String] { + def hasNext = true + def next = "!" + } +} + """ + + // We're only checking we that the Scala compilation unit passes refchecks + // No further checks are needed here. + def check(source: String, unit: global.CompilationUnit): Unit = { + } +} |