diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/abstypetags_serialize.check | 2 | ||||
-rw-r--r-- | test/files/run/abstypetags_serialize.scala | 32 | ||||
-rw-r--r-- | test/files/run/exprs_serialize.check | 2 | ||||
-rw-r--r-- | test/files/run/exprs_serialize.scala | 28 | ||||
-rw-r--r-- | test/files/run/macro-typecheck-macrosdisabled.check | 5 | ||||
-rw-r--r-- | test/files/run/macro-typecheck-macrosdisabled2.check | 5 | ||||
-rw-r--r-- | test/files/run/toolbox_typecheck_macrosdisabled.check | 5 | ||||
-rw-r--r-- | test/files/run/toolbox_typecheck_macrosdisabled2.check | 5 | ||||
-rw-r--r-- | test/files/run/typetags_serialize.check | 2 | ||||
-rw-r--r-- | test/files/run/typetags_serialize.scala | 28 |
10 files changed, 94 insertions, 20 deletions
diff --git a/test/files/run/abstypetags_serialize.check b/test/files/run/abstypetags_serialize.check new file mode 100644 index 0000000000..aafb4761ad --- /dev/null +++ b/test/files/run/abstypetags_serialize.check @@ -0,0 +1,2 @@ +java.io.NotSerializableException: Test$$typecreator1$1
+java.io.NotSerializableException: Test$$typecreator2$1
diff --git a/test/files/run/abstypetags_serialize.scala b/test/files/run/abstypetags_serialize.scala new file mode 100644 index 0000000000..5b9142f6d5 --- /dev/null +++ b/test/files/run/abstypetags_serialize.scala @@ -0,0 +1,32 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends App { + def test(tag: AbsTypeTag[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(tag) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val retag = in.readObject().asInstanceOf[scala.reflect.basis.AbsTypeTag[_]].in(cm) + in.close() + fin.close() + + println(retag) + } catch { + case ex: Exception => + println(ex) + } + + def qwe[T, U[_]] = { + test(implicitly[AbsTypeTag[T]]) + test(implicitly[AbsTypeTag[U[String]]]) + } + + qwe +}
\ No newline at end of file diff --git a/test/files/run/exprs_serialize.check b/test/files/run/exprs_serialize.check new file mode 100644 index 0000000000..a3bf9ccdc4 --- /dev/null +++ b/test/files/run/exprs_serialize.check @@ -0,0 +1,2 @@ +java.io.NotSerializableException: Test$$treecreator1$1
+java.io.NotSerializableException: Test$$treecreator2$1
diff --git a/test/files/run/exprs_serialize.scala b/test/files/run/exprs_serialize.scala new file mode 100644 index 0000000000..075c902a34 --- /dev/null +++ b/test/files/run/exprs_serialize.scala @@ -0,0 +1,28 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends App { + def test(expr: Expr[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(expr) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val reexpr = in.readObject().asInstanceOf[scala.reflect.basis.Expr[_]].in(cm) + in.close() + fin.close() + + println(reexpr) + } catch { + case ex: Exception => + println(ex) + } + + test(reify(2)) + test(reify{def foo = "hello"; foo + "world!"}) +}
\ No newline at end of file diff --git a/test/files/run/macro-typecheck-macrosdisabled.check b/test/files/run/macro-typecheck-macrosdisabled.check index da1a28bc24..c560b0e4b5 100644 --- a/test/files/run/macro-typecheck-macrosdisabled.check +++ b/test/files/run/macro-typecheck-macrosdisabled.check @@ -8,11 +8,6 @@ ()
};
def apply[U >: Nothing <: scala.reflect.base.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): U#Tree = {
- val $u: scala.reflect.api.Universe = $m$untyped.universe.asInstanceOf[scala.reflect.api.Universe];
- val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
- $treecreator1.this.applyImpl[$u.type]($m).asInstanceOf[U#Tree]
- };
- private def applyImpl[U >: Nothing <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): scala.reflect.base.Universe#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Literal.apply($u.Constant.apply(2))
diff --git a/test/files/run/macro-typecheck-macrosdisabled2.check b/test/files/run/macro-typecheck-macrosdisabled2.check index 908fb65bb3..55e7913250 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2.check +++ b/test/files/run/macro-typecheck-macrosdisabled2.check @@ -8,11 +8,6 @@ ()
};
def apply[U >: Nothing <: scala.reflect.base.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): U#Tree = {
- val $u: scala.reflect.api.Universe = $m$untyped.universe.asInstanceOf[scala.reflect.api.Universe];
- val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
- $treecreator1.this.applyImpl[$u.type]($m).asInstanceOf[U#Tree]
- };
- private def applyImpl[U >: Nothing <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): scala.reflect.base.Universe#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.newTermName("Array")), $u.newTermName("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2))))
diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.check b/test/files/run/toolbox_typecheck_macrosdisabled.check index f4a67e3054..9cf101c69d 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled.check +++ b/test/files/run/toolbox_typecheck_macrosdisabled.check @@ -8,11 +8,6 @@ ()
};
def apply[U <: scala.reflect.base.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): U#Tree = {
- val $u: scala.reflect.api.Universe = $m$untyped.universe.asInstanceOf[scala.reflect.api.Universe];
- val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
- $treecreator1.this.applyImpl[$u.type]($m).asInstanceOf[U#Tree]
- };
- private def applyImpl[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): scala.reflect.base.Universe#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Literal.apply($u.Constant.apply(2))
diff --git a/test/files/run/toolbox_typecheck_macrosdisabled2.check b/test/files/run/toolbox_typecheck_macrosdisabled2.check index fa55a09c40..d344e33180 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled2.check +++ b/test/files/run/toolbox_typecheck_macrosdisabled2.check @@ -8,11 +8,6 @@ ()
};
def apply[U <: scala.reflect.base.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): U#Tree = {
- val $u: scala.reflect.api.Universe = $m$untyped.universe.asInstanceOf[scala.reflect.api.Universe];
- val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
- $treecreator1.this.applyImpl[$u.type]($m).asInstanceOf[U#Tree]
- };
- private def applyImpl[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.base.MirrorOf[U]): scala.reflect.base.Universe#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.newTermName("Array")), $u.newTermName("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2))))
diff --git a/test/files/run/typetags_serialize.check b/test/files/run/typetags_serialize.check new file mode 100644 index 0000000000..1b898250fb --- /dev/null +++ b/test/files/run/typetags_serialize.check @@ -0,0 +1,2 @@ +java.io.NotSerializableException: scala.reflect.base.TypeTags$PredefTypeCreator
+java.io.NotSerializableException: Test$$typecreator1$1
diff --git a/test/files/run/typetags_serialize.scala b/test/files/run/typetags_serialize.scala new file mode 100644 index 0000000000..3917b69a93 --- /dev/null +++ b/test/files/run/typetags_serialize.scala @@ -0,0 +1,28 @@ +import java.io._ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends App { + def test(tag: TypeTag[_]) = + try { + val fout = new ByteArrayOutputStream() + val out = new ObjectOutputStream(fout) + out.writeObject(tag) + out.close() + fout.close() + + val fin = new ByteArrayInputStream(fout.toByteArray) + val in = new ObjectInputStream(fin) + val retag = in.readObject().asInstanceOf[scala.reflect.basis.TypeTag[_]].in(cm) + in.close() + fin.close() + + println(retag) + } catch { + case ex: Exception => + println(ex) + } + + test(implicitly[TypeTag[Int]]) + test(implicitly[TypeTag[String]]) +}
\ No newline at end of file |