summaryrefslogtreecommitdiff
path: root/test/pending/run/t1939.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-10-02 17:57:16 +0000
committerMartin Odersky <odersky@gmail.com>2009-10-02 17:57:16 +0000
commit83b67aa805fd1329d6bcc54b1c1fa16416437b6f (patch)
tree3fcc59ba0523f644bceef4676f7a6689f9949417 /test/pending/run/t1939.scala
parent84146e2f53fb1f5e8abbc521121078e932cf82e7 (diff)
downloadscala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.tar.gz
scala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.tar.bz2
scala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.zip
Sequence->Seq
Diffstat (limited to 'test/pending/run/t1939.scala')
-rw-r--r--test/pending/run/t1939.scala42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/pending/run/t1939.scala b/test/pending/run/t1939.scala
new file mode 100644
index 0000000000..4860ca8169
--- /dev/null
+++ b/test/pending/run/t1939.scala
@@ -0,0 +1,42 @@
+
+
+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 Main 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(_.module).foreach { _ => () }
+ // ts.map(t => (t : T).module).foreach { _ => () } // runs successfully
+ }
+
+ f(new T1(new Module) :: new T2(new Module) :: Nil)
+}
+
+/*
+ * java.lang.AbstractMethodError
+ at scala.List.foreach(List.scala:849)
+ at Main$.f
+*/