summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-10-12 09:41:13 +0000
committerMartin Odersky <odersky@gmail.com>2009-10-12 09:41:13 +0000
commitf75ee36c6fb4386eb89f19c40dfa000076aa9307 (patch)
tree1c43adb5b8b194a7a9c14d4ad7cdca04261cda68
parentbf9ca9a2b7455164c335a48826143749b6b107eb (diff)
downloadscala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.tar.gz
scala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.tar.bz2
scala-f75ee36c6fb4386eb89f19c40dfa000076aa9307.zip
reverted immutable.Vector because it gave rando...
reverted immutable.Vector because it gave random build errors on my machine. Fixed various tickets, updated test and check files.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala18
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala18
-rw-r--r--src/library/scala/collection/IterableViewLike.scala6
-rw-r--r--src/library/scala/collection/SeqViewLike.scala24
-rw-r--r--src/library/scala/collection/TraversableViewLike.scala2
-rw-r--r--src/library/scala/collection/VectorView.scala1
-rw-r--r--src/library/scala/collection/VectorViewLike.scala12
-rw-r--r--src/library/scala/collection/mutable/VectorView.scala73
-rw-r--r--src/library/scala/collection/mutable/VectorViewLike.scala68
-rw-r--r--test/files/jvm/interpreter.check20
-rw-r--r--test/files/jvm/interpreter.scala9
-rw-r--r--test/files/neg/t2130.check4
-rwxr-xr-xtest/files/neg/t2130.scala6
-rw-r--r--test/files/neg/t2336.check4
-rwxr-xr-xtest/files/neg/t2336.scala7
-rwxr-xr-xtest/files/pos/lexical.scala9
-rwxr-xr-xtest/files/pos/packageobjs.scala8
-rw-r--r--test/files/pos/strings.scala4
-rw-r--r--test/files/pos/t2023.scala16
-rwxr-xr-xtest/files/pos/t2060.scala44
-rwxr-xr-xtest/files/pos/t2425.scala15
-rwxr-xr-xtest/files/run/t2127.scala32
-rw-r--r--test/files/run/viewtest.check18
-rwxr-xr-xtest/files/run/viewtest.scala46
-rw-r--r--test/pending/pos/t1003.scala2
-rw-r--r--test/pending/pos/t1756.scala44
-rw-r--r--test/pending/pos/t1786.scala17
-rw-r--r--test/pending/pos/t2071.scala7
-rw-r--r--test/pending/pos/t2099.scala2
-rw-r--r--test/pending/pos/t2127.scala11
-rw-r--r--test/pending/pos/t2130.scala39
-rw-r--r--test/pending/pos/t2162.scala1
-rw-r--r--test/pending/pos/t2178.scala1
-rw-r--r--test/pending/pos/t2185,.scala3
-rw-r--r--test/pending/pos/t2188.scala4
-rw-r--r--test/pending/pos/t2194.scala21
-rw-r--r--test/pending/run/t1044.scala1
-rw-r--r--test/pending/run/t1939.scala3
-rw-r--r--test/pending/run/t2034.scala3
39 files changed, 444 insertions, 179 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 47ede4228e..6b3d24ffa2 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -3247,6 +3247,9 @@ A type's typeSymbol should never be inspected directly.
}
}
+ class MissingAliasException extends Exception
+ val missingAliasException = new MissingAliasException
+
object adaptToNewRunMap extends TypeMap {
private def adaptToNewRun(pre: Type, sym: Symbol): Symbol = {
if (sym.isModuleClass && !phase.flatClasses) {
@@ -3256,7 +3259,9 @@ A type's typeSymbol should never be inspected directly.
} else {
var rebind0 = pre.findMember(sym.name, BRIDGE, 0, true)(NoSymbol)
if (rebind0 == NoSymbol) {
- assert(false, ""+pre+"."+sym+" does no longer exist, phase = "+phase) }
+ if (sym.isAliasType) throw missingAliasException
+ assert(false, pre+"."+sym+" does no longer exist, phase = "+phase)
+ }
/** The two symbols have the same fully qualified name */
def corresponds(sym1: Symbol, sym2: Symbol): Boolean =
sym1.name == sym2.name && (sym1.isPackageClass || corresponds(sym1.owner, sym2.owner))
@@ -3294,9 +3299,14 @@ A type's typeSymbol should never be inspected directly.
else {
val pre1 = this(pre)
val args1 = args mapConserve (this)
- val sym1 = adaptToNewRun(pre1, sym)
- if ((pre1 eq pre) && (sym1 eq sym) && (args1 eq args)/* && sym.isExternal*/) tp
- else typeRef(pre1, sym1, args1)
+ try {
+ val sym1 = adaptToNewRun(pre1, sym)
+ if ((pre1 eq pre) && (sym1 eq sym) && (args1 eq args)/* && sym.isExternal*/) tp
+ else typeRef(pre1, sym1, args1)
+ } catch {
+ case ex: MissingAliasException =>
+ apply(tp.dealias)
+ }
}
case MethodType(params, restp) =>
val restp1 = this(restp)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 133c0c1b3e..a83ce8e53b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -735,10 +735,15 @@ self: Analyzer =>
"classType", tp,
(if ((pre eq NoPrefix) || pre.typeSymbol.isStaticOwner) suffix
else findSubManifest(pre) :: suffix): _*)
- } else if (sym.isAbstractType && !sym.isTypeParameterOrSkolem && !sym.isExistential) {
- manifestFactoryCall(
- "abstractType", tp,
- findSubManifest(pre) :: Literal(sym.name.toString) :: findManifest(tp0.bounds.hi) :: (args map findSubManifest): _*)
+ } else if (sym.isAbstractType) {
+ if (sym.isExistential)
+ EmptyTree // todo: change to existential parameter manifest
+ else if (sym.isTypeParameterOrSkolem)
+ EmptyTree // a manifest should have been found by normal searchImplicit
+ else
+ manifestFactoryCall(
+ "abstractType", tp,
+ findSubManifest(pre) :: Literal(sym.name.toString) :: findManifest(tp0.bounds.hi) :: (args map findSubManifest): _*)
} else {
EmptyTree // a manifest should have been found by normal searchImplicit
}
@@ -747,7 +752,10 @@ self: Analyzer =>
if (parents.length == 1) findManifest(parents.head)
else manifestFactoryCall("intersectionType", tp, parents map (findSubManifest(_)): _*)
case ExistentialType(tparams, result) =>
- mot(result)
+ existentialAbstraction(tparams, result) match {
+ case ExistentialType(_, _) => mot(result)
+ case t => mot(t)
+ }
case _ =>
EmptyTree
}
diff --git a/src/library/scala/collection/IterableViewLike.scala b/src/library/scala/collection/IterableViewLike.scala
index 5164cf62f1..5a2db7e02f 100644
--- a/src/library/scala/collection/IterableViewLike.scala
+++ b/src/library/scala/collection/IterableViewLike.scala
@@ -14,7 +14,7 @@ package scala.collection
import generic._
import TraversableView.NoBuilder
-/** A base class for views of Iterables.
+/** A template trait for a non-strict view of an iterable.
*
* @author Martin Odersky
* @version 2.8
@@ -64,8 +64,8 @@ extends Iterable[A] with IterableLike[A, This] with TraversableView[A, Coll] wit
trait ZippedAll[A1 >: A, B] extends Transformed[(A1, B)] {
protected[this] val other: Iterable[B]
- val thisElem: A1
- val thatElem: B
+ protected[this] val thisElem: A1
+ protected[this] val thatElem: B
override def iterator: Iterator[(A1, B)] =
self.iterator.zipAll(other.iterator, thisElem, thatElem)
}
diff --git a/src/library/scala/collection/SeqViewLike.scala b/src/library/scala/collection/SeqViewLike.scala
index 471d447a15..38cfa7ba05 100644
--- a/src/library/scala/collection/SeqViewLike.scala
+++ b/src/library/scala/collection/SeqViewLike.scala
@@ -15,7 +15,7 @@ import generic._
import Seq.fill
import TraversableView.NoBuilder
-/** A non-strict projection of an iterable.
+/** A template trait for a non-strict view of a sequence.
* @author Sean McDirmid
* @author Martin Odersky
* @version 2.8
@@ -65,7 +65,7 @@ trait SeqViewLike[+A,
}
trait Appended[B >: A] extends Transformed[B] with super.Appended[B] {
- lazy val restSeq = rest.toSeq
+ protected[this] lazy val restSeq = rest.toSeq
override def length = self.length + restSeq.length
override def apply(idx: Int) =
if (idx < self.length) self(idx) else restSeq(idx - self.length)
@@ -102,6 +102,20 @@ trait SeqViewLike[+A,
else throw new IndexOutOfBoundsException(idx.toString)
}
+ trait Zipped[B] extends Transformed[(A, B)] with super.Zipped[B] {
+ protected[this] lazy val thatSeq = other.toSeq
+ override def length: Int = self.length min thatSeq.length
+ override def apply(idx: Int) = (self.apply(idx), thatSeq.apply(idx))
+ }
+
+ trait ZippedAll[A1 >: A, B] extends Transformed[(A1, B)] with super.ZippedAll[A1, B] {
+ protected[this] lazy val thatSeq = other.toSeq
+ override def length: Int = self.length max thatSeq.length
+ override def apply(idx: Int) =
+ (if (idx < self.length) self.apply(idx) else thisElem,
+ if (idx < thatSeq.length) thatSeq.apply(idx) else thatElem)
+ }
+
trait Reversed extends Transformed[A] {
override def iterator: Iterator[A] = self.reverseIterator
override def length: Int = self.length
@@ -133,10 +147,10 @@ trait SeqViewLike[+A,
protected override def newSliced(_from: Int, _until: Int): Transformed[A] = new Sliced { val from = _from; val until = _until }
protected override def newDroppedWhile(p: A => Boolean): Transformed[A] = new DroppedWhile { val pred = p }
protected override def newTakenWhile(p: A => Boolean): Transformed[A] = new TakenWhile { val pred = p }
+ protected override def newZipped[B](that: Iterable[B]): Transformed[(A, B)] = new Zipped[B] { val other = that }
+ protected override def newZippedAll[A1 >: A, B](that: Iterable[B], _thisElem: A1, _thatElem: B): Transformed[(A1, B)] = new ZippedAll[A1, B] { val other = that; val thisElem = _thisElem; val thatElem = _thatElem }
protected def newReversed: Transformed[A] = new Reversed { }
- protected def newPatched[B >: A](_from: Int, _patch: Seq[B], _replaced: Int): Transformed[B] = new Patched[B] {
- val from = _from; val patch = _patch; val replaced = _replaced
- }
+ protected def newPatched[B >: A](_from: Int, _patch: Seq[B], _replaced: Int): Transformed[B] = new Patched[B] { val from = _from; val patch = _patch; val replaced = _replaced }
override def reverse: This = newReversed.asInstanceOf[This]
diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala
index b19c02ea35..9303e473fd 100644
--- a/src/library/scala/collection/TraversableViewLike.scala
+++ b/src/library/scala/collection/TraversableViewLike.scala
@@ -17,7 +17,7 @@ import Math.MAX_INT
import TraversableView.NoBuilder
/** <p>
- * A base class for views of <a href="../Traversable.html"
+ * A template trait for views of <a href="../Traversable.html"
* target="contentFrame"><code>Traversable</code></a>.<br/>
* Every subclass has to implement the <code>foreach</code> method.
* </p>
diff --git a/src/library/scala/collection/VectorView.scala b/src/library/scala/collection/VectorView.scala
index b679a4d04e..83705384be 100644
--- a/src/library/scala/collection/VectorView.scala
+++ b/src/library/scala/collection/VectorView.scala
@@ -26,4 +26,5 @@ trait VectorView[+A, +Coll] extends VectorViewLike[A, Coll, VectorView[A, Coll]]
object VectorView {
type Coll = TraversableView[_, C] forSome {type C <: Traversable[_]}
implicit def builderFactory[A]: BuilderFactory[A, VectorView[A, Vector[_]], Coll] = new BuilderFactory[A, VectorView[A, Vector[_]], Coll] { def apply(from: Coll) = new NoBuilder }
+ implicit def arrBuilderFactory[A]: BuilderFactory[A, VectorView[A, Array[A]], TraversableView[_, Array[_]]] = new BuilderFactory[A, VectorView[A, Array[A]], TraversableView[_, Array[_]]] { def apply(from: TraversableView[_, Array[_]]) = new NoBuilder }
}
diff --git a/src/library/scala/collection/VectorViewLike.scala b/src/library/scala/collection/VectorViewLike.scala
index dfaa0f4752..fa8b31301a 100644
--- a/src/library/scala/collection/VectorViewLike.scala
+++ b/src/library/scala/collection/VectorViewLike.scala
@@ -14,7 +14,7 @@ package scala.collection
import generic._
import TraversableView.NoBuilder
-/** A non-strict projection of an iterable.
+/** A template trait for a non-strict view of a vector.
*
* @author Sean McDirmid
* @author Martin Odersky
@@ -99,17 +99,11 @@ trait VectorViewLike[+A,
protected override def newSliced(_from: Int, _until: Int): Transformed[A] = new Sliced { val from = _from; val until = _until }
protected override def newDroppedWhile(p: A => Boolean): Transformed[A] = new DroppedWhile { val pred = p }
protected override def newTakenWhile(p: A => Boolean): Transformed[A] = new TakenWhile { val pred = p }
+ protected override def newZipped[B](that: Iterable[B]): Transformed[(A, B)] = new Zipped[B] { val other = that }
+ protected override def newZippedAll[A1 >: A, B](that: Iterable[B], _thisElem: A1, _thatElem: B): Transformed[(A1, B)] = new ZippedAll[A1, B] { val other = that; val thisElem = _thisElem; val thatElem = _thatElem }
protected override def newReversed: Transformed[A] = new Reversed { }
protected override def newPatched[B >: A](_from: Int, _patch: Seq[B], _replaced: Int): Transformed[B] = new Patched[B] {
val from = _from; val patch = _patch; val replaced = _replaced
}
- protected override def newZipped[B](that: Iterable[B]): Transformed[(A, B)] = new Zipped[B] {
- val other = that
- }
- protected override def newZippedAll[A1 >: A, B](that: Iterable[B], _thisElem: A1, _thatElem: B): Transformed[(A1, B)] = new ZippedAll[A1, B] {
- val other: Iterable[B] = that
- val thisElem = _thisElem
- val thatElem = _thatElem
- }
override def stringPrefix = "VectorView"
}
diff --git a/src/library/scala/collection/mutable/VectorView.scala b/src/library/scala/collection/mutable/VectorView.scala
index 1564511cab..45a21e3429 100644
--- a/src/library/scala/collection/mutable/VectorView.scala
+++ b/src/library/scala/collection/mutable/VectorView.scala
@@ -13,18 +13,85 @@ package scala.collection
package mutable
import generic._
+import Math.MAX_INT
import TraversableView.NoBuilder
-/** A non-strict projection of an iterable.
+/** A non-strict view of a mutable vector.
+ * This is a leaf class which mixes methods returning a plain vector view
+ * and methods returning a mutable vector view.
+ * There is no associated `Like' class.
* @author Sean McDirmid
* @author Martin Odersky
* @version 2.8
* @since 2.8
*/
-trait VectorView[A, +Coll] extends VectorViewLike[A, Coll, VectorView[A, Coll]]
+trait VectorView[A, +Coll] extends scala.collection.VectorView[A, Coll] {
+self =>
-object VectorView {
+ def update(idx: Int, elem: A)
+
+ trait Transformed[B] extends VectorView[B, Coll] with super.Transformed[B] {
+ def update(idx: Int, elem: B)
+ }
+
+ trait Sliced extends Transformed[A] with super.Sliced {
+ override def update(idx: Int, elem: A) =
+ if (idx + from < until) self.update(idx + from, elem)
+ else throw new IndexOutOfBoundsException(idx.toString)
+ override def slice(from1: Int, until1: Int): Transformed[A] =
+ newSliced(from1 max 0, until1 max 0)
+ }
+
+ trait Filtered extends Transformed[A] with super.Filtered {
+ override def update(idx: Int, elem: A) = self.update(index(idx), elem)
+ }
+
+ trait TakenWhile extends Transformed[A] with super.TakenWhile {
+ override def update(idx: Int, elem: A) =
+ if (idx < len) self.update(idx, elem)
+ else throw new IndexOutOfBoundsException(idx.toString)
+ }
+
+ trait DroppedWhile extends Transformed[A] with super.DroppedWhile {
+ override def update(idx: Int, elem: A) =
+ if (idx >= 0) self.update(idx + start, elem)
+ else throw new IndexOutOfBoundsException(idx.toString)
+ }
+
+ trait Reversed extends Transformed[A] with super.Reversed {
+ override def update(idx: Int, elem: A) = self.update(length - 1 - idx, elem)
+ }
+
+ /** Boilerplate method, to override in each subclass
+ * This method could be eliminated if Scala had virtual classes
+ */
+ protected override def newFiltered(p: A => Boolean): Transformed[A] = new Filtered { val pred = p }
+ protected override def newSliced(_from: Int, _until: Int): Transformed[A] = new Sliced { val from = _from; val until = _until }
+ protected override def newDroppedWhile(p: A => Boolean): Transformed[A] = new DroppedWhile { val pred = p }
+ protected override def newTakenWhile(p: A => Boolean): Transformed[A] = new TakenWhile { val pred = p }
+ protected override def newReversed: Transformed[A] = new Reversed { }
+
+ // Todo: if we replace VectorView[A, Coll] below by
+ // private[this] type This = VectorView[A, Coll]
+ // The interpreter will display resX.This.
+ // It shouldn't.
+
+ override def filter(p: A => Boolean): VectorView[A, Coll] = newFiltered(p)
+ override def init: VectorView[A, Coll] = newSliced(0, size - 1).asInstanceOf[VectorView[A, Coll]]
+ override def drop(n: Int): VectorView[A, Coll] = newSliced(n max 0, MAX_INT).asInstanceOf[VectorView[A, Coll]]
+ override def take(n: Int): VectorView[A, Coll] = newSliced(0, n).asInstanceOf[VectorView[A, Coll]]
+ override def slice(from: Int, until: Int): VectorView[A, Coll] = newSliced(from max 0, until).asInstanceOf[VectorView[A, Coll]]
+ override def dropWhile(p: A => Boolean): VectorView[A, Coll] = newDroppedWhile(p).asInstanceOf[VectorView[A, Coll]]
+ override def takeWhile(p: A => Boolean): VectorView[A, Coll] = newTakenWhile(p).asInstanceOf[VectorView[A, Coll]]
+ override def span(p: A => Boolean): (VectorView[A, Coll], VectorView[A, Coll]) = (takeWhile(p), dropWhile(p))
+ override def splitAt(n: Int): (VectorView[A, Coll], VectorView[A, Coll]) = (take(n), drop(n))
+ override def reverse: VectorView[A, Coll] = newReversed.asInstanceOf[VectorView[A, Coll]]
+}
+
+/*
+ * object VectorView {
type Coll = TraversableView[_, C] forSome { type C <: scala.collection.Traversable[_] }
implicit def builderFactory[A]: BuilderFactory[A, VectorView[A, Vector[_]], Coll] = new BuilderFactory[A, VectorView[A, mutable.Vector[_]], Coll] { def apply(from: Coll) = new NoBuilder }
}
+*/
diff --git a/src/library/scala/collection/mutable/VectorViewLike.scala b/src/library/scala/collection/mutable/VectorViewLike.scala
deleted file mode 100644
index dbde90c024..0000000000
--- a/src/library/scala/collection/mutable/VectorViewLike.scala
+++ /dev/null
@@ -1,68 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-
-package scala.collection
-package mutable
-
-import TraversableView.NoBuilder
-
-/** A non-strict projection of an iterable.
- * @author Sean McDirmid
- * @author Martin Odersky
- * @version 2.8
- * @since 2.8
- */
-trait VectorViewLike[A,
- +Coll,
- +This <: VectorView[A, Coll] with VectorViewLike[A, Coll, This]]
- extends Vector[A] with VectorLike[A, This] with scala.collection.VectorView[A, Coll] with scala.collection.VectorViewLike[A, Coll, This]
-{ self =>
-
- trait Transformed[B] extends VectorView[B, Coll] with super.Transformed[B] {
- def update(idx: Int, elem: B)
- }
-
- trait Sliced extends Transformed[A] with super.Sliced {
- override def update(idx: Int, elem: A) =
- if (idx + from < until) self.update(idx + from, elem)
- else throw new IndexOutOfBoundsException(idx.toString)
- }
-
- trait Filtered extends Transformed[A] with super.Filtered {
- override def update(idx: Int, elem: A) = self.update(index(idx), elem)
- }
-
- trait TakenWhile extends Transformed[A] with super.TakenWhile {
- override def update(idx: Int, elem: A) =
- if (idx < len) self.update(idx, elem)
- else throw new IndexOutOfBoundsException(idx.toString)
- }
-
- trait DroppedWhile extends Transformed[A] with super.DroppedWhile {
- override def update(idx: Int, elem: A) =
- if (idx >= 0) self.update(idx + start, elem)
- else throw new IndexOutOfBoundsException(idx.toString)
- }
-
- trait Reversed extends Transformed[A] with super.Reversed {
- override def update(idx: Int, elem: A) = self.update(length - 1 - idx, elem)
- }
-
- /** Boilerplate method, to override in each subclass
- * This method could be eliminated if Scala had virtual classes
- */
- protected override def newFiltered(p: A => Boolean): Transformed[A] = new Filtered { val pred = p }
- protected override def newSliced(_from: Int, _until: Int): Transformed[A] = new Sliced { val from = _from; val until = _until }
- protected override def newDroppedWhile(p: A => Boolean): Transformed[A] = new DroppedWhile { val pred = p }
- protected override def newTakenWhile(p: A => Boolean): Transformed[A] = new TakenWhile { val pred = p }
- protected override def newReversed: Transformed[A] = new Reversed { }
-}
-
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 07c41b6a1f..27f8be2f57 100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -159,6 +159,22 @@ scala> two: Int = 2
scala>
scala>
scala>
+scala> xs: Array[_] = Array(1, 2)
+
+scala> res2: Int = 2
+
+scala> res3: Any = 1
+
+scala> res4: Array[_] = Array(2)
+
+scala> res5: Array[java.lang.String] = Array(abc, abc)
+
+scala> res6: scala.collection.mutable.GenericArray[_] = GenericArray(1, 2)
+
+scala> res7: Array[(_$1, _$1)] forSome { type _$1 } = Array((1,1), (2,2))
+
+scala>
+scala>
scala>
scala> <console>:1: error: '=' expected but '=>' found.
def x => y => z
@@ -171,7 +187,7 @@ scala> <console>:1: error: expected start of definition
scala>
scala>
scala>
-scala> | | | | res2: scala.xml.Elem =
+scala> | | | | res8: scala.xml.Elem =
<a>
<b d="dd" c="c"></b></a>
@@ -181,7 +197,7 @@ scala> | | | |
scala>
scala>
scala>
-scala> | | | res3: java.lang.String =
+scala> | | | res9: java.lang.String =
hello
there
diff --git a/test/files/jvm/interpreter.scala b/test/files/jvm/interpreter.scala
index 21c88734e0..a079af8fe2 100644
--- a/test/files/jvm/interpreter.scala
+++ b/test/files/jvm/interpreter.scala
@@ -92,6 +92,15 @@ val x20 = 1
val two = one + x5
+// handling generic wildcard arrays (#2386)
+// It's put here because type feedback is an important part of it.
+val xs: Array[_] = Array(1, 2)
+xs.size
+xs.head
+xs filter (_ == 2)
+xs map (_ => "abc")
+xs map (x => x)
+xs map (x => (x, x))
// interior syntax errors should *not* go into multi-line input mode.
// both of the following should abort immediately:
diff --git a/test/files/neg/t2130.check b/test/files/neg/t2130.check
new file mode 100644
index 0000000000..6d6902b121
--- /dev/null
+++ b/test/files/neg/t2130.check
@@ -0,0 +1,4 @@
+t2130.scala:4: error: implementation restriction: package object foo cannot contain case class X
+ case class X()
+ ^
+one error found
diff --git a/test/files/neg/t2130.scala b/test/files/neg/t2130.scala
new file mode 100755
index 0000000000..012698fd2a
--- /dev/null
+++ b/test/files/neg/t2130.scala
@@ -0,0 +1,6 @@
+// for now we disallow case class in package objects
+package object foo {
+
+ case class X()
+
+}
diff --git a/test/files/neg/t2336.check b/test/files/neg/t2336.check
new file mode 100644
index 0000000000..983717469c
--- /dev/null
+++ b/test/files/neg/t2336.check
@@ -0,0 +1,4 @@
+t2336.scala:6: error: type Foo[Int] is not a stable prefix
+ new Foo[Int]#Bar(0)
+ ^
+one error found
diff --git a/test/files/neg/t2336.scala b/test/files/neg/t2336.scala
new file mode 100755
index 0000000000..4cea02b721
--- /dev/null
+++ b/test/files/neg/t2336.scala
@@ -0,0 +1,7 @@
+// we get now: t2336.scala:5: error: type Foo[Int] is not a stable prefix
+class Foo[A] {
+ class Bar[B >: A](x: B) extends Foo[B]
+}
+object bug {
+ new Foo[Int]#Bar(0)
+}
diff --git a/test/files/pos/lexical.scala b/test/files/pos/lexical.scala
new file mode 100755
index 0000000000..034b84bf0f
--- /dev/null
+++ b/test/files/pos/lexical.scala
@@ -0,0 +1,9 @@
+// #2081
+class RichInt(n: Int) {
+ def days = 1000*60*60*24*n
+}
+
+object Test extends Application {
+ implicit def RichInt(n: Int): RichInt = new RichInt(n)
+ println(10.days)
+}
diff --git a/test/files/pos/packageobjs.scala b/test/files/pos/packageobjs.scala
new file mode 100755
index 0000000000..ccab133716
--- /dev/null
+++ b/test/files/pos/packageobjs.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/files/pos/strings.scala b/test/files/pos/strings.scala
index 3bf40e3dda..9fe8cfd94b 100644
--- a/test/files/pos/strings.scala
+++ b/test/files/pos/strings.scala
@@ -4,3 +4,7 @@ object test {
def f() = "hello".concat("world");
}
+// #1000
+object A {
+ println("""This a "raw" string ending with a "double quote"""")
+}
diff --git a/test/files/pos/t2023.scala b/test/files/pos/t2023.scala
new file mode 100644
index 0000000000..21c6fc96a6
--- /dev/null
+++ b/test/files/pos/t2023.scala
@@ -0,0 +1,16 @@
+trait C[A]
+
+object C {
+ implicit def ipl[A](implicit from: A => Ordered[A]): C[A] = null
+}
+
+object P {
+ def foo[A](i: A, j: A)(implicit c: C[A]): Unit = ()
+}
+
+class ImplicitChainTest {
+ def testTrivial: Unit = {
+ P.foo('0', '9')
+ P.foo('0', '9')
+ }
+}
diff --git a/test/files/pos/t2060.scala b/test/files/pos/t2060.scala
new file mode 100755
index 0000000000..2c701150e4
--- /dev/null
+++ b/test/files/pos/t2060.scala
@@ -0,0 +1,44 @@
+/* The problem here is that we cannot insert an implicit to
+ * add a polymorphic method which is then instantiated to the
+ * right type. When searching for the implicit in the `fails to compile
+ * line':
+ *
+ * val failure = 1.0 + new Op[Int]
+ *
+ * we reduce the problem to finding a function from Double to
+ * {+: _ >: Op[Int] <: Any}, that is, a method which takes
+ * an argument which is an Op[Int] or a supertype thereof.
+ * Class Rich is not a subtype of this structural record, because
+ * polymorphic method instantiation is not contained in subtyping.
+ * That is: The method type [I](op : Op[I]): Op[I] is not a subtype
+ * of (Op[Int]): Op[Int].
+ * At present it is unclear whether this problem can be solved.
+ */
+object Test {
+ class Op[I];
+ class IntOp extends Op[Int];
+
+ class Rich(x : Double) {
+ def + (op : IntOp): IntOp = op;
+ def + [I](op : Op[I]): Op[I] = op;
+ def plus [I](op : Op[I]): Op[I] = op;
+ }
+
+ implicit def iToRich(x : Double) =
+ new Rich(x);
+
+ // fails to compile
+ val x = 1.0 + new Op[Int]
+
+ // works as expected --
+ // problem isn't in adding new "+"
+ val a = 1.0 + new IntOp;
+
+ // works as expected --
+ // problem isn't in binding type variable I
+ val b = 1.0 plus new Op[Int];
+
+ // works as expected --
+ // problem isn't in using Rich.+[I](op : Op[I])
+ val c = iToRich(1.0) + new Op[Int];
+}
diff --git a/test/files/pos/t2425.scala b/test/files/pos/t2425.scala
new file mode 100755
index 0000000000..403f1a18d7
--- /dev/null
+++ b/test/files/pos/t2425.scala
@@ -0,0 +1,15 @@
+trait B
+class D extends B
+object Test extends Application {
+ def foo[T](bar: T) = {
+ bar match {
+ case _: Array[Array[_]] => println("array 2d")
+ case _: Array[_] => println("array 1d")
+ case _ => println("something else")
+ }
+ }
+ foo(Array.fill(10)(2))
+ foo(Array.fill(10, 10)(2))
+ foo(Array.fill(10, 10, 10)(2))
+ foo(List(1, 2, 3))
+}
diff --git a/test/files/run/t2127.scala b/test/files/run/t2127.scala
new file mode 100755
index 0000000000..869d8a38d6
--- /dev/null
+++ b/test/files/run/t2127.scala
@@ -0,0 +1,32 @@
+// Seems to be fixed in trunk
+
+// As discussed here: http://www.nabble.com/Companion-object-constructor-visibility-td24342096.html
+
+//Simplified example:
+
+ class Test private (val value : Int)
+
+ abstract class Bar(val ctor : (Int) => Test)
+
+ object Test extends Bar(new Test(_)) { //<--- ILLEGAL ACCESS
+ def main(args: Array[String]){}
+ }
+
+//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/files/run/viewtest.check b/test/files/run/viewtest.check
new file mode 100644
index 0000000000..ded3ac0e92
--- /dev/null
+++ b/test/files/run/viewtest.check
@@ -0,0 +1,18 @@
+SeqViewZ((x,0))
+ys defined
+mapping 1
+2
+mapping 1
+mapping 2
+mapping 3
+SeqViewMS(3, 4)
+mapping 3
+4
+mapping 1
+mapping 2
+mapping 3
+SeqViewM(2, 3, 4)
+mapping 1
+mapping 2
+mapping 3
+List(2, 3, 4)
diff --git a/test/files/run/viewtest.scala b/test/files/run/viewtest.scala
new file mode 100755
index 0000000000..0f00536c1c
--- /dev/null
+++ b/test/files/run/viewtest.scala
@@ -0,0 +1,46 @@
+import collection._
+object Test extends Application {
+
+ val xs: SeqView[(String, Int), Seq[_]] = List("x").view.zip(Stream.from(0))
+ println(xs)
+
+ val ys = List(1, 2, 3).view map { x => println("mapping "+x); x + 1 }
+ println("ys defined")
+ println(ys.head)
+ println(ys.tail)
+ println(ys(2))
+ println(ys)
+ println(ys.force)
+
+ val zs = Array(1, 2, 3).view
+ val as: VectorView[Int, Array[Int]] = zs map (_ + 1)
+ val bs: Array[Int] = as.force
+ val cs = zs.reverse
+ cs(0) += 1
+ assert(cs.force.deep == Array(4, 2, 1).deep)
+ assert(zs(2) == 4)
+ assert(bs.deep == Array(2, 3, 4).deep)
+}
+
+/* crash confirmed.
+2.8 regression: CCE when zipping list projection with stream
+Reported by: szeiger Owned by: odersky
+Priority: normal Component: Standard Library
+Keywords: collections, zip Cc:
+Fixed in version:
+Description
+
+Welcome to Scala version 2.8.0.r18784-b20090925021043 (Java HotSpot(TM) Client VM, Java 1.6.0_11).
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala> List("x").view.zip(Stream.from(0))List("x").view.zip(Stream.from(0))
+java.lang.ClassCastException: scala.collection.generic.IterableViewTemplate$$anon$8 cannot be cast to scala.collection.generic.SequenceView
+ 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.Nat...
+*/
diff --git a/test/pending/pos/t1003.scala b/test/pending/pos/t1003.scala
index 70a4c54ae0..27becdb10f 100644
--- a/test/pending/pos/t1003.scala
+++ b/test/pending/pos/t1003.scala
@@ -1,3 +1,3 @@
object A {
- classOf[String].getMethod("equals", Array(""))
+ classOf[String].getMethod("equals", "")
}
diff --git a/test/pending/pos/t1756.scala b/test/pending/pos/t1756.scala
index c22d5509e1..4f7202114c 100644
--- a/test/pending/pos/t1756.scala
+++ b/test/pending/pos/t1756.scala
@@ -1,3 +1,24 @@
+
+/**
+This is a tricky issue which has to do with the fact that too much conflicting
+type information is propagated into a single implicit search, where the intended
+solution applies two implicit searches.
+
+Roughly, in x + x * y, the first x is first typed as Poly[A]. That
+means the x * y is then typed as Poly[A]. Then the second x is typed
+as Poly[A], then y is typed as Poly[Poly[A]]. The application x * y
+fails, so the coef2poly implicit conversion is applied to x. That
+means we look for an implicit conversion from type Poly[A] to type
+?{val *(x$1: ?>: Poly[Poly[A]] <: Any): Poly[A]}. Note that the result
+type Poly[A] is propagated into the implicit search. Poly[A] comes as
+expected type from x+, because the lhs x is still typed as a Poly[A].
+This means that the argument of the implicit conversion is typechecked
+with expected type A with Poly[A]. And no solution is found.
+
+To solve this, I added a fallback scheme similar to implicit arguents:
+When an implicit view that adds a method matching given arguments and result
+type fails, try again without the result type.
+*/
trait Ring[T <: Ring[T]] {
def +(that: T): T
def *(that: T): T
@@ -13,18 +34,21 @@ class Poly[C <: Ring[C]](val c: C) extends Ring[Poly[C]] {
def *(that: Poly[C]) = new Poly(this.c*that.c)
}
-implicit def coef2poly[C <: Ring[C]](c: C) = new Poly(c)
+object Test extends Application {
+
+ implicit def coef2poly[C <: Ring[C]](c: C): Poly[C] = new Poly(c)
-val a = new A
-val x = new Poly(new A)
+ val a = new A
+ val x = new Poly(new A)
-x+a // works
-a+x // works
+ println(x+a) // works
+ println(a+x) // works
-val y = new Poly(new Poly(new A))
+ val y = new Poly(new Poly(new A))
-x+y*x // works
-x*y+x // works
-y*x+x // works
+ println(x+y*x) // works
+ println(x*y+x) // works
+ println(y*x+x) // works
-x+x*y
+ println(x+x*y) // failed before
+}
diff --git a/test/pending/pos/t1786.scala b/test/pending/pos/t1786.scala
index 86aaee0121..d0cf8c7bac 100644
--- a/test/pending/pos/t1786.scala
+++ b/test/pending/pos/t1786.scala
@@ -1,12 +1,19 @@
+/** This a consequence of the current type checking algorithm, where bounds
+ * are checked only after variables are instantiated. I believe this will change once we go to contraint-based type inference. Assigning low priority until then.
+ *
+ *
+ */
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
-}
+object Test extends Application {
+ def myMethod(i:MyClass[_]) {
+ i.myValue.intValue/2 // << error i is of type Any
+ }
-def myMethod(i:MyClass[_ <: SomeClass]) {
- i.myValue.intValue/2 // << works
+ 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/t2071.scala b/test/pending/pos/t2071.scala
index a96edb4cfb..a384cdfd3b 100644
--- a/test/pending/pos/t2071.scala
+++ b/test/pending/pos/t2071.scala
@@ -1,3 +1,8 @@
+/**
+ * We still have to evaluate whether we will permit existentials
+ * with cross type dependencies. My current reaction would be no.
+ * Ticket stays open until a decision is made.
+ */
trait Iterable[+S]
trait Box[U]
@@ -8,7 +13,9 @@ trait A {
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/t2099.scala b/test/pending/pos/t2099.scala
index ddeee58a4b..934b6691a7 100644
--- a/test/pending/pos/t2099.scala
+++ b/test/pending/pos/t2099.scala
@@ -1,4 +1,4 @@
-
+// nice to have, not terribly urgent, maybe?
I have a trait:
diff --git a/test/pending/pos/t2127.scala b/test/pending/pos/t2127.scala
index a196a95c58..e5d3550049 100644
--- a/test/pending/pos/t2127.scala
+++ b/test/pending/pos/t2127.scala
@@ -1,6 +1,6 @@
+// won't fix. Constructor code
-
-As discussed here: http://www.nabble.com/Companion-object-constructor-visibility-td24342096.html
+// As discussed here: http://www.nabble.com/Companion-object-constructor-visibility-td24342096.html
//Simplified example:
@@ -8,10 +8,12 @@ As discussed here: http://www.nabble.com/Companion-object-constructor-visibility
abstract class Bar(val ctor : (Int) => Foo)
- object Foo extends Bar(new Foo(_)) //<--- ILLEGAL ACCESS
+ object Foo extends Bar(new Foo(_)) { //<--- ILLEGAL ACCESS
+ def main(args: Array[String]){}
+ }
//however the following is legal:
-
+/*
class Foo private (val value : Int)
abstract class Bar{
@@ -27,3 +29,4 @@ As discussed here: http://www.nabble.com/Companion-object-constructor-visibility
}
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
index 8e978b125b..79aa5dd687 100644
--- a/test/pending/pos/t2130.scala
+++ b/test/pending/pos/t2130.scala
@@ -1,44 +1,5 @@
-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
index f90d48101d..b21404726b 100644
--- a/test/pending/pos/t2162.scala
+++ b/test/pending/pos/t2162.scala
@@ -1,3 +1,4 @@
+// crash verified; no solution yet
class Foo(x: Int)
class Bar extends Foo(1)
diff --git a/test/pending/pos/t2178.scala b/test/pending/pos/t2178.scala
index 9ee3165a72..98ea119299 100644
--- a/test/pending/pos/t2178.scala
+++ b/test/pending/pos/t2178.scala
@@ -1,3 +1,4 @@
+// fixed by now
scala> Array(Array(1)).last.last
java.lang.ClassCastException: [I
at .<init>(<console>:5)
diff --git a/test/pending/pos/t2185,.scala b/test/pending/pos/t2185,.scala
index 98e544e5ad..c0b63b34a8 100644
--- a/test/pending/pos/t2185,.scala
+++ b/test/pending/pos/t2185,.scala
@@ -1,3 +1,4 @@
-scala> def foo { Nil.map(identity) }
+// fixed in trunk
+scala> def foo { Nil.map(identity) } def foo { Nil.map(identity) } 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
index e9f6e4fb2c..3c8ee57636 100644
--- a/test/pending/pos/t2188.scala
+++ b/test/pending/pos/t2188.scala
@@ -1,5 +1,7 @@
+// test no longer applicable. but I think the underlying problem is fixed in trunk
+
scala> implicit def toJavaList[A](t:collection.Sequence[A]):java.util.List[A] =
- | java.util.Arrays.asList(t.toArray:_*)
+ | java.util.Arrays.asList(t.toArray:_*) java.util.Arrays.asList(t.toArray:_*)
toJavaList: [A](t: Sequence[A])java.util.List[A]
scala> val x: java.util.List[String] = List("foo")
diff --git a/test/pending/pos/t2194.scala b/test/pending/pos/t2194.scala
index 6197ca0e90..e87be509d1 100644
--- a/test/pending/pos/t2194.scala
+++ b/test/pending/pos/t2194.scala
@@ -1,15 +1,8 @@
-scala> class C
-defined class C
+// tricky to do differently?
+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
+object Test {
+ def f = { object o extends C; o}
+ val y: C = f
+ val x = f
+}
diff --git a/test/pending/run/t1044.scala b/test/pending/run/t1044.scala
index e10002e601..c521e5837b 100644
--- a/test/pending/run/t1044.scala
+++ b/test/pending/run/t1044.scala
@@ -1,3 +1,4 @@
+// looks OK
object Main extends Application{
val ducks = Array[AnyRef]("Huey", "Dewey", "Louie")
ducks.iterator/*.asInstanceOf[Iterator[String]]*/
diff --git a/test/pending/run/t1939.scala b/test/pending/run/t1939.scala
index 4860ca8169..44ab1769d2 100644
--- a/test/pending/run/t1939.scala
+++ b/test/pending/run/t1939.scala
@@ -1,5 +1,4 @@
-
-
+// works in trunk
class Module {}
abstract class T {
diff --git a/test/pending/run/t2034.scala b/test/pending/run/t2034.scala
index ff2a8773de..a599dc2224 100644
--- a/test/pending/run/t2034.scala
+++ b/test/pending/run/t2034.scala
@@ -1,3 +1,4 @@
+// no idea, reassigned to Iulian
object Test {
def main(args: Array[String]) {
@@ -7,7 +8,7 @@ object Test {
object foo {
class foo2 {
- override def toString = getClass.getSimpleName
+ override def toString = getClass.toString//.getSimpleName
}
}