diff options
author | Paul Phillips <paulp@improving.org> | 2013-02-01 17:41:04 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-02-01 17:41:04 -0800 |
commit | 3dd9b3683b10edcf4f58ba1d98d4914c04614d87 (patch) | |
tree | 6be6c0f233b67595c306b37fde1cf3e08252efc8 /test | |
parent | ccaa65a4969572631746d40d35bcd1fcfcaa51a9 (diff) | |
parent | b403234a27518f35acc360bfa0333b00fdc85175 (diff) | |
download | scala-3dd9b3683b10edcf4f58ba1d98d4914c04614d87.tar.gz scala-3dd9b3683b10edcf4f58ba1d98d4914c04614d87.tar.bz2 scala-3dd9b3683b10edcf4f58ba1d98d4914c04614d87.zip |
Merge commit 'b403234a27' into wip/fresh-merge2
Conflicts:
src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
test/files/neg/t6963.check
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t6963.check | 4 | ||||
-rw-r--r-- | test/files/neg/t6963.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6963.scala | 3 | ||||
-rw-r--r-- | test/files/neg/t6963a.check | 5 | ||||
-rw-r--r-- | test/files/neg/t6963a.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6963a.scala | 5 | ||||
-rw-r--r-- | test/files/neg/t6963b.check | 13 | ||||
-rw-r--r-- | test/files/neg/t6963b.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6963b.scala | 20 | ||||
-rw-r--r-- | test/files/pos/t6963c.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t6963c.scala | 25 | ||||
-rw-r--r-- | test/files/run/t3353.check | 1 | ||||
-rw-r--r-- | test/files/run/t3353.scala | 10 | ||||
-rw-r--r-- | test/files/run/t6853.scala | 18 | ||||
-rw-r--r-- | test/scaladoc/run/SI-6017.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/SI-6017.scala | 23 |
16 files changed, 124 insertions, 8 deletions
diff --git a/test/files/neg/t6963.check b/test/files/neg/t6963.check deleted file mode 100644 index cc4a7a48fc..0000000000 --- a/test/files/neg/t6963.check +++ /dev/null @@ -1,4 +0,0 @@ -warning: -Xmigration is deprecated: This setting is no longer useful and will be removed. Please remove it from your build. -error: No warnings can be incurred under -Xfatal-warnings. -one warning found -one error found diff --git a/test/files/neg/t6963.flags b/test/files/neg/t6963.flags deleted file mode 100644 index 0b6d71496a..0000000000 --- a/test/files/neg/t6963.flags +++ /dev/null @@ -1 +0,0 @@ --Xmigration -deprecation -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t6963.scala b/test/files/neg/t6963.scala deleted file mode 100644 index 4da52764f5..0000000000 --- a/test/files/neg/t6963.scala +++ /dev/null @@ -1,3 +0,0 @@ - -object test { -} diff --git a/test/files/neg/t6963a.check b/test/files/neg/t6963a.check new file mode 100644 index 0000000000..159896fd10 --- /dev/null +++ b/test/files/neg/t6963a.check @@ -0,0 +1,5 @@ +t6963a.scala:4: error: method scanRight in trait TraversableLike has changed semantics in version 2.9.0: +The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. + List(1,2,3,4,5).scanRight(0)(_+_) + ^ +one error found diff --git a/test/files/neg/t6963a.flags b/test/files/neg/t6963a.flags new file mode 100644 index 0000000000..4c61ed9430 --- /dev/null +++ b/test/files/neg/t6963a.flags @@ -0,0 +1 @@ +-Xfatal-warnings -Xmigration:2.7 diff --git a/test/files/neg/t6963a.scala b/test/files/neg/t6963a.scala new file mode 100644 index 0000000000..b3366b2557 --- /dev/null +++ b/test/files/neg/t6963a.scala @@ -0,0 +1,5 @@ +object Test { + import scala.collection.mutable._ + + List(1,2,3,4,5).scanRight(0)(_+_) +} diff --git a/test/files/neg/t6963b.check b/test/files/neg/t6963b.check new file mode 100644 index 0000000000..7e205a41d0 --- /dev/null +++ b/test/files/neg/t6963b.check @@ -0,0 +1,13 @@ +t6963b.scala:2: error: An Array will no longer match as Seq[_]. + def f1(x: Any) = x.isInstanceOf[Seq[_]] + ^ +t6963b.scala:4: error: An Array will no longer match as Seq[_]. + case _: Seq[_] => true + ^ +t6963b.scala:16: error: An Array will no longer match as Seq[_]. + case (Some(_: Seq[_]), Nil, _) => 1 + ^ +t6963b.scala:17: error: An Array will no longer match as Seq[_]. + case (None, List(_: List[_], _), _) => 2 + ^ +four errors found diff --git a/test/files/neg/t6963b.flags b/test/files/neg/t6963b.flags new file mode 100644 index 0000000000..83caa2b147 --- /dev/null +++ b/test/files/neg/t6963b.flags @@ -0,0 +1 @@ +-Xmigration:2.7 -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t6963b.scala b/test/files/neg/t6963b.scala new file mode 100644 index 0000000000..3cfa8f0dca --- /dev/null +++ b/test/files/neg/t6963b.scala @@ -0,0 +1,20 @@ +object Test { + def f1(x: Any) = x.isInstanceOf[Seq[_]] + def f2(x: Any) = x match { + case _: Seq[_] => true + case _ => false + } + + def f3(x: Any) = x match { + case _: Array[_] => true + case _ => false + } + + def f4(x: Any) = x.isInstanceOf[Traversable[_]] + + def f5(x1: Any, x2: Any, x3: AnyRef) = (x1, x2, x3) match { + case (Some(_: Seq[_]), Nil, _) => 1 + case (None, List(_: List[_], _), _) => 2 + case _ => 3 + } +} diff --git a/test/files/pos/t6963c.flags b/test/files/pos/t6963c.flags new file mode 100644 index 0000000000..4d6e04914f --- /dev/null +++ b/test/files/pos/t6963c.flags @@ -0,0 +1 @@ +-Xmigration:2.9 -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t6963c.scala b/test/files/pos/t6963c.scala new file mode 100644 index 0000000000..0b6b5c757f --- /dev/null +++ b/test/files/pos/t6963c.scala @@ -0,0 +1,25 @@ +object Test { + def f1(x: Any) = x.isInstanceOf[Seq[_]] + def f2(x: Any) = x match { + case _: Seq[_] => true + case _ => false + } + + def f3(x: Any) = x match { + case _: Array[_] => true + case _ => false + } + + def f4(x: Any) = x.isInstanceOf[Traversable[_]] + + def f5(x1: Any, x2: Any, x3: AnyRef) = (x1, x2, x3) match { + case (Some(_: Seq[_]), Nil, _) => 1 + case (None, List(_: List[_], _), _) => 2 + case _ => 3 + } + + def f5: Unit = { + import scala.collection.mutable._ + List(1,2,3,4,5).scanRight(0)(_+_) + } +} diff --git a/test/files/run/t3353.check b/test/files/run/t3353.check new file mode 100644 index 0000000000..8b4ae1fe69 --- /dev/null +++ b/test/files/run/t3353.check @@ -0,0 +1 @@ +Got: foo and None diff --git a/test/files/run/t3353.scala b/test/files/run/t3353.scala new file mode 100644 index 0000000000..eeb63c1b05 --- /dev/null +++ b/test/files/run/t3353.scala @@ -0,0 +1,10 @@ +object Test extends App { + + "foo" match { + case Matcher(result) => println(result) + } + + object Matcher{ + def unapply(s: String)(implicit secondParam: Option[String] = None) = Some("Got: " + s + " and " + secondParam) + } +} diff --git a/test/files/run/t6853.scala b/test/files/run/t6853.scala new file mode 100644 index 0000000000..352375c99c --- /dev/null +++ b/test/files/run/t6853.scala @@ -0,0 +1,18 @@ +// Test cases: the only place we can cut and paste without crying +// ourself to sleep. +object Test { + + def main(args: Array[String]): Unit = { + // First testing the basic operations + val m = collection.mutable.ListMap[String, Int]() + var i = 0 + while(i < 2) { m += ("foo" + i) -> i; i = i+1} + assert(m == Map("foo1"->1,"foo0"->0)) + m-= "foo0" + assert(m == Map("foo1"->1)) + // Now checking if it scales as described in SI-6853 + i = 0 + while(i < 80000) { m += ("foo" + i) -> i; i = i+1} + assert(m.size == 80000) + } +} diff --git a/test/scaladoc/run/SI-6017.check b/test/scaladoc/run/SI-6017.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/SI-6017.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/SI-6017.scala b/test/scaladoc/run/SI-6017.scala new file mode 100644 index 0000000000..a4950e48d8 --- /dev/null +++ b/test/scaladoc/run/SI-6017.scala @@ -0,0 +1,23 @@ +import scala.tools.nsc.doc +import scala.tools.nsc.doc.model._ +import scala.tools.nsc.doc.html.page.{Index, ReferenceIndex} +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + override def scaladocSettings = "" + override def code = """ + class STAR + class Star + """ + + def testModel(rootPackage: Package) { + model match { + case Some(universe) => { + val index = IndexModelFactory.makeIndex(universe) + // Because "STAR" and "Star" are different + assert(index.firstLetterIndex('s').keys.toSeq.length == 2) + } + case _ => assert(false) + } + } +} |