diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-20 19:56:56 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-20 20:14:44 -0700 |
commit | 1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836 (patch) | |
tree | 524485bfad496e5dbc1d5724d1da0993dfa6d8cd /test/files | |
parent | 6d7bcd5818b856d4596b57b7e9f1543b71ed7329 (diff) | |
download | scala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.tar.gz scala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.tar.bz2 scala-1c65152c7aaeb3aeaf8a5e39e6fd51e5b4b95836.zip |
Fix for stability failure.
Pattern matcher! Totally unrelated to irrefutability, the pattern matcher
at some point stopped sorting its lookup switch cases, and the butterfly's
wings flapped enough to swap two cases. Now they're sorted in ascending
order like they're supposed to be.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/lookupswitch.scala | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/files/pos/lookupswitch.scala b/test/files/pos/lookupswitch.scala new file mode 100644 index 0000000000..33594c0ea6 --- /dev/null +++ b/test/files/pos/lookupswitch.scala @@ -0,0 +1,37 @@ +// There's not a real test here, but on compilation the +// switch should have the cases arranged in order from 1-30. +class A { + def f(x: Int) = x match { + case 6 => "6" + case 18 => "18" + case 7 => "7" + case 2 => "2" + case 13 => "13" + case 11 => "11" + case 26 => "26" + case 27 => "27" + case 29 => "29" + case 25 => "25" + case 9 => "9" + case 17 => "17" + case 16 => "16" + case 1 => "1" + case 30 => "30" + case 15 => "15" + case 22 => "22" + case 19 => "19" + case 23 => "23" + case 8 => "8" + case 28 => "28" + case 5 => "5" + case 12 => "12" + case 10 => "10" + case 21 => "21" + case 24 => "24" + case 4 => "4" + case 14 => "14" + case 3 => "3" + case 20 => "20" + } +} +
\ No newline at end of file |