summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-11-01 10:44:30 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-11-01 10:44:30 -0400
commit79087c79c402ababbb50fa9d1e4e78b0e52189c6 (patch)
tree210f4f0024bffd9a0061285a948079c518342983 /test
parent557fe9e9d2c14f363918e89056233a981dc5ef5c (diff)
parent17497cbc95d2e3cfe52eb2a1ece0d414e9308660 (diff)
downloadscala-79087c79c402ababbb50fa9d1e4e78b0e52189c6.tar.gz
scala-79087c79c402ababbb50fa9d1e4e78b0e52189c6.tar.bz2
scala-79087c79c402ababbb50fa9d1e4e78b0e52189c6.zip
Merge branch '2.10.0-wip' of github.com:scala/scala into 2.10.0-wip
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/actmig-remote-actor-self.check1
-rw-r--r--test/files/jvm/actmig-remote-actor-self.scala34
-rw-r--r--test/files/pos/t5031_3/Foo_1.scala5
-rw-r--r--test/files/pos/t5031_3/Main_2.scala6
-rw-r--r--test/files/pos/t5031_3/package.scala6
-rw-r--r--test/files/pos/t6575a.scala15
-rw-r--r--test/files/pos/t6575b.scala17
7 files changed, 84 insertions, 0 deletions
diff --git a/test/files/jvm/actmig-remote-actor-self.check b/test/files/jvm/actmig-remote-actor-self.check
new file mode 100644
index 0000000000..79d23cb337
--- /dev/null
+++ b/test/files/jvm/actmig-remote-actor-self.check
@@ -0,0 +1 @@
+registered
diff --git a/test/files/jvm/actmig-remote-actor-self.scala b/test/files/jvm/actmig-remote-actor-self.scala
new file mode 100644
index 0000000000..2b994f6081
--- /dev/null
+++ b/test/files/jvm/actmig-remote-actor-self.scala
@@ -0,0 +1,34 @@
+/**
+ * NOTE: Code snippets from this test are included in the Actor Migration Guide. In case you change
+ * code in these tests prior to the 2.10.0 release please send the notification to @vjovanov.
+ */
+import scala.actors._
+import scala.actors.migration._
+import scala.actors.remote._
+import scala.actors.remote.RemoteActor._
+import scala.concurrent._
+import scala.concurrent.duration._
+
+object Test {
+ val finished = Promise[Boolean]
+
+ def main(args: Array[String]): Unit = {
+
+ // can fail with class cast exception in alive
+ val myAkkaActor = ActorDSL.actor(new StashingActor {
+ override def preStart() = {
+ alive(42013)
+ println("registered")
+ finished success true
+ context.stop(self)
+ }
+
+ def receive = {
+ case x: Int =>
+ }
+ })
+
+ Await.result(finished.future, Duration.Inf).toString
+ }
+
+}
diff --git a/test/files/pos/t5031_3/Foo_1.scala b/test/files/pos/t5031_3/Foo_1.scala
new file mode 100644
index 0000000000..5934a6ba79
--- /dev/null
+++ b/test/files/pos/t5031_3/Foo_1.scala
@@ -0,0 +1,5 @@
+package foo.bar
+
+object Foo {
+ def bar = 42
+}
diff --git a/test/files/pos/t5031_3/Main_2.scala b/test/files/pos/t5031_3/Main_2.scala
new file mode 100644
index 0000000000..2079460b83
--- /dev/null
+++ b/test/files/pos/t5031_3/Main_2.scala
@@ -0,0 +1,6 @@
+package org.example
+
+object Main extends App {
+ println(foo.bar.Foo.bar)
+}
+
diff --git a/test/files/pos/t5031_3/package.scala b/test/files/pos/t5031_3/package.scala
new file mode 100644
index 0000000000..23fede7d04
--- /dev/null
+++ b/test/files/pos/t5031_3/package.scala
@@ -0,0 +1,6 @@
+package foo
+
+package object bar {
+ type Foo = Int => String
+}
+
diff --git a/test/files/pos/t6575a.scala b/test/files/pos/t6575a.scala
new file mode 100644
index 0000000000..f128714dab
--- /dev/null
+++ b/test/files/pos/t6575a.scala
@@ -0,0 +1,15 @@
+trait X { def foo: PartialFunction[Int, Int] }
+
+trait Y extends X {
+ // Inferred type was AbstractPartialFunction[Int, Int] with Serializable
+ abstract override def foo = { case i => super.foo(i) * 2 }
+}
+trait Z extends X {
+ // ditto
+ abstract override def foo = { case i => super.foo(i) + 3 }
+}
+
+trait Comb extends Y with Z {
+ // ... which led to a type error here.
+ abstract override def foo: PartialFunction[Int, Int] = { case i => super.foo(i) - 2 }
+}
diff --git a/test/files/pos/t6575b.scala b/test/files/pos/t6575b.scala
new file mode 100644
index 0000000000..d3e58b2a16
--- /dev/null
+++ b/test/files/pos/t6575b.scala
@@ -0,0 +1,17 @@
+// inferred types were okay here as Function nodes aren't
+// translated into anoymous subclasses of AbstractFunctionN
+// until after the typer.
+//
+// So this test is just confirmation.
+trait X { def foo: Function1[Int, Int] }
+
+trait Y extends X {
+ abstract override def foo = { case i => super.foo(i) * 2 }
+}
+trait Z extends X {
+ abstract override def foo = { case i => super.foo(i) + 3 }
+}
+
+trait Comb extends Y with Z {
+ abstract override def foo: Function1[Int, Int] = { case i => super.foo(i) - 2 }
+}