summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-02-12 16:06:19 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-02-12 16:06:19 -0800
commit76f167388a42e9bb8b72645d87bcb408b6981576 (patch)
tree55b62a8e1bf9d5bc908c757c2fe05e9f26ff1cf2 /test
parent14048023a1deba540502da96663deca6ca226bf6 (diff)
parentf51ed74aa3aa142c8aa9d5f9d03e0c244737f66e (diff)
downloadscala-76f167388a42e9bb8b72645d87bcb408b6981576.tar.gz
scala-76f167388a42e9bb8b72645d87bcb408b6981576.tar.bz2
scala-76f167388a42e9bb8b72645d87bcb408b6981576.zip
Merge remote-tracking branch 'scala/2.10.x' into patmat-refactor-master
Conflicts: src/compiler/scala/tools/nsc/typechecker/Implicits.scala
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t6323a.check6
-rw-r--r--test/files/pos/t6225.scala20
-rw-r--r--test/files/pos/t6514.scala11
-rw-r--r--test/files/run/t6370.scala12
-rw-r--r--test/files/run/t6935.scala14
5 files changed, 63 insertions, 0 deletions
diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check
index a80c9a0a81..4d682e5422 100644
--- a/test/files/neg/t6323a.check
+++ b/test/files/neg/t6323a.check
@@ -1,3 +1,9 @@
+t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using `package`.this.materializeClassTag[Test]()
+ val lookAtMe = m.reflect(Test("a",List(5)))
+ ^
+t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe)
+ val value = u.typeOf[Test]
+ ^
t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
failed to typecheck the materialized tag:
cannot create a TypeTag referring to local class Test.Test: use WeakTypeTag instead
diff --git a/test/files/pos/t6225.scala b/test/files/pos/t6225.scala
new file mode 100644
index 0000000000..d3d30d9e16
--- /dev/null
+++ b/test/files/pos/t6225.scala
@@ -0,0 +1,20 @@
+
+package library.x {
+ class X {
+ class Foo
+ implicit val foo: Foo = new Foo
+ }
+}
+package library {
+ package object y extends library.x.X
+}
+
+object ko {
+ import library.y.{Foo, foo}
+ implicitly[Foo]
+}
+
+object ko2 {
+ import library.y._
+ implicitly[Foo]
+}
diff --git a/test/files/pos/t6514.scala b/test/files/pos/t6514.scala
new file mode 100644
index 0000000000..7c58605d39
--- /dev/null
+++ b/test/files/pos/t6514.scala
@@ -0,0 +1,11 @@
+object Test {
+ def e(msg: String) = new Exception(msg)
+
+ // this code ain't dead.
+ def a(b: Boolean) = {
+ b match {
+ case true => throw e("true")
+ case false => throw e("false")
+ }
+ }
+}
diff --git a/test/files/run/t6370.scala b/test/files/run/t6370.scala
new file mode 100644
index 0000000000..c86b87dc8a
--- /dev/null
+++ b/test/files/run/t6370.scala
@@ -0,0 +1,12 @@
+object Test {
+
+ def main(args: Array[String]): Unit = {
+ val m = collection.immutable.ListMap( "x" -> 1 )
+ try {
+ m("y")
+ } catch {
+ case e : NoSuchElementException => assert(e.getMessage() == "key not found: y")
+ }
+
+ }
+}
diff --git a/test/files/run/t6935.scala b/test/files/run/t6935.scala
new file mode 100644
index 0000000000..dea2d7f2e2
--- /dev/null
+++ b/test/files/run/t6935.scala
@@ -0,0 +1,14 @@
+object Test {
+
+ def main(args: Array[String]): Unit = {
+ import java.io._
+ val bytes = new ByteArrayOutputStream()
+ val out = new ObjectOutputStream(bytes)
+ out.writeObject(())
+ out.close()
+ val buf = bytes.toByteArray
+ val in = new ObjectInputStream(new ByteArrayInputStream(buf))
+ val unit = in.readObject()
+ assert(unit == ())
+ }
+}