diff options
Diffstat (limited to 'test/pending/run')
-rw-r--r-- | test/pending/run/t1939.scala | 42 | ||||
-rw-r--r-- | test/pending/run/t1980.scala | 13 | ||||
-rw-r--r-- | test/pending/run/t2005.scala | 24 |
3 files changed, 79 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 +*/ diff --git a/test/pending/run/t1980.scala b/test/pending/run/t1980.scala new file mode 100644 index 0000000000..7c5737f95e --- /dev/null +++ b/test/pending/run/t1980.scala @@ -0,0 +1,13 @@ +scala> def foo() = { println("foo") ; 5 } +foo: ()Int + +scala> class C { def m1(f: => Int) = () ; def m2_:(f: => Int) = () } +defined class C + +scala> val c = new C +c: C = C@96d484 + +scala> c m1 foo() + +scala> foo() m2_: c +foo diff --git a/test/pending/run/t2005.scala b/test/pending/run/t2005.scala new file mode 100644 index 0000000000..8e4243a768 --- /dev/null +++ b/test/pending/run/t2005.scala @@ -0,0 +1,24 @@ +Object Bug { + def main(args: Array[String]) { + val a = new Array[Array[Int]](2,2) + test(a) + } + def test[A](t: Array[Array[A]]) { + val tmp = t(0) + t(1) = tmp + } +} +java.lang.ArrayStoreException: scala.runtime.BoxedIntArray + at scala.runtime.BoxedObjectArray.update(BoxedObjectArray.scala:26) + at Bug$.test(Bug.scala:12) + at Bug$.main(Bug.scala:7) + at Bug.main(Bug.scala) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) + at java.lang.reflect.Method.invoke(Method.java:585) + at scala.tools.nsc.ObjectRunner$$anonfun$run$1.apply(ObjectRunner.scala:75) + at scala.tools.nsc.ObjectRunner$.withContextClassLoader(ObjectRunner.scala:49) + at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74) + at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:154) + at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala) |