diff options
author | Martin Odersky <odersky@gmail.com> | 2009-10-02 13:19:34 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-10-02 13:19:34 +0000 |
commit | 321338da04a6ca9bcc9b77ae663ed27f26a67d85 (patch) | |
tree | 4cea0a435568b760b688740f5d559a4033cf7962 /test/files | |
parent | 1bc50a7c84b0abc53299b3efcfec4f6a77c759e6 (diff) | |
download | scala-321338da04a6ca9bcc9b77ae663ed27f26a67d85.tar.gz scala-321338da04a6ca9bcc9b77ae663ed27f26a67d85.tar.bz2 scala-321338da04a6ca9bcc9b77ae663ed27f26a67d85.zip |
Fixed #1939,plus some moving things around.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t1939.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/files/run/t1939.scala b/test/files/run/t1939.scala new file mode 100644 index 0000000000..7d6261906c --- /dev/null +++ b/test/files/run/t1939.scala @@ -0,0 +1,34 @@ +class Module {} + +abstract class T { + type moduleType <: Module + def module: moduleType +} + +final class T1(val module: Module) extends T { + type moduleType = Module +} + +final class T2(_module: Module) extends T { + type moduleType = Module + + def module = _module +} + +object Test extends Application { + + type mType = Module + + type tType = T { type moduleType <: mType } + // type tType = T { type moduleType <: Module } // runs successfully + // type tType = T // runs successfully + + def f(ts: List[tType]): Unit = { + + for (t <- ts; m = t.module) {} + ts.map(t => t.module).foreach { _ => () } + // ts.map(t => (t : T).module).foreach { _ => () } // runs successfully + } + + f(new T1(new Module) :: new T2(new Module) :: Nil) +} |