summaryrefslogtreecommitdiff
path: root/test/pending
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
parent84146e2f53fb1f5e8abbc521121078e932cf82e7 (diff)
downloadscala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.tar.gz
scala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.tar.bz2
scala-83b67aa805fd1329d6bcc54b1c1fa16416437b6f.zip
Sequence->Seq
Diffstat (limited to 'test/pending')
-rwxr-xr-xtest/pending/neg/t1545.scala16
-rw-r--r--test/pending/neg/t1800.scala28
-rw-r--r--test/pending/neg/t1845.scala12
-rw-r--r--test/pending/neg/t2080.scala17
-rw-r--r--test/pending/neg/t2180.scala31
-rw-r--r--test/pending/pos/local-objects.scala9
-rw-r--r--test/pending/pos/t1722.scala10
-rwxr-xr-xtest/pending/pos/t1722/C.scala9
-rwxr-xr-xtest/pending/pos/t1722/Test.scala4
-rwxr-xr-xtest/pending/pos/t1722/Top.scala13
-rw-r--r--test/pending/pos/t1756.scala30
-rw-r--r--test/pending/pos/t1786.scala13
-rw-r--r--test/pending/pos/t1798.scala10
-rw-r--r--test/pending/pos/t1987.scala8
-rw-r--r--test/pending/pos/t1996.scala19
-rw-r--r--test/pending/pos/t2071.scala14
-rw-r--r--test/pending/pos/t2081.scala7
-rw-r--r--test/pending/pos/t2099.scala27
-rw-r--r--test/pending/pos/t2108.scala2
-rw-r--r--test/pending/pos/t2127.scala29
-rw-r--r--test/pending/pos/t2130.scala44
-rw-r--r--test/pending/pos/t2162.scala19
-rw-r--r--test/pending/pos/t2173.scala17
-rw-r--r--test/pending/pos/t2178.scala10
-rw-r--r--test/pending/pos/t2179.scala6
-rw-r--r--test/pending/pos/t2185,.scala3
-rw-r--r--test/pending/pos/t2188.scala9
-rw-r--r--test/pending/pos/t2194.scala15
-rw-r--r--test/pending/pos/t2201.scala8
-rw-r--r--test/pending/pos/ticket2251.scala25
-rw-r--r--test/pending/run/t1939.scala42
-rw-r--r--test/pending/run/t1980.scala13
-rw-r--r--test/pending/run/t2005.scala24
33 files changed, 543 insertions, 0 deletions
diff --git a/test/pending/neg/t1545.scala b/test/pending/neg/t1545.scala
new file mode 100755
index 0000000000..d7c0245725
--- /dev/null
+++ b/test/pending/neg/t1545.scala
@@ -0,0 +1,16 @@
+object Main extends Application {
+
+ case class Foo (field : Option[String])
+
+ val x : PartialFunction[Foo,Int] =
+ {
+ c => c.field match {
+ case Some (s) => 42
+ case None => 99
+ }
+ }
+
+ println (x (Foo (None))) // prints 99
+ println (x (Foo (Some ("foo")))) // prints 42
+
+}
diff --git a/test/pending/neg/t1800.scala b/test/pending/neg/t1800.scala
new file mode 100644
index 0000000000..eebbbad9c7
--- /dev/null
+++ b/test/pending/neg/t1800.scala
@@ -0,0 +1,28 @@
+object ObjectHolder {
+ private[ObjectHolder] class PrivateObject
+ def getPrivateObject = new PrivateObject
+}
+
+object Test {
+ def main(args: Array[String]) {
+ // compiler error: class PrivateObject cannot be accessed
+ // in object test.ObjectHolder
+ val a: ObjectHolder.PrivateObject = ObjectHolder.getPrivateObject
+
+ // works fine
+ val b = ObjectHolder.getPrivateObject
+ println(b.getClass)
+ }
+}
+/*
+When declaring objects as private[package/object] or protected[package/object] it is possible to leak out references to these objects into the public api (can be desirable, this in itself is not a problem).
+
+When users of the api receive such private object via a function call, they can create a variable to reference the private object using inferred typing:
+
+val b = getPrivateObject()
+
+However they cannot create such variable using declared typing:
+
+val a: PrivateObject? = getPrivateObject()
+
+The line above will generate a compiler error: "class PrivateObject? cannot be accessed". Which makes sense, because PrivateObject? was declared private. But in this case inferred typing should not work either, otherwise the behaviors of inferred typing and declared typing become inconsistent. */
diff --git a/test/pending/neg/t1845.scala b/test/pending/neg/t1845.scala
new file mode 100644
index 0000000000..cfb28aa03c
--- /dev/null
+++ b/test/pending/neg/t1845.scala
@@ -0,0 +1,12 @@
+// Compiling the attached code makes scalac give a NPE.
+
+import scala.util.parsing.combinator.syntactical.TokenParsers
+import scala.util.parsing.combinator.lexical.StdLexical
+import scala.util.parsing.syntax.StdTokens
+
+class MyTokenParsers extends TokenParsers {
+ import lexical._
+ type Tokens = StdTokens
+ type Elem = lexical.Token
+ val lexical = new StdLexical
+}
diff --git a/test/pending/neg/t2080.scala b/test/pending/neg/t2080.scala
new file mode 100644
index 0000000000..0880a40faa
--- /dev/null
+++ b/test/pending/neg/t2080.scala
@@ -0,0 +1,17 @@
+trait A {
+ type T
+ def f(x : T) : T
+}
+
+trait B extends A {
+ trait T { }
+ override def f(x : T) : T = x
+}
+
+object C extends B {
+ override trait T {
+ def g { }
+ }
+ override def f(x : T) : T = { x.g; x }
+}
+//It compiles without errors, but T in B and T in C are completely unrelated types.
diff --git a/test/pending/neg/t2180.scala b/test/pending/neg/t2180.scala
new file mode 100644
index 0000000000..a8055bf77d
--- /dev/null
+++ b/test/pending/neg/t2180.scala
@@ -0,0 +1,31 @@
+
+
+Given the following code (which is broken):
+
+class Mxml {
+
+ private def processChildren( children:Seq[Any] ):List[Mxml] = {
+
+ children.toList.flatMap ( e => {
+
+ e match {
+
+ case s:scala.collection.Traversable[_] => s case a => List(a)
+
+ }
+
+ })
+
+ }
+
+}
+
+I get the following error:
+
+Mxml.scala:5: error: could not find implicit value for parameter bf:scala.collection.generic.BuilderFactory[Any,List[Mxml],Sequence[Any]].
+
+ children.flatMap ( e => {
+
+I spent 4 hours failing before I figured out the problem. The return type was wrong. It should have been List[Any].
+
+I have seen similar errors with map. My solution in the past has been to change it to a foldLeft because I have never been able to determine how to fix the problem until now.
diff --git a/test/pending/pos/local-objects.scala b/test/pending/pos/local-objects.scala
new file mode 100644
index 0000000000..ed7c50ead9
--- /dev/null
+++ b/test/pending/pos/local-objects.scala
@@ -0,0 +1,9 @@
+
+
+object Main {
+ val x = {
+ object Boo
+ Boo
+ }
+}
+
diff --git a/test/pending/pos/t1722.scala b/test/pending/pos/t1722.scala
new file mode 100644
index 0000000000..d059bf22f8
--- /dev/null
+++ b/test/pending/pos/t1722.scala
@@ -0,0 +1,10 @@
+sealed trait Top
+trait C {
+ private object P extends Top
+}
+/*
+$ scala -e 'new AnyRef with C'
+error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken
+(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.)
+one error found
+*/
diff --git a/test/pending/pos/t1722/C.scala b/test/pending/pos/t1722/C.scala
new file mode 100755
index 0000000000..2695296292
--- /dev/null
+++ b/test/pending/pos/t1722/C.scala
@@ -0,0 +1,9 @@
+trait C {
+ private object P extends Top
+}
+/*
+$ scala -e 'new AnyRef with C'
+error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken
+(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.)
+one error found
+*/
diff --git a/test/pending/pos/t1722/Test.scala b/test/pending/pos/t1722/Test.scala
new file mode 100755
index 0000000000..4cba7ab01b
--- /dev/null
+++ b/test/pending/pos/t1722/Test.scala
@@ -0,0 +1,4 @@
+package t1722
+object Test {
+ val x = new AnyRef with C
+}
diff --git a/test/pending/pos/t1722/Top.scala b/test/pending/pos/t1722/Top.scala
new file mode 100755
index 0000000000..4ac52412aa
--- /dev/null
+++ b/test/pending/pos/t1722/Top.scala
@@ -0,0 +1,13 @@
+package t1722
+
+sealed trait Top
+trait C {
+ private object P extends Top
+}
+/*
+$ scala -e 'new AnyRef with C'
+error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken
+(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.)
+one error found
+Martin: I think this has to do with children property.
+*/
diff --git a/test/pending/pos/t1756.scala b/test/pending/pos/t1756.scala
new file mode 100644
index 0000000000..c22d5509e1
--- /dev/null
+++ b/test/pending/pos/t1756.scala
@@ -0,0 +1,30 @@
+trait Ring[T <: Ring[T]] {
+ def +(that: T): T
+ def *(that: T): T
+}
+
+class A extends Ring[A] {
+ def +(that: A) = new A
+ def *(that: A) = new A
+}
+
+class Poly[C <: Ring[C]](val c: C) extends Ring[Poly[C]] {
+ def +(that: Poly[C]) = new Poly(this.c+that.c)
+ def *(that: Poly[C]) = new Poly(this.c*that.c)
+}
+
+implicit def coef2poly[C <: Ring[C]](c: C) = new Poly(c)
+
+val a = new A
+val x = new Poly(new A)
+
+x+a // works
+a+x // works
+
+val y = new Poly(new Poly(new A))
+
+x+y*x // works
+x*y+x // works
+y*x+x // works
+
+x+x*y
diff --git a/test/pending/pos/t1786.scala b/test/pending/pos/t1786.scala
new file mode 100644
index 0000000000..86aaee0121
--- /dev/null
+++ b/test/pending/pos/t1786.scala
@@ -0,0 +1,13 @@
+class SomeClass(val intValue:Int)
+class MyClass[T <: SomeClass](val myValue:T)
+
+def myMethod(i:MyClass[_]) {
+ i.myValue.intValue/2 // << error i is of type Any
+}
+
+def myMethod(i:MyClass[_ <: SomeClass]) {
+ i.myValue.intValue/2 // << works
+}
+/*
+The below code shows a compiler flaw in that the wildcard "_" as value for a bounded type parameter either breaks the boundry - as it result in Any - or doesnt (as id hoped it to be) evaluates to the boundy.
+*/
diff --git a/test/pending/pos/t1798.scala b/test/pending/pos/t1798.scala
new file mode 100644
index 0000000000..1624e3025e
--- /dev/null
+++ b/test/pending/pos/t1798.scala
@@ -0,0 +1,10 @@
+object Foo { private def bar(): Int = 55 }
+class Foo(x: Int) { def this() = this(Foo.bar()) }
+
+/*
+ * scalac28 a.scala
+a.scala:2: error: method bar cannot be accessed in object Foo
+class Foo(x: Int) { def this() = this(Foo.bar()) }
+ ^
+one error found
+*/
diff --git a/test/pending/pos/t1987.scala b/test/pending/pos/t1987.scala
new file mode 100644
index 0000000000..ccab133716
--- /dev/null
+++ b/test/pending/pos/t1987.scala
@@ -0,0 +1,8 @@
+package object overloading {
+ def bar(f: (Int) => Unit): Unit = ()
+ def bar(f: (Int, Int) => Unit): Unit = ()
+}
+
+class PackageObjectOverloadingTest {
+ overloading.bar( (i: Int) => () ) // doesn't compile.
+}
diff --git a/test/pending/pos/t1996.scala b/test/pending/pos/t1996.scala
new file mode 100644
index 0000000000..2730128196
--- /dev/null
+++ b/test/pending/pos/t1996.scala
@@ -0,0 +1,19 @@
+object forbug {
+ val l1 = List(List(ValDef(new A)), List(ValDef(new A)))
+ for ((e1s, e2s) <- l1.zip(l1);
+ (e1, e2) <- e1s.zip(e2s)) {
+ e1.a.doSome(20)
+// ()
+ }
+}
+
+
+class A {
+ def doSome(a: Int): this.type = {
+ println(a)
+ this
+ }
+}
+
+case class ValDef(a: A)
+
diff --git a/test/pending/pos/t2071.scala b/test/pending/pos/t2071.scala
new file mode 100644
index 0000000000..a96edb4cfb
--- /dev/null
+++ b/test/pending/pos/t2071.scala
@@ -0,0 +1,14 @@
+trait Iterable[+S]
+trait Box[U]
+
+trait A {
+ type T <: Iterable[S] forSome { type S <: Box[U]; type U }
+}
+
+trait B extends A {
+ type T <: Iterable[S] forSome { type S <: Box[U]; type U }
+}
+But according to SLS, 3.5.1 Type Equivalence: Two existential types (§3.2.10) are equivalent if they have the same number of quantifiers, and, after renaming one list of type quantifiers by another, the quantified types as well as lower and upper bounds of corresponding quantifiers are equivalent.
+
+So, every existential type must be equivalent to (and conform to) itself.
+Attachments
diff --git a/test/pending/pos/t2081.scala b/test/pending/pos/t2081.scala
new file mode 100644
index 0000000000..72ebd0557b
--- /dev/null
+++ b/test/pending/pos/t2081.scala
@@ -0,0 +1,7 @@
+class RichInt(n: Int) {
+ def days = 1000*60*60*24*n
+}
+
+implicit def RichInt(n: Int): RichInt = new RichInt(n)
+
+10.days
diff --git a/test/pending/pos/t2099.scala b/test/pending/pos/t2099.scala
new file mode 100644
index 0000000000..ddeee58a4b
--- /dev/null
+++ b/test/pending/pos/t2099.scala
@@ -0,0 +1,27 @@
+
+
+I have a trait:
+
+trait Vis[+T]
+
+and an object/class pair:
+
+object VisImpl? { def apply() = new VisImpl? } class VisImpl? extends Vis[Missing]
+
+Where Missing is some class of mine. In a separate project (where Vis and VisImpl? are on the classpath but Missing is not), if I do:
+
+object Test extends Application {
+
+ val v = VisImpl?() println(v)
+
+}
+
+This causes a Scala compiler error (using 2.7.5 compiler). The error is:
+
+"Caused by java.lang.RuntimeException?: malformed Scala signature of VisImpl? at 3634; reference value data of package mypack refers to nonexisting symbol"
+
+Where mypack is the root package of the Missing class. This is not a helpful error as all my classes share the same root package and the problem is not in the VisImpl? declaration in any case.
+
+I would expect to see an error of the form:
+
+" Type parameter not found 'Missing': VisImpl? extends Vis[Missing] at Test: #4: val v = VisImpl?() "
diff --git a/test/pending/pos/t2108.scala b/test/pending/pos/t2108.scala
new file mode 100644
index 0000000000..cd73b42627
--- /dev/null
+++ b/test/pending/pos/t2108.scala
@@ -0,0 +1,2 @@
+val a: Vector[_ <: Vector[Any]] = Array(Array("", 0))
+val x = a(0) // java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to scala.collection.mutable.Vector
diff --git a/test/pending/pos/t2127.scala b/test/pending/pos/t2127.scala
new file mode 100644
index 0000000000..a196a95c58
--- /dev/null
+++ b/test/pending/pos/t2127.scala
@@ -0,0 +1,29 @@
+
+
+As discussed here: http://www.nabble.com/Companion-object-constructor-visibility-td24342096.html
+
+//Simplified example:
+
+ class Foo private (val value : Int)
+
+ abstract class Bar(val ctor : (Int) => Foo)
+
+ object Foo extends Bar(new Foo(_)) //<--- ILLEGAL ACCESS
+
+//however the following is legal:
+
+ class Foo private (val value : Int)
+
+ abstract class Bar{
+
+ var ctor : (Int) => Foo
+
+ }
+
+ object Foo extends Bar{
+
+ ctor = new Foo(_) //<--- Legal access
+
+ }
+
+The constructor invocation of Bar is done within the scope of object Foo's constructor, and therefor the private constructor of Foo should be visible and accessible.
diff --git a/test/pending/pos/t2130.scala b/test/pending/pos/t2130.scala
new file mode 100644
index 0000000000..8e978b125b
--- /dev/null
+++ b/test/pending/pos/t2130.scala
@@ -0,0 +1,44 @@
+Assertion failed while re-compiling a package object containing a case class
+Reported by: rjm Owned by: odersky
+Priority: normal Component: Compiler
+Keywords: Cc: erik.engbrecht@…
+Fixed in version:
+Description
+
+While playing with the latest 2.8 snapshot (r18215-b20090706020217 to be precise) I noticed that a package object containing a case class gets an assertion failure when re-compiling (i.e., the class files already exist from a previous run, even a previous build of the exact same source). A minimal test case:
+
+package object foo {
+
+ case class X()
+
+}
+
+And the error:
+
+Exception in thread "main" java.lang.AssertionError?: assertion failed: List(object package$X, object package$X)
+
+ at scala.Predef$.assert(Predef.scala:97) at scala.tools.nsc.symtab.Symbols$Symbol.suchThat(Symbols.scala:988) at scala.tools.nsc.symtab.Symbols$Symbol.linkedModuleOfClass(Symbols.scala:1159) at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator?.genClass(GenJVM.scala:203) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase?$$anonfun$run$2.apply(GenJVM.scala:50) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase?$$anonfun$run$2.apply(GenJVM.scala:50) at scala.collection.Iterator$class.foreach(Iterator.scala:500) at scala.collection.generic.MapTemplate?$$anon$4.foreach(MapTemplate?.scala:156) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase?.run(GenJVM.scala:50) at scala.tools.nsc.Global$Run.compileSources(Global.scala:781) at scala.tools.nsc.Global$Run.compile(Global.scala:855) at scala.tools.nsc.Main$.process(Main.scala:75) at scala.tools.nsc.Main$.main(Main.scala:89) at scala.tools.nsc.Main.main(Main.scala)
+
+A normal class does not cause the failure; nor does a case object.
+Attachments
+Change History
+Changed 4 weeks ago by eengbrec
+
+ * cc erik.engbrecht@… added
+
+Changed 3 weeks ago by rompf
+
+ * owner changed from scala_reviewer to scala_meeting
+
+Changed 3 weeks ago by rompf
+
+ * owner changed from scala_meeting to odersky
+
+Add/Change #2130 (Assertion failed while re-compiling a package object containing a case class)
+Comment (you may use WikiFormatting here):
+
+Change Properties
+Summary:
+Reporter:
+Description: While playing with the latest 2.8 snapshot (r18215-b20090706020217 to be precise) I noticed that a package object containing a case class gets an assertion failure when re-compiling (i.e., the class files already exist from a previous run, even a previous build of the exact same source). A minimal test case: package object foo { case class X() } And the error: Exception in thread "main" java.lang.AssertionError: assertion failed: List(object package$X, object package$X) at scala.Predef$.assert(Predef.scala:97) at scala.tools.nsc.symtab.Symbols$Symbol.suchThat(Symbols.scala:988) at scala.tools.nsc.symtab.Symbols$Symbol.linkedModuleOfClass(Symbols.scala:1159) at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genClass(GenJVM.scala:203) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$2.apply(GenJVM.scala:50) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$2.apply(GenJVM.scala:50) at scala.collection.Iterator$class.foreach(Iterator.scala:500) at scala.collection.generic.MapTemplate$$anon$4.foreach(MapTemplate.scala:156) at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run(GenJVM.scala:50) at scala.tools.nsc.Global$Run.compileSources(Global.scala:781) at scala.tools.nsc.Global$Run.compile(Global.scala:855) at scala.tools.nsc.Main$.process(Main.scala:75) at scala.tools.nsc.Main$.main(Main.scala:89) at scala.tools.nsc.Main.main(Main.scala) A normal class does not cause the failure; nor does a case object.
+Type:
diff --git a/test/pending/pos/t2162.scala b/test/pending/pos/t2162.scala
new file mode 100644
index 0000000000..f90d48101d
--- /dev/null
+++ b/test/pending/pos/t2162.scala
@@ -0,0 +1,19 @@
+class Foo(x: Int)
+class Bar extends Foo(1)
+
+trait A {
+ def foo[T <: Foo]
+}
+class B extends A {
+ def foo[Bar] { println("B.foo[Bar]") }
+}
+object test {
+ val x = new B
+ val y = new A {
+ def foo[Bar] { println("A.foo[Bar]") }
+ }
+ def main(args: Array[String]) {
+ x.foo // ok
+ y.foo // java.lang.AssertionError: assertion failed (Erasure.scala:441 in r18338))
+ }
+}
diff --git a/test/pending/pos/t2173.scala b/test/pending/pos/t2173.scala
new file mode 100644
index 0000000000..9a9a2edce4
--- /dev/null
+++ b/test/pending/pos/t2173.scala
@@ -0,0 +1,17 @@
+
+
+This (somewhat convoluted) code fails to compile
+
+class A[+U>:Null] {
+
+ type R[+X>:Null] = X type O[+X] = A[R[X]]
+
+}
+
+with the following error:
+
+type arguments [A.this.R[X]] do not conform to class A's type parameter bounds [+U >: Null]
+
+However, because type R[+X>:Null] is identical to X, it should carry X bounds and R[X] lower bound should be known to be X's lower bound, i.e. Null.
+
+The same problem occurs with upper bounds.
diff --git a/test/pending/pos/t2178.scala b/test/pending/pos/t2178.scala
new file mode 100644
index 0000000000..9ee3165a72
--- /dev/null
+++ b/test/pending/pos/t2178.scala
@@ -0,0 +1,10 @@
+scala> Array(Array(1)).last.last
+java.lang.ClassCastException: [I
+ at .<init>(<console>:5)
+ at .<clinit>(<console>)
+ at RequestResult$.<init>(<console>:4)
+ at RequestResult$.<clinit>(<console>)
+ at RequestResult$result(<console>)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+ at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
+ at sun.reflect.DelegatingMethodAccessorImpl...
diff --git a/test/pending/pos/t2179.scala b/test/pending/pos/t2179.scala
new file mode 100644
index 0000000000..fd37d8f760
--- /dev/null
+++ b/test/pending/pos/t2179.scala
@@ -0,0 +1,6 @@
+on trunk r18368, this delightful little poison pill:
+
+(Nil:List[List[Double]]).reduceLeft((_: Any, _: Any) => Nil.indices.map(_ => 0d))
+
+sends the compiler into an apparently infinite loop. a sample thread dump shows:
+
diff --git a/test/pending/pos/t2185,.scala b/test/pending/pos/t2185,.scala
new file mode 100644
index 0000000000..98e544e5ad
--- /dev/null
+++ b/test/pending/pos/t2185,.scala
@@ -0,0 +1,3 @@
+scala> def foo { Nil.map(identity) }
+<console>:4: error: could not find implicit value for parameter bf:scala.collection.generic.BuilderFactory[Nothing,Unit,List[Nothing]].
+ def foo { Nil.map(identity) }
diff --git a/test/pending/pos/t2188.scala b/test/pending/pos/t2188.scala
new file mode 100644
index 0000000000..e9f6e4fb2c
--- /dev/null
+++ b/test/pending/pos/t2188.scala
@@ -0,0 +1,9 @@
+scala> implicit def toJavaList[A](t:collection.Sequence[A]):java.util.List[A] =
+ | java.util.Arrays.asList(t.toArray:_*)
+toJavaList: [A](t: Sequence[A])java.util.List[A]
+
+scala> val x: java.util.List[String] = List("foo")
+<console>:7: error: type mismatch;
+ found : List[Any]
+ required: java.util.List[String]
+ val x: java.util.List[String] = List("foo")
diff --git a/test/pending/pos/t2194.scala b/test/pending/pos/t2194.scala
new file mode 100644
index 0000000000..6197ca0e90
--- /dev/null
+++ b/test/pending/pos/t2194.scala
@@ -0,0 +1,15 @@
+scala> class C
+defined class C
+
+scala> def f = { object o extends C; o}
+f: ewo.type forSome { val o: o; type o <: C with ScalaObject }
+
+scala> val x = f
+<console>:6: error: type mismatch;
+ found : o.type(in object $iw) where type o.type(in object $iw) <: o with Singleton
+ required: o.type(in value x) forSome { type o.type(in value x) <: o with Singleton; type o <: C with ScalaObject }
+ val x = f
+ ^
+
+scala> val x : C = f
+x: C = o$2$@111985e
diff --git a/test/pending/pos/t2201.scala b/test/pending/pos/t2201.scala
new file mode 100644
index 0000000000..21af170cf1
--- /dev/null
+++ b/test/pending/pos/t2201.scala
@@ -0,0 +1,8 @@
+class Test
+object Test { implicit def view(x : Test) = 0 }
+
+object Call {
+ def call(implicit view : Test => Int) = view(null)
+ call
+ call
+}
diff --git a/test/pending/pos/ticket2251.scala b/test/pending/pos/ticket2251.scala
new file mode 100644
index 0000000000..7b6efb0ea0
--- /dev/null
+++ b/test/pending/pos/ticket2251.scala
@@ -0,0 +1,25 @@
+
+// Martin: I am not sure this is a solvable problem right now. I'll leave it in pending.
+// derived from pos/bug1001
+class A
+trait B[T <: B[T]] extends A
+class C extends B[C]
+class D extends B[D]
+
+class Data {
+ // force computing lub of C and D (printLubs enabled:)
+
+/*
+lub of List(D, C) at depth 2
+ lub of List(D, C) at depth 1
+ lub of List(D, C) at depth 0
+ lub of List(D, C) is A
+ lub of List(D, C) is B[_1] forSome { type _1 >: D with C <: A }
+lub of List(D, C) is B[_2] forSome { type _2 >: D with C{} <: B[_1] forSome { type _1 >: D with C{} <: A } }
+*/
+// --> result = WRONG
+
+ // should be: B[X] forSome {type X <: B[X]} -- can this be done automatically? for now, just detect f-bounded polymorphism and fall back to more coarse approximation
+
+ val data: List[A] = List(new C, new D)
+}
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)