diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2017-03-03 10:34:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-03 10:34:09 +0100 |
commit | f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe (patch) | |
tree | 828b5e90a990d04eb9cecfa3b3bf4e2ca1605a14 /test/files/run | |
parent | 96a7617eb6c90f8891eb39f20a7f41a745a8e195 (diff) | |
parent | ad13063058b3492ecaf806376b75fa206c161b4a (diff) | |
download | scala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.tar.gz scala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.tar.bz2 scala-f77139532d5b6030eaa69a6ff9ed07e7ea4a4dfe.zip |
Merge pull request #5671 from retronym/topic/stubby-2
Avoid compiler crash with missing transitive dependencies
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t10171/Test.scala | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/test/files/run/t10171/Test.scala b/test/files/run/t10171/Test.scala new file mode 100644 index 0000000000..37a2cfc67f --- /dev/null +++ b/test/files/run/t10171/Test.scala @@ -0,0 +1,59 @@ +import scala.tools.partest._ +import java.io.File + +object Test extends StoreReporterDirectTest { + def code = ??? + + def compileCode(code: String) = { + val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") + compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) + } + + def library = """ +package a { + package b { + class C { class D } + } +} +package z { + class Base { + type S = String + def foo(s: S): a.b.C#D = null + } + class Sub extends Base { + def sub = "sub" + } +} + """ + + def client = """ + class Client { new z.Sub().sub } + """ + + def deleteClass(s: String) = { + val f = new File(testOutput.path, s + ".class") + assert(f.exists) + f.delete() + } + + def deletePackage(s: String) = { + val f = new File(testOutput.path, s) + assert(f.exists) + f.delete() + } + + def assertNoErrors(): Unit = { + assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n")) + storeReporter.reset() + } + def show(): Unit = { + compileCode(library) + assertNoErrors() + deleteClass("a/b/C$D") + deleteClass("a/b/C") + deletePackage("a/b") + compileCode(client) + assertNoErrors() + } +} + |