diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/existentials3.check | 24 | ||||
-rw-r--r-- | test/files/run/existentials3.check.temporarily.disabled | 22 | ||||
-rw-r--r-- | test/files/run/existentials3.scala (renamed from test/files/run/existentials3.scala.temporarily.disabled) | 20 | ||||
-rw-r--r-- | test/files/run/t1195.check | 6 | ||||
-rw-r--r-- | test/files/run/t1195.check.temporarily.disabled | 6 | ||||
-rw-r--r-- | test/files/run/t1195.scala (renamed from test/files/run/t1195.scala.temporarily.disabled) | 4 | ||||
-rw-r--r-- | test/files/run/t3507.check | 1 | ||||
-rw-r--r-- | test/files/run/t3507.scala | 15 | ||||
-rw-r--r-- | test/files/run/t3835.scala | 9 | ||||
-rw-r--r-- | test/files/run/t4110.check | 2 | ||||
-rw-r--r-- | test/files/run/t4110.check.temporarily.disabled | 2 | ||||
-rw-r--r-- | test/files/run/t4110.scala (renamed from test/files/run/t4110.scala.temporarily.disabled) | 0 | ||||
-rw-r--r-- | test/files/run/treePrint.check (renamed from test/files/run/treePrint.check.temporarily.disabled) | 0 | ||||
-rw-r--r-- | test/files/run/treePrint.scala (renamed from test/files/run/treePrint.scala.temporarily.disabled) | 11 |
14 files changed, 76 insertions, 46 deletions
diff --git a/test/files/run/existentials3.check b/test/files/run/existentials3.check new file mode 100644 index 0000000000..8227d77909 --- /dev/null +++ b/test/files/run/existentials3.check @@ -0,0 +1,24 @@ +ConcreteTypeTag[Bar.type], t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=f5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with A with Test.ToS
+ConcreteTypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
+ConcreteTypeTag[Bar.type], t=TypeRef, s= <: scala.runtime.AbstractFunction0[Bar] with Serializable{case def unapply(x$0: Bar): Boolean} with Singleton
+ConcreteTypeTag[Bar], t=TypeRef, s= <: Test.ToS with Product with Serializable{def copy(): Bar}
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g3
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g4
+ConcreteTypeTag[Test.ToS], t=RefinedType, s=g5
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[() => Test.ToS], t=TypeRef, s=class Function0
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with Test.ToS
+ConcreteTypeTag[$anon], t=TypeRef, s= <: B with A with Test.ToS
+ConcreteTypeTag[List[Object{type T1}#T1]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[Int]]], t=TypeRef, s=class List
+ConcreteTypeTag[List[Seq[U forSome { type U <: Int }]]], t=TypeRef, s=class List
diff --git a/test/files/run/existentials3.check.temporarily.disabled b/test/files/run/existentials3.check.temporarily.disabled deleted file mode 100644 index 36a458dacc..0000000000 --- a/test/files/run/existentials3.check.temporarily.disabled +++ /dev/null @@ -1,22 +0,0 @@ -_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object -_ <: Object with Test$ToS with scala.Product with scala.Serializable -Object with Test$ToS -Object with Test$ToS -Object with Test$ToS -scala.Function0[Object with Test$ToS] -scala.Function0[Object with Test$ToS] -_ <: Object with _ <: Object with Object with Test$ToS -_ <: Object with _ <: Object with _ <: Object with Test$ToS -scala.collection.immutable.List[Object with scala.collection.Seq[Int]] -scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] -_ <: scala.runtime.AbstractFunction0[_ <: Object with Test$ToS with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object -_ <: Object with Test$ToS with scala.Product with scala.Serializable -Object with Test$ToS -Object with Test$ToS -Object with Test$ToS -scala.Function0[Object with Test$ToS] -scala.Function0[Object with Test$ToS] -_ <: Object with _ <: Object with Object with Test$ToS -_ <: Object with _ <: Object with _ <: Object with Test$ToS -scala.collection.immutable.List[Object with scala.collection.Seq[Int]] -scala.collection.immutable.List[Object with scala.collection.Seq[_ <: Int]] diff --git a/test/files/run/existentials3.scala.temporarily.disabled b/test/files/run/existentials3.scala index bb80d366cc..d6d5612687 100644 --- a/test/files/run/existentials3.scala.temporarily.disabled +++ b/test/files/run/existentials3.scala @@ -11,11 +11,11 @@ object Test { def f8 = { trait A ; trait B extends A ; class C extends B with ToS; new C { } } def f9 = { trait A ; trait B ; class C extends B with A with ToS; new C { } } - + def f10 = { class A { type T1 } ; List[A#T1]() } def f11 = { abstract class A extends Seq[Int] ; List[A]() } def f12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } - + val g1 = { case class Bar() extends ToS; Bar } val g2 = { case class Bar() extends ToS; Bar() } val g3 = { class Bar() extends ToS; object Bar extends ToS; Bar } @@ -30,10 +30,16 @@ object Test { val g10 = { class A { type T1 } ; List[A#T1]() } val g11 = { abstract class A extends Seq[Int] ; List[A]() } val g12 = { abstract class A extends Seq[U forSome { type U <: Int }] ; List[A]() } - - def m[T: Manifest](x: T) = println(manifest[T]) - + + def printTag(t: TypeTag[_]) = { + val s = if (t.sym.isFreeType) t.sym.typeSignature.toString else t.sym.toString + println("%s, t=%s, s=%s".format(t, t.tpe.kind, s)) + } + def m[T: ConcreteTypeTag](x: T) = printTag(concreteTypeTag[T]) + def m2[T: TypeTag](x: T) = printTag(typeTag[T]) + // manifests don't work for f10/g10 + // oh, they do now :) def main(args: Array[String]): Unit = { m(f1) m(f2) @@ -44,7 +50,7 @@ object Test { m(f7) m(f8) m(f9) - // m(f10) + m2(f10) m(f11) m(f12) m(g1) @@ -56,7 +62,7 @@ object Test { m(g7) m(g8) m(g9) - // m(g10) + m2(g10) m(g11) m(g12) } diff --git a/test/files/run/t1195.check b/test/files/run/t1195.check new file mode 100644 index 0000000000..554e3fd03d --- /dev/null +++ b/test/files/run/t1195.check @@ -0,0 +1,6 @@ +ConcreteTypeTag[Bar.type], underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton
+ConcreteTypeTag[Bar], underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int; def _1: Int}
+ConcreteTypeTag[Product with Serializable], underlying = Product with Serializable
+ConcreteTypeTag[Bar.type], underlying = <: scala.runtime.AbstractFunction1[Int,Bar] with Serializable{case def unapply(x$0: Bar): Option[Int]} with Singleton
+ConcreteTypeTag[Bar], underlying = <: Product with Serializable{val x: Int; def copy(x: Int): Bar; def copy$default$1: Int; def _1: Int}
+ConcreteTypeTag[Product with Serializable], underlying = Product with Serializable
diff --git a/test/files/run/t1195.check.temporarily.disabled b/test/files/run/t1195.check.temporarily.disabled deleted file mode 100644 index d023bc91f7..0000000000 --- a/test/files/run/t1195.check.temporarily.disabled +++ /dev/null @@ -1,6 +0,0 @@ -_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object -_ <: Object with scala.Product with scala.Serializable -Object with scala.Product with scala.Serializable -_ <: scala.runtime.AbstractFunction1[Int, _ <: Object with scala.Product with scala.Serializable] with scala.Serializable with java.lang.Object -_ <: Object with scala.Product with scala.Serializable -Object with scala.Product with scala.Serializable diff --git a/test/files/run/t1195.scala.temporarily.disabled b/test/files/run/t1195.scala index 81ef5bdb0e..93b1dcbd07 100644 --- a/test/files/run/t1195.scala.temporarily.disabled +++ b/test/files/run/t1195.scala @@ -6,8 +6,8 @@ object Test { val f1 = f() val g1 = g() val h1 = h() - - def m[T: Manifest](x: T) = println(manifest[T]) + + def m[T: Manifest](x: T) = println(manifest[T] + ", underlying = " + manifest[T].sym.typeSignature) def main(args: Array[String]): Unit = { m(f) diff --git a/test/files/run/t3507.check b/test/files/run/t3507.check new file mode 100644 index 0000000000..50ab029592 --- /dev/null +++ b/test/files/run/t3507.check @@ -0,0 +1 @@ +ConcreteTypeTag[_1.type#b.c.type]
diff --git a/test/files/run/t3507.scala b/test/files/run/t3507.scala new file mode 100644 index 0000000000..3cdd40a881 --- /dev/null +++ b/test/files/run/t3507.scala @@ -0,0 +1,15 @@ +class A { + object b { + object c + } + def m = b.c +} + +object Test extends App { + var a: A = new A // mutable + val c /*: object _1.b.c forSome { val _1: A } */ = a.m // widening using existential + + def mani[T: Manifest](x: T) = println(manifest[T]) + mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier + // --> _1 is not in scope here +}
\ No newline at end of file diff --git a/test/files/run/t3835.scala b/test/files/run/t3835.scala index 49e591195f..c120a61f6e 100644 --- a/test/files/run/t3835.scala +++ b/test/files/run/t3835.scala @@ -1,4 +1,9 @@ object Test extends App { - println((1, 2, 3) match { case (r, \u03b8, \u03c6) => r + \u03b8 + \u03c6 }) - println(1 match { case \u00e9 => \u00e9 }) + // work around optimizer bug SI-5672 -- generates wrong bytecode for switches in arguments + // virtpatmat happily emits a switch for a one-case switch, whereas -Xoldpatmat did not + // this is not the focus of this test, hence the temporary workaround + def a = (1, 2, 3) match { case (r, \u03b8, \u03c6) => r + \u03b8 + \u03c6 } + println(a) + def b = (1 match { case \u00e9 => \u00e9 }) + println(b) } diff --git a/test/files/run/t4110.check b/test/files/run/t4110.check new file mode 100644 index 0000000000..28f220e1fe --- /dev/null +++ b/test/files/run/t4110.check @@ -0,0 +1,2 @@ +ConcreteTypeTag[Test.A with Test.B]
+ConcreteTypeTag[Test.A with Test.B]
diff --git a/test/files/run/t4110.check.temporarily.disabled b/test/files/run/t4110.check.temporarily.disabled deleted file mode 100644 index 8b005989de..0000000000 --- a/test/files/run/t4110.check.temporarily.disabled +++ /dev/null @@ -1,2 +0,0 @@ -Object with Test$A with Test$B -Object with Test$A with Test$B diff --git a/test/files/run/t4110.scala.temporarily.disabled b/test/files/run/t4110.scala index 4bd377b73e..4bd377b73e 100644 --- a/test/files/run/t4110.scala.temporarily.disabled +++ b/test/files/run/t4110.scala diff --git a/test/files/run/treePrint.check.temporarily.disabled b/test/files/run/treePrint.check index 3360815ac1..3360815ac1 100644 --- a/test/files/run/treePrint.check.temporarily.disabled +++ b/test/files/run/treePrint.check diff --git a/test/files/run/treePrint.scala.temporarily.disabled b/test/files/run/treePrint.scala index e0332a705f..4a80e2824d 100644 --- a/test/files/run/treePrint.scala.temporarily.disabled +++ b/test/files/run/treePrint.scala @@ -4,7 +4,7 @@ object Test { import scala.tools.nsc._ import interpreter._ import java.io.{ OutputStream, BufferedReader, StringReader, PrintWriter, Writer, OutputStreamWriter} - + val code = """ def foo = { var q: Boolean = false @@ -22,11 +22,11 @@ object Test { else 20 } else 30 - + (x == 5) || !q || true } - """ - + """ + class NullOutputStream extends OutputStream { def write(b: Int) { } } def main(args: Array[String]) { @@ -35,7 +35,8 @@ object Test { settings.Ycompacttrees.value = true val intp = new IMain(settings, new PrintWriter(new NullOutputStream)) - val power = new Power(intp, new ReplVals { }) + val vals = new ReplVals { } + val power = new Power(intp, vals) intp.interpret("""def initialize = "Have to interpret something or we get errors." """) power trees code foreach println } |