aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-12 18:30:53 +0200
commit89bacb9c25a58454ff1878e67f7ea07ffc8c269f (patch)
tree51f1ff6c66aebe1b6109b1cffcc2bb8e4cf760a3 /tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
parenta0fa33deafbea1bf53edc068c5ed9db5592822f9 (diff)
downloaddotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.gz
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.tar.bz2
dotty-89bacb9c25a58454ff1878e67f7ea07ffc8c269f.zip
Run tests as they were in scala.
Diffstat (limited to 'tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala')
-rw-r--r--tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
new file mode 100644
index 000000000..a865f4d13
--- /dev/null
+++ b/tests/pending/run/typetags_without_scala_reflect_typetag_manifest_interop.scala
@@ -0,0 +1,47 @@
+import scala.tools.partest._
+import scala.tools.nsc.Settings
+
+object Test extends StoreReporterDirectTest {
+ def code = ???
+
+ def library = """
+ import scala.reflect.runtime.universe._
+
+ trait Library {
+ type T
+ implicit val tt: TypeTag[T]
+ }
+ """
+ def compileLibrary() = {
+ val classpath = List(sys.props("partest.lib"), sys.props("partest.reflect")) mkString sys.props("path.separator")
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(library)
+ }
+
+ def app = """
+ trait App extends Library {
+ // tries to create a manifest from a type tag without having scala-reflect.jar on the classpath
+ // even though it's possible to convert a type tag into a manifest, this will fail
+ // because conversion requires classes from scala-reflect.jar
+ //
+ // in this test we make sure that the compiler doesn't crash
+ // but just displays several missing class file errors and an unavailable implicit message
+ manifest[T]
+ }
+ """
+ def compileApp() = {
+ val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
+ val global = newCompiler("-cp", classpath, "-d", testOutput.path)
+ compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(app)
+ //global.reporter.ERROR.foreach(println)
+ }
+
+ def show(): Unit = {
+ compileLibrary();
+ println(filteredInfos.mkString("\n"))
+ storeReporter.infos.clear()
+ compileApp();
+ // we should get "missing or invalid dependency detected" errors, because we're trying to use an implicit that can't be unpickled
+ // but we don't know the number of these errors and their order, so I just ignore them all
+ println(filteredInfos.filterNot (_.msg.contains("missing or invalid dependency detected")).mkString("\n"))
+ }
+}