diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-05 06:01:19 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-05 06:01:19 +0000 |
commit | 4e7fd5ce080a42fb4c6eeba5f8a005bd973d6c8e (patch) | |
tree | a44c5ed902c1abc93303c9cdfb162d2c9b97e364 /test/files | |
parent | 98c87462f7ffcc14dc4fbab9df586a200b77428b (diff) | |
download | scala-4e7fd5ce080a42fb4c6eeba5f8a005bd973d6c8e.tar.gz scala-4e7fd5ce080a42fb4c6eeba5f8a005bd973d6c8e.tar.bz2 scala-4e7fd5ce080a42fb4c6eeba5f8a005bd973d6c8e.zip |
Added -Xmigration option and @migration annotat...
Added -Xmigration option and @migration annotation. At present it will
warn about the following changes from 2.7 to 2.8:
Stack iterator order reversed
mutable.Set.map returns a Set and thus discards duplicates
A case 'x @ Pattern' matches differently than 'Pattern'
Review by odersky.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/migration28.check | 8 | ||||
-rw-r--r-- | test/files/neg/migration28.flags | 1 | ||||
-rw-r--r-- | test/files/neg/migration28.scala | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/test/files/neg/migration28.check b/test/files/neg/migration28.check new file mode 100644 index 0000000000..19aba2c31d --- /dev/null +++ b/test/files/neg/migration28.check @@ -0,0 +1,8 @@ +migration28.scala:5: error: method ++= in class Stack is deprecated: use pushAll + s ++= List(1,2,3) + ^ +migration28.scala:7: error: method foreach in class Stack has changed semantics: + Stack iterator and foreach now traverse in FIFO order. + s foreach (_ => ()) + ^ +two errors found diff --git a/test/files/neg/migration28.flags b/test/files/neg/migration28.flags new file mode 100644 index 0000000000..f7025d0226 --- /dev/null +++ b/test/files/neg/migration28.flags @@ -0,0 +1 @@ +-Yfatal-warnings -Xmigration diff --git a/test/files/neg/migration28.scala b/test/files/neg/migration28.scala new file mode 100644 index 0000000000..090b32d690 --- /dev/null +++ b/test/files/neg/migration28.scala @@ -0,0 +1,12 @@ +object Test { + import scala.collection.mutable._ + + val s = new Stack[Int] + s ++= List(1,2,3) + s map (_ + 1) + s foreach (_ => ()) + + def main(args: Array[String]): Unit = { + + } +} |