*** empty log message ***

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@2338 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2004-01-12 10:56:44 +00:00
parent 000bc1bc81
commit 799dc03118
13 changed files with 31 additions and 46 deletions

View File

@ -6714,24 +6714,10 @@ implementation of an electronic auction service. This service was
based on high-level actor processes, that work by inspecting messages
in their mailbox using pattern matching. An actor is simply a thread
whose communication primitives are those of a mailbox. Actors are
defined as an extension of Java's standard \code{Thread} class which
forwards all communication calls to an internal mailbox.
hence defined as a mixin composition extension of Java's standard
\code{Thread} class with the \code{MailBox} class.
\begin{lstlisting}
abstract class Actor extends Thread {
type Message = AnyRef;
private val mb = new MailBox;
def send(msg: Message): unit =
mb.send(msg);
def receive[a](f: PartialFunction[Message, a]): a =
mb.receive(f);
def receiveWithin[a](msec: long)(f: PartialFunction[Message, a]): a =
mb.receiveWithin(msec)(f);
}
abstract class Actor extends Thread with MailBox;
\end{lstlisting}
\comment{

View File

@ -1,22 +1,5 @@
package scala.concurrent;
abstract class Actor extends Thread() {
type Message = AnyRef;
private val mb = new MailBox;
def send(msg: Message): unit =
mb.send(msg);
def receive[a](f: PartialFunction[Message, a]): a =
mb.receive(f);
def receiveWithin[a](msec: long)(f: PartialFunction[Message, a]): a =
mb.receiveWithin(msec)(f);
}
abstract class Actor extends Thread with MailBox;

View File

@ -1,7 +1,7 @@
package scala.concurrent;
//class MailBox with Monitor with LinkedListQueueCreator {
class MailBox extends Monitor with ListQueueCreator {
class MailBox with Monitor with ListQueueCreator {
type Message = AnyRef;

View File

@ -1,4 +1,4 @@
S4.scala:4: type a.type escapes its defining scope as part of a.Inner { def foo(a.Inner): a.Inner, val b$: Other, def b: Other }
S4.scala:4: type a.type escapes its defining scope as part of a.Inner with scala.ScalaObject { def foo(a.Inner): a.Inner, val b$: Other, def b: Other }
class S4(a: Other) extends a.Inner() {
^
one error found

View File

@ -1,4 +1,4 @@
bug152.scala:5: type foo.type escapes its defining scope as part of scala.Object { def a: foo.T }
bug152.scala:5: type foo.type escapes its defining scope as part of java.lang.Object with scala.ScalaObject { def a: foo.T }
class Bar(foo: Foo) {
^
one error found

View File

@ -1,4 +1,4 @@
bug58.scala:1: type x.type escapes its defining scope as part of x.C
bug58.scala:1: type x.type escapes its defining scope as part of x.C with scala.ScalaObject
class A(x: B) extends x.C {}
^
one error found

View File

@ -1,7 +1,15 @@
bug95.scala:1: illegal inheritance from sealed class
class C extends AnyVal;
^
bug95.scala:1: illegal inheritance;
scala.AnyVal does not conform to scala.ScalaObject's supertype
class C extends AnyVal;
^
bug95.scala:2: illegal inheritance from sealed class
class T extends Unit;
^
two errors found
bug95.scala:2: illegal inheritance;
scala.Unit does not conform to scala.ScalaObject's supertype
class T extends Unit;
^
four errors found

View File

@ -3,7 +3,7 @@ constrparams.scala:4: type mismatch;
required: x.t
private val z: x.t = null; //error
^
constrparams.scala:1: type x.type escapes its defining scope as part of scala.Object { type t, val y$: x.type, def y: x.type, val z$: x.t, def z: x.t }
constrparams.scala:1: type x.type escapes its defining scope as part of java.lang.Object with scala.ScalaObject { type t, val y$: x.type, def y: x.type, val z$: x.t, def z: x.t }
abstract class C(x: C) {
^
two errors found

View File

@ -1,4 +1,4 @@
S4.scala:4: type a.type escapes its defining scope as part of a.Inner { def foo(a.Inner): a.Inner, val b$: Other, def b: Other }
S4.scala:4: type a.type escapes its defining scope as part of a.Inner with scala.ScalaObject { def foo(a.Inner): a.Inner, val b$: Other, def b: Other }
class S4(a: Other) extends a.Inner() {
^
one error found

View File

@ -1,4 +1,4 @@
bug152.scala:5: type foo.type escapes its defining scope as part of scala.Object { def a: foo.T }
bug152.scala:5: type foo.type escapes its defining scope as part of java.lang.Object with scala.ScalaObject { def a: foo.T }
class Bar(foo: Foo) {
^
one error found

View File

@ -1,4 +1,4 @@
bug58.scala:1: type x.type escapes its defining scope as part of x.C
bug58.scala:1: type x.type escapes its defining scope as part of x.C with scala.ScalaObject
class A(x: B) extends x.C {}
^
one error found

View File

@ -1,7 +1,15 @@
bug95.scala:1: illegal inheritance from sealed class
class C extends AnyVal;
^
bug95.scala:1: illegal inheritance;
scala.AnyVal does not conform to scala.ScalaObject's supertype
class C extends AnyVal;
^
bug95.scala:2: illegal inheritance from sealed class
class T extends Unit;
^
two errors found
bug95.scala:2: illegal inheritance;
scala.Unit does not conform to scala.ScalaObject's supertype
class T extends Unit;
^
four errors found

View File

@ -3,7 +3,7 @@ constrparams.scala:4: type mismatch;
required: x.t
private val z: x.t = null; //error
^
constrparams.scala:1: type x.type escapes its defining scope as part of scala.Object { type t, val y$: x.type, def y: x.type, val z$: x.t, def z: x.t }
constrparams.scala:1: type x.type escapes its defining scope as part of java.lang.Object with scala.ScalaObject { type t, val y$: x.type, def y: x.type, val z$: x.t, def z: x.t }
abstract class C(x: C) {
^
two errors found