Permalink
Browse files

repairs the tests after the refactoring spree

  • Loading branch information...
xeno-by committed Jun 4, 2012
1 parent d9103e0 commit 7b0f0a142bb526f4bd108a8c208ec9a8952398c9
Showing 559 changed files with 2,611 additions and 1,733 deletions.
View
@@ -1 +1 @@
-3ddb9fded6e19ca591a78b8a294284c9e945da30 ?code.jar
+e737b123d31eede5594ceda07caafed1673ec472 ?code.jar
@@ -2,25 +2,25 @@ x=(), t=ConcreteTypeTag[Unit], k=TypeRef, s=class Unit
x=true, t=ConcreteTypeTag[Boolean], k=TypeRef, s=class Boolean
x=a, t=ConcreteTypeTag[Char], k=TypeRef, s=class Char
x=1, t=ConcreteTypeTag[Int], k=TypeRef, s=class Int
-x=abc, t=ConcreteTypeTag[String], k=TypeRef, s=class String
+x=abc, t=ConcreteTypeTag[java.lang.String], k=TypeRef, s=class String
x='abc, t=ConcreteTypeTag[Symbol], k=TypeRef, s=class Symbol
x=List(()), t=ConcreteTypeTag[List[Unit]], k=TypeRef, s=class List
x=List(true), t=ConcreteTypeTag[List[Boolean]], k=TypeRef, s=class List
x=List(1), t=ConcreteTypeTag[List[Int]], k=TypeRef, s=class List
-x=List(abc), t=ConcreteTypeTag[List[String]], k=TypeRef, s=class List
+x=List(abc), t=ConcreteTypeTag[List[java.lang.String]], k=TypeRef, s=class List
x=List('abc), t=ConcreteTypeTag[List[Symbol]], k=TypeRef, s=class List
x=[Z, t=ConcreteTypeTag[Array[Boolean]], k=TypeRef, s=class Array
x=[C, t=ConcreteTypeTag[Array[Char]], k=TypeRef, s=class Array
x=[I, t=ConcreteTypeTag[Array[Int]], k=TypeRef, s=class Array
-x=[Ljava.lang.String;, t=ConcreteTypeTag[Array[String]], k=TypeRef, s=class Array
+x=[Ljava.lang.String;, t=ConcreteTypeTag[Array[java.lang.String]], k=TypeRef, s=class Array
x=[Lscala.Symbol;, t=ConcreteTypeTag[Array[Symbol]], k=TypeRef, s=class Array
x=((),()), t=ConcreteTypeTag[(Unit, Unit)], k=TypeRef, s=class Tuple2
x=(true,false), t=ConcreteTypeTag[(Boolean, Boolean)], k=TypeRef, s=class Tuple2
x=(1,2), t=ConcreteTypeTag[(Int, Int)], k=TypeRef, s=class Tuple2
-x=(abc,xyz), t=ConcreteTypeTag[(String, String)], k=TypeRef, s=class Tuple2
+x=(abc,xyz), t=ConcreteTypeTag[(java.lang.String, java.lang.String)], k=TypeRef, s=class Tuple2
x=('abc,'xyz), t=ConcreteTypeTag[(Symbol, Symbol)], k=TypeRef, s=class Tuple2
x=Test$, t=ConcreteTypeTag[Test.type], k=SingleType, s=object Test
@@ -31,8 +31,8 @@ x=Foo, t=ConcreteTypeTag[Foo[List[Int]]], k=TypeRef, s=class Foo
x=Foo, t=ConcreteTypeTag[Foo[Foo[Int]]], k=TypeRef, s=class Foo
x=Foo, t=ConcreteTypeTag[Foo[List[Foo[Int]]]], k=TypeRef, s=class Foo
-x=Test1$$anon$1, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
-x=Test1$$anon$2, t=ConcreteTypeTag[Bar[String]], k=RefinedType, s=<local Test1>
+x=Test1$$anon$1, t=ConcreteTypeTag[Bar[java.lang.String]], k=RefinedType, s=<local Test1>
+x=Test1$$anon$2, t=ConcreteTypeTag[Bar[java.lang.String]], k=RefinedType, s=<local Test1>
()=()
true=true
@@ -1,3 +1,6 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.{ClassTag, classTag}
+
object Test extends App {
Test1
Test2
@@ -58,12 +61,12 @@ object Test2 {
println("true="+load[Boolean](dump(true)))
println("a="+load[Char](dump('a')))
println("1="+load[Int](dump(1)))
- println("'abc="+load[Symbol](dump('abc)))
+ println("'abc="+load[scala.Symbol](dump('abc)))
println()
println("List(())="+load[List[Unit]](dump(List(()))))
println("List(true)="+load[List[Boolean]](dump(List(true))))
- println("List('abc)="+load[List[Symbol]](dump(List('abc))))
+ println("List('abc)="+load[List[scala.Symbol]](dump(List('abc))))
println()
def loadArray[T](x: Array[Byte])(implicit t: reflect.ClassTag[Array[T]]) =
@@ -98,12 +101,11 @@ trait TestUtil {
val in = new ObjectInputStream(new ByteArrayInputStream(buffer))
in.readObject().asInstanceOf[A]
}
- import scala.reflect._
def print[T](x: T)(implicit t: ConcreteTypeTag[T]) {
// todo. type tags are not yet serializable
// val t1: ConcreteTypeTag[T] = read(write(t))
val t1: ConcreteTypeTag[T] = t
val x1 = x.toString.replaceAll("@[0-9a-z]+$", "")
- println("x="+x1+", t="+t1+", k="+t1.tpe.kind+", s="+t1.sym.toString)
+ println("x="+x1+", t="+t1+", k="+t1.tpe.kind+", s="+t1.tpe.typeSymbol.toString)
}
-}
+}
@@ -1,3 +1,5 @@
+import scala.reflect.{ArrayTag, arrayTag}
+
//############################################################################
// Serialization
//############################################################################
@@ -648,4 +650,4 @@ object Test9_parallel {
println("Error in Test5_parallel: " + e)
throw e
}
-}
+}
@@ -1,4 +1,4 @@
-classtags_contextbound_b.scala:3: error: No ClassTag available for T
+classtags_contextbound_b.scala:5: error: No ClassTag available for T
def foo[T] = mkArray[T]
^
one error found
@@ -1,3 +1,5 @@
+import scala.reflect.{ClassTag, classTag}
+
object Test extends App {
def mkArray[T: ClassTag] = Array[T]()
def foo[T] = mkArray[T]
@@ -1,4 +1,4 @@
-classtags_contextbound_c.scala:2: error: No ArrayTag available for T
+classtags_contextbound_c.scala:4: error: No ArrayTag available for T
def mkArray[T] = Array[T]()
^
one error found
@@ -1,3 +1,5 @@
+import scala.reflect.{ClassTag, classTag}
+
object Test extends App {
def mkArray[T] = Array[T]()
def foo[T: ClassTag] = mkArray[T]
@@ -1,4 +1,4 @@
-classtags_dont_use_typetags.scala:2: error: No ArrayTag available for T
+classtags_dont_use_typetags.scala:4: error: No ArrayTag available for T
def foo[T: TypeTag] = Array[T]()
^
one error found
@@ -1,3 +1,5 @@
+import scala.reflect.runtime.universe._
+
object Test extends App {
def foo[T: TypeTag] = Array[T]()
}
@@ -1,4 +1,4 @@
-interop_classmanifests_arenot_concretetypetags.scala:3: error: No ConcreteTypeTag available for T
- println(concreteTypeTag[T])
- ^
+interop_classmanifests_arenot_concretetypetags.scala:5: error: No ConcreteTypeTag available for T
+ println(implicitly[ConcreteTypeTag[T]])
+ ^
one error found
@@ -1,6 +1,8 @@
+import scala.reflect.runtime.universe._
+
object Test extends App {
def classManifestIsnotConcreteTypeTag[T: ClassManifest] = {
- println(concreteTypeTag[T])
+ println(implicitly[ConcreteTypeTag[T]])
}
classManifestIsnotConcreteTypeTag[Int]
@@ -1,7 +1,7 @@
-interop_classtags_arenot_manifests.scala:3: error: No Manifest available for T.
+interop_classtags_arenot_manifests.scala:6: error: No Manifest available for T.
println(manifest[T])
^
-interop_classtags_arenot_manifests.scala:11: error: No Manifest available for T.
+interop_classtags_arenot_manifests.scala:14: error: No Manifest available for T.
println(manifest[T])
^
two errors found
@@ -1,3 +1,6 @@
+import scala.reflect.{ArrayTag, arrayTag}
+import scala.reflect.{ClassTag, classTag}
+
object Test extends App {
def arrayTagIsnotManifest[T: ArrayTag] = {
println(manifest[T])
@@ -0,0 +1,4 @@
+interop_concretetypetags_arenot_classmanifests.scala:5: error: could not find implicit value for parameter m: ClassManifest[T]
+ println(classManifest[T])
+ ^
+one error found
@@ -0,0 +1,11 @@
+import scala.reflect.runtime.universe._
+
+object Test extends App {
+ def concreteTypeTagIsnotClassManifest[T: ConcreteTypeTag] = {
+ println(classManifest[T])
+ }
+
+ concreteTypeTagIsnotClassManifest[Int]
+ concreteTypeTagIsnotClassManifest[String]
+ concreteTypeTagIsnotClassManifest[Array[Int]]
+}
@@ -0,0 +1,4 @@
+interop_concretetypetags_arenot_classtags.scala:6: error: No ClassTag available for T
+ println(classTag[T])
+ ^
+one error found
@@ -0,0 +1,12 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.{ClassTag, classTag}
+
+object Test extends App {
+ def concreteTypeTagIsnotClassTag[T: ConcreteTypeTag] = {
+ println(classTag[T])
+ }
+
+ concreteTypeTagIsnotClassTag[Int]
+ concreteTypeTagIsnotClassTag[String]
+ concreteTypeTagIsnotClassTag[Array[Int]]
+}
@@ -0,0 +1,6 @@
+interop_concretetypetags_without_classtags_arenot_manifests.scala:6: error: to create a manifest here, it is necessary to interoperate with the type tag `evidence$1` in scope.
+however typetag -> manifest conversion requires a class tag for the corresponding type to be present.
+to proceed add a class tag to the type `T` (e.g. by introducing a context bound) and recompile.
+ println(manifest[T])
+ ^
+one error found
@@ -0,0 +1,12 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.ClassTag
+
+object Test extends App {
+ def concreteTypeTagIsManifest[T: ConcreteTypeTag] = {
+ println(manifest[T])
+ }
+
+ concreteTypeTagIsManifest[Int]
+ concreteTypeTagIsManifest[String]
+ concreteTypeTagIsManifest[Array[Int]]
+}
@@ -1,4 +0,0 @@
-interop_erasuretags_arenot_classmanifests.scala:3: error: could not find implicit value for parameter m: ClassManifest[T]
- println(classManifest[T])
- ^
-one error found
@@ -1,9 +0,0 @@
-object Test extends App {
- def erasureTagIsnotClassManifest[T: ErasureTag] = {
- println(classManifest[T])
- }
-
- erasureTagIsnotClassManifest[Int]
- erasureTagIsnotClassManifest[String]
- erasureTagIsnotClassManifest[Array[Int]]
-}
@@ -1,4 +0,0 @@
-interop_erasuretags_arenot_manifests.scala:3: error: No Manifest available for T.
- println(manifest[T])
- ^
-one error found
@@ -1,9 +0,0 @@
-object Test extends App {
- def erasureTagIsnotManifest[T: ErasureTag] = {
- println(manifest[T])
- }
-
- erasureTagIsnotManifest[Int]
- erasureTagIsnotManifest[String]
- erasureTagIsnotManifest[Array[Int]]
-}
@@ -1,4 +1,4 @@
-interop_typetags_arenot_classmanifests.scala:3: error: could not find implicit value for parameter m: ClassManifest[T]
+interop_typetags_arenot_classmanifests.scala:5: error: could not find implicit value for parameter m: ClassManifest[T]
println(classManifest[T])
^
one error found
@@ -1,3 +1,5 @@
+import scala.reflect.runtime.universe._
+
object Test extends App {
def typeTagIsnotClassManifest[T: TypeTag] = {
println(classManifest[T])
@@ -0,0 +1,4 @@
+interop_typetags_arenot_classtags.scala:6: error: No ClassTag available for T
+ println(classTag[T])
+ ^
+one error found
@@ -0,0 +1,12 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.{ClassTag, classTag}
+
+object Test extends App {
+ def typeTagIsnotClassTag[T: TypeTag] = {
+ println(classTag[T])
+ }
+
+ typeTagIsnotClassTag[Int]
+ typeTagIsnotClassTag[String]
+ typeTagIsnotClassTag[Array[Int]]
+}
@@ -1,4 +1,4 @@
-interop_typetags_arenot_manifests.scala:3: error: No Manifest available for T.
+interop_typetags_arenot_manifests.scala:5: error: No Manifest available for T.
println(manifest[T])
^
one error found
@@ -1,3 +1,5 @@
+import scala.reflect.runtime.universe._
+
object Test extends App {
def typeTagIsnotManifest[T: TypeTag] = {
println(manifest[T])
@@ -2,21 +2,21 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
- import c.mirror._
+ import c.universe._
val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))
- Expr[Int](body)
+ c.Expr[Int](body)
}
def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
- import c.mirror._
+ import c.universe._
val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))
- Expr[Int](body)
+ c.Expr[Int](body)
}
def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = {
- import c.mirror._
+ import c.universe._
val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))
- Expr[Int](body)
+ c.Expr[Int](body)
}
}
@@ -2,10 +2,10 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def fooNullary(c: Ctx) = {
- import c.mirror._
+ import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
- Expr[Unit](body)
+ c.Expr[Unit](body)
}
def fooEmpty(c: Ctx)() = fooNullary(c)
-}
+}
@@ -2,10 +2,10 @@ import scala.reflect.makro.{Context => Ctx}
object Impls {
def fooNullary(c: Ctx) = {
- import c.mirror._
+ import c.universe._
val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))
- Expr[Unit](body)
+ c.Expr[Unit](body)
}
def fooEmpty(c: Ctx)() = fooNullary(c)
-}
+}
@@ -1,4 +1,4 @@
-Impls_1.scala:4: error: macro implementations cannot have implicit parameters other than TypeTag evidences
- def foo[U: c.TypeTag: Numeric](c: Ctx) = {
- ^
-one error found
+Impls_1.scala:5: error: macro implementations cannot have implicit parameters other than TypeTag evidences
+ def foo[U: c.TypeTag: Numeric](c: Ctx) = {
+ ^
+one error found
@@ -1,8 +1,9 @@
+import scala.reflect.runtime.universe._
import scala.reflect.makro.{Context => Ctx}
object Impls {
def foo[U: c.TypeTag: Numeric](c: Ctx) = {
- import c.mirror._
+ import c.universe._
Literal(Constant(42))
}
-}
+}
@@ -1,5 +1,3 @@
-import scala.reflect.api.{Mirror => Ctx}
-
object Impls {
def foo = ???
}
Oops, something went wrong.

0 comments on commit 7b0f0a1

Please sign in to comment.