From 0cc202c85b6cda5bb8f8e777e859164899f00eb1 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 18 Mar 2003 11:59:52 +0000 Subject: *** empty log message *** --- sources/scala/Cell.scala | 2 +- sources/scala/Monitor.scala | 2 +- sources/scala/Some.scala | 2 +- sources/scalac/ast/parser/Parser.java | 2 +- test/files/neg/vincent.scala | 14 +++++++------- test/files/neg/vincent1.scala | 6 +++--- test/files/pos/matthias3.scala | 2 +- test/files/pos/matthias5.scala | 2 +- test/neg/vincent.scala | 14 +++++++------- test/neg/vincent1.scala | 6 +++--- test/pos/matthias3.scala | 2 +- test/pos/matthias5.scala | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/sources/scala/Cell.scala b/sources/scala/Cell.scala index 4a6566c563..4b3a7273ea 100644 --- a/sources/scala/Cell.scala +++ b/sources/scala/Cell.scala @@ -1,3 +1,3 @@ -package scala with { +package scala { case class Cell[T](elem: T) } \ No newline at end of file diff --git a/sources/scala/Monitor.scala b/sources/scala/Monitor.scala index 927f323986..98e3a5e330 100644 --- a/sources/scala/Monitor.scala +++ b/sources/scala/Monitor.scala @@ -1,6 +1,6 @@ package scala; -class Monitor() extends NativeMonitor() with { +class Monitor() extends NativeMonitor() { def synchronized[a](def p: a): a = synchronised(p); diff --git a/sources/scala/Some.scala b/sources/scala/Some.scala index 665830cc42..bb7f9e4723 100644 --- a/sources/scala/Some.scala +++ b/sources/scala/Some.scala @@ -1,5 +1,5 @@ package scala { - final case class Some[c](x: c) extends Option[c] with { + final case class Some[c](x: c) extends Option[c] { def isNone = False; def get: c = x; } diff --git a/sources/scalac/ast/parser/Parser.java b/sources/scalac/ast/parser/Parser.java index 4fd2d676e1..a91a857da7 100644 --- a/sources/scalac/ast/parser/Parser.java +++ b/sources/scalac/ast/parser/Parser.java @@ -554,7 +554,7 @@ public class Parser implements Tokens { Tree type1() { int pos = s.pos; Tree t = simpleType(); - if (s.token == WITH) { + if (s.token == WITH || s.token == LBRACE) { TreeList ts = new TreeList(); ts.append(t); while (s.token == WITH) { diff --git a/test/files/neg/vincent.scala b/test/files/neg/vincent.scala index 0af526d6aa..b61c8c4127 100644 --- a/test/files/neg/vincent.scala +++ b/test/files/neg/vincent.scala @@ -4,17 +4,17 @@ module test { trait B { type T; } - /** def functor(x: A): B with { type T = x.T } */ + /** def functor(x: A): B { type T = x.T } */ abstract class functor() { val arg: A; - val res: B with { type T = arg.T } = - new B with { type T = arg.T; }; + val res: B { type T = arg.T } = + new B { type T = arg.T; }; } - val a = new A with { type T = String }; - /** val b: B with { type T = String } = functor(a) */ - val b: B with { type T = String } = { - val tmp = new functor() with { val arg = a }; + val a = new A { type T = String }; + /** val b: B { type T = String } = functor(a) */ + val b: B { type T = String } = { + val tmp = new functor() { val arg = a }; tmp.res } diff --git a/test/files/neg/vincent1.scala b/test/files/neg/vincent1.scala index afcb9a94f4..53104be640 100644 --- a/test/files/neg/vincent1.scala +++ b/test/files/neg/vincent1.scala @@ -4,12 +4,12 @@ module test { trait B { type T; } - def functor(x: A): B with { type T = x.T } = - new B with { + def functor(x: A): B { type T = x.T } = + new B { type T = x.T; }; - val a = new A with { type T = String }; + val a = new A { type T = String }; val b = functor(a); val s: b.T = "coucou"; diff --git a/test/files/pos/matthias3.scala b/test/files/pos/matthias3.scala index c76d291245..6e86afeca6 100644 --- a/test/files/pos/matthias3.scala +++ b/test/files/pos/matthias3.scala @@ -8,6 +8,6 @@ class B() extends A() { } abstract class C() { val b: B = new B(); - val a: A with { val y: b.type }; + val a: A { val y: b.type }; } diff --git a/test/files/pos/matthias5.scala b/test/files/pos/matthias5.scala index a6c9808c9e..0dcb7f833d 100644 --- a/test/files/pos/matthias5.scala +++ b/test/files/pos/matthias5.scala @@ -7,6 +7,6 @@ class B() extends A() { } abstract class C() { val b: B = new B(); - val a: A with { val y: b.type }; + val a: A { val y: b.type }; } diff --git a/test/neg/vincent.scala b/test/neg/vincent.scala index 0af526d6aa..b61c8c4127 100644 --- a/test/neg/vincent.scala +++ b/test/neg/vincent.scala @@ -4,17 +4,17 @@ module test { trait B { type T; } - /** def functor(x: A): B with { type T = x.T } */ + /** def functor(x: A): B { type T = x.T } */ abstract class functor() { val arg: A; - val res: B with { type T = arg.T } = - new B with { type T = arg.T; }; + val res: B { type T = arg.T } = + new B { type T = arg.T; }; } - val a = new A with { type T = String }; - /** val b: B with { type T = String } = functor(a) */ - val b: B with { type T = String } = { - val tmp = new functor() with { val arg = a }; + val a = new A { type T = String }; + /** val b: B { type T = String } = functor(a) */ + val b: B { type T = String } = { + val tmp = new functor() { val arg = a }; tmp.res } diff --git a/test/neg/vincent1.scala b/test/neg/vincent1.scala index afcb9a94f4..53104be640 100644 --- a/test/neg/vincent1.scala +++ b/test/neg/vincent1.scala @@ -4,12 +4,12 @@ module test { trait B { type T; } - def functor(x: A): B with { type T = x.T } = - new B with { + def functor(x: A): B { type T = x.T } = + new B { type T = x.T; }; - val a = new A with { type T = String }; + val a = new A { type T = String }; val b = functor(a); val s: b.T = "coucou"; diff --git a/test/pos/matthias3.scala b/test/pos/matthias3.scala index c76d291245..6e86afeca6 100644 --- a/test/pos/matthias3.scala +++ b/test/pos/matthias3.scala @@ -8,6 +8,6 @@ class B() extends A() { } abstract class C() { val b: B = new B(); - val a: A with { val y: b.type }; + val a: A { val y: b.type }; } diff --git a/test/pos/matthias5.scala b/test/pos/matthias5.scala index a6c9808c9e..0dcb7f833d 100644 --- a/test/pos/matthias5.scala +++ b/test/pos/matthias5.scala @@ -7,6 +7,6 @@ class B() extends A() { } abstract class C() { val b: B = new B(); - val a: A with { val y: b.type }; + val a: A { val y: b.type }; } -- cgit v1.2.3