diff options
author | Martin Odersky <odersky@gmail.com> | 2003-10-08 18:54:24 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-10-08 18:54:24 +0000 |
commit | 9c45685549a490f73dbd9d9ce0ec5189a75c6453 (patch) | |
tree | 70d1893b420b79c4b5dd03d68a7dcb4cd68ce32f /test/files | |
parent | 8ee55188d8c59c69924fb0a914adf645dc682fdf (diff) | |
download | scala-9c45685549a490f73dbd9d9ce0ec5189a75c6453.tar.gz scala-9c45685549a490f73dbd9d9ce0ec5189a75c6453.tar.bz2 scala-9c45685549a490f73dbd9d9ce0ec5189a75c6453.zip |
*** empty log message ***
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug145.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug145.scala | 16 | ||||
-rw-r--r-- | test/files/neg/bug170.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug170.scala | 15 | ||||
-rw-r--r-- | test/files/neg/bug182.scala | 2 | ||||
-rw-r--r-- | test/files/neg/bug191.check | 6 | ||||
-rw-r--r-- | test/files/neg/bug191.scala | 15 | ||||
-rw-r--r-- | test/files/pos/bug115.scala | 8 | ||||
-rw-r--r-- | test/files/pos/bug159.scala | 22 |
9 files changed, 92 insertions, 0 deletions
diff --git a/test/files/neg/bug145.check b/test/files/neg/bug145.check new file mode 100644 index 0000000000..14e8334c0f --- /dev/null +++ b/test/files/neg/bug145.check @@ -0,0 +1,4 @@ +bug145.scala:8: symbol accessed from super may not be abstract + abstract override def foo(x: T): Int = super[J].foo(x) + 1; + ^ +one error found diff --git a/test/files/neg/bug145.scala b/test/files/neg/bug145.scala new file mode 100644 index 0000000000..edfb6a12a3 --- /dev/null +++ b/test/files/neg/bug145.scala @@ -0,0 +1,16 @@ +class B[T] { + def foo(x: T): Int = 1; +} +trait J[T] { + def foo(x: T): Int; +} +trait I[T] extends B[T] with J[T] { + abstract override def foo(x: T): Int = super[J].foo(x) + 1; +} +class C extends B[Int] { + override def foo(x: Int): Int = x; +} +class D extends C with I[Int]; +object T with Executable { + System.out.println((new D).foo(3)); +} diff --git a/test/files/neg/bug170.check b/test/files/neg/bug170.check new file mode 100644 index 0000000000..544ed9591b --- /dev/null +++ b/test/files/neg/bug170.check @@ -0,0 +1,4 @@ +bug170.scala:9: class D needs to be abstract, since method foo in class D is marked `abstract' and `override' and overrides an incomplete superclass member in J +class D extends J with I { + ^ +one error found diff --git a/test/files/neg/bug170.scala b/test/files/neg/bug170.scala new file mode 100644 index 0000000000..b1f712804e --- /dev/null +++ b/test/files/neg/bug170.scala @@ -0,0 +1,15 @@ +trait J { + def foo(): Unit; +} + +trait I with J { + override def foo(): Unit = (); +} + +class D extends J with I { + abstract override def foo(): Unit = super.foo(); +} + +object Test with Executable { + (new D).foo(); +} diff --git a/test/files/neg/bug182.scala b/test/files/neg/bug182.scala new file mode 100644 index 0000000000..9fa01d11d9 --- /dev/null +++ b/test/files/neg/bug182.scala @@ -0,0 +1,2 @@ +class Foo { class I; } +class Bar extends Foo { class I; } diff --git a/test/files/neg/bug191.check b/test/files/neg/bug191.check new file mode 100644 index 0000000000..34666fdcd6 --- /dev/null +++ b/test/files/neg/bug191.check @@ -0,0 +1,6 @@ +bug191.scala:11: type mismatch; + found : B.this.C + required: B.this.C + foo(new C); + ^ +one error found diff --git a/test/files/neg/bug191.scala b/test/files/neg/bug191.scala new file mode 100644 index 0000000000..1ff566137e --- /dev/null +++ b/test/files/neg/bug191.scala @@ -0,0 +1,15 @@ +class A { + private class C { + def print = Console.println("A.C"); + } + def foo(c: C) = c.print; +} +class B extends A { + class C { + def show = Console.println("B.C"); + } + foo(new C); +} +object Main with Executable { + val b = new B; +} diff --git a/test/files/pos/bug115.scala b/test/files/pos/bug115.scala new file mode 100644 index 0000000000..7e83038c7c --- /dev/null +++ b/test/files/pos/bug115.scala @@ -0,0 +1,8 @@ +class S[A](f: A => A, x: A) { + System.out.println(f(x)); +} +class T[A](f: A => A, y: A) extends S(x: A => f(x), y) { +} +object Test with Executable { + new T[int](x: int => x * 2, 1); +} diff --git a/test/files/pos/bug159.scala b/test/files/pos/bug159.scala new file mode 100644 index 0000000000..d6cdb97b47 --- /dev/null +++ b/test/files/pos/bug159.scala @@ -0,0 +1,22 @@ +object foo { + + // the problem seems to appear only + // if "val _" is in the body of a case + def cooked( ckd:StringBuffer ):Unit = + 'a'.match { + case '-' => + val _ = ckd.append( '_' ); + case 'v' => + val _ = ckd.append( '_' ); + } + +} +object foo1 { + def f():Unit = { + 1.match { + case 2 => val _ = 1; + case 3 => val _ = 2; + case 4 => val _ = 2; + } + } +} |