diff options
author | Martin Odersky <odersky@gmail.com> | 2006-05-30 10:47:58 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-05-30 10:47:58 +0000 |
commit | f7a989f23a40541d6f2b6de88dca3c55e6d7376f (patch) | |
tree | 4c86eb89b85ebfebc0f458b3efbb68df668b68d7 /test/files/pos | |
parent | 335de89b823ac04008aab6a05569d1097068e6cf (diff) | |
download | scala-f7a989f23a40541d6f2b6de88dca3c55e6d7376f.tar.gz scala-f7a989f23a40541d6f2b6de88dca3c55e6d7376f.tar.bz2 scala-f7a989f23a40541d6f2b6de88dca3c55e6d7376f.zip |
fixed bugs615 and 617
Diffstat (limited to 'test/files/pos')
-rwxr-xr-x | test/files/pos/bug319.scala | 21 | ||||
-rw-r--r-- | test/files/pos/bug607.scala | 11 | ||||
-rw-r--r-- | test/files/pos/bug615.scala | 11 |
3 files changed, 43 insertions, 0 deletions
diff --git a/test/files/pos/bug319.scala b/test/files/pos/bug319.scala new file mode 100755 index 0000000000..eed25eb84c --- /dev/null +++ b/test/files/pos/bug319.scala @@ -0,0 +1,21 @@ +object test { + + trait A { type T; } + + trait B { type T; } + + /** def functor(x: A): B { type T = x.T } */ + abstract class functor() { + val arg: A; + val res: B { type T = arg.T } = + new B { type T = arg.T; }; + } + + 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/pos/bug607.scala b/test/files/pos/bug607.scala new file mode 100644 index 0000000000..42c3a15a85 --- /dev/null +++ b/test/files/pos/bug607.scala @@ -0,0 +1,11 @@ +object Test +{ + trait Foo { type T } + object FooX extends Foo { type T = X; trait X } + + def test(x : Foo { type T = FooX.X }) = {} + + def main(argv : Array[String]) : Unit = { + test(FooX) + } +} diff --git a/test/files/pos/bug615.scala b/test/files/pos/bug615.scala new file mode 100644 index 0000000000..8fefc952e0 --- /dev/null +++ b/test/files/pos/bug615.scala @@ -0,0 +1,11 @@ +object test { + abstract class Bar { + type T + def bar: Unit + } + new Bar { + type T = Int + def bar = () + }.bar +} + |