diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.check | 4 | ||||
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.flags | 1 | ||||
-rw-r--r-- | test/files/neg/virtpatmat_unreach_select.scala | 12 | ||||
-rw-r--r-- | test/files/pos/t5738.scala | 8 | ||||
-rw-r--r-- | test/files/pos/t5742.scala | 8 | ||||
-rw-r--r-- | test/files/run/t5816.check | 1 | ||||
-rw-r--r-- | test/files/run/t5816.scala | 17 | ||||
-rw-r--r-- | test/files/run/t5840.scala | 7 | ||||
-rw-r--r-- | test/files/run/t5881.check | 2 | ||||
-rw-r--r-- | test/files/run/t5881.scala | 6 |
10 files changed, 66 insertions, 0 deletions
diff --git a/test/files/neg/virtpatmat_unreach_select.check b/test/files/neg/virtpatmat_unreach_select.check new file mode 100644 index 0000000000..3771971020 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.check @@ -0,0 +1,4 @@ +virtpatmat_unreach_select.scala:10: error: unreachable code + case WARNING.id => // unreachable + ^ +one error found diff --git a/test/files/neg/virtpatmat_unreach_select.flags b/test/files/neg/virtpatmat_unreach_select.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/neg/virtpatmat_unreach_select.scala b/test/files/neg/virtpatmat_unreach_select.scala new file mode 100644 index 0000000000..c46ff15453 --- /dev/null +++ b/test/files/neg/virtpatmat_unreach_select.scala @@ -0,0 +1,12 @@ +class Test { + object severity extends Enumeration + class Severity(val id: Int) extends severity.Value + val INFO = new Severity(0) + val WARNING = new Severity(1) + + (0: Int) match { + case WARNING.id => + case INFO.id => // reachable + case WARNING.id => // unreachable + } +} diff --git a/test/files/pos/t5738.scala b/test/files/pos/t5738.scala new file mode 100644 index 0000000000..b8755ed66e --- /dev/null +++ b/test/files/pos/t5738.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + def f[T](a: T, b: T) = { + reify(a.toString + b) + reify(a + b.toString) + } +}
\ No newline at end of file diff --git a/test/files/pos/t5742.scala b/test/files/pos/t5742.scala new file mode 100644 index 0000000000..3d3125b5d3 --- /dev/null +++ b/test/files/pos/t5742.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + def foo[T](a: T) = reify { + val x1 = a + val x2 = reify(a) + } +}
\ No newline at end of file diff --git a/test/files/run/t5816.check b/test/files/run/t5816.check new file mode 100644 index 0000000000..920b64a50d --- /dev/null +++ b/test/files/run/t5816.check @@ -0,0 +1 @@ +5.+(Test.this.y)
diff --git a/test/files/run/t5816.scala b/test/files/run/t5816.scala new file mode 100644 index 0000000000..f0279e5703 --- /dev/null +++ b/test/files/run/t5816.scala @@ -0,0 +1,17 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + val toolbox = cm.mkToolBox() + + def printSource[T](expr: Expr[T]) { + val ttree = toolbox typeCheck expr.tree + println(ttree.toString) + } + + var y = 3 + printSource(reify { + 5 + y + }) +}
\ No newline at end of file diff --git a/test/files/run/t5840.scala b/test/files/run/t5840.scala new file mode 100644 index 0000000000..da036d5122 --- /dev/null +++ b/test/files/run/t5840.scala @@ -0,0 +1,7 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + reify { + class C[T <: String with Singleton] + } +}
\ No newline at end of file diff --git a/test/files/run/t5881.check b/test/files/run/t5881.check new file mode 100644 index 0000000000..477fb935a8 --- /dev/null +++ b/test/files/run/t5881.check @@ -0,0 +1,2 @@ +ClassTag[class scala.collection.immutable.List]
+ClassTag[class scala.collection.immutable.List]
diff --git a/test/files/run/t5881.scala b/test/files/run/t5881.scala new file mode 100644 index 0000000000..01bee29181 --- /dev/null +++ b/test/files/run/t5881.scala @@ -0,0 +1,6 @@ +import scala.reflect.ClassTag + +object Test extends App { + println(implicitly[ClassTag[List[T forSome {type T <: List[T]}]]]) + println(implicitly[ClassTag[List[Any]]]) +}
\ No newline at end of file |