diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 00e60af95..7a608bc93 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -2801,6 +2801,7 @@ self => ts += makePackaging(start, pkg, topstats()) } else { ts += inBraces(makePackaging(start, pkg, topStatSeq())) + acceptStatSepOpt() ts ++= topStatSeq() } } diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala index 8f1adf7bf..c7e4723e6 100644 --- a/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala +++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/misc/Loader.scala @@ -30,15 +30,17 @@ class Loader(val size: Int, val parallelism: Int, val runWhat: String) extends B reset + val wa = Dictionary.wordarray ++ Dictionary.wordarray ++ Dictionary.wordarray + def runseq { val m = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ" ) val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit - def wordCode(word: String): String = word.toUpperCase map charCode + def wordCode(word: String): String = (word.toUpperCase.toList map charCode).toString - Dictionary.wordarray groupBy wordCode + wa groupBy wordCode } def runpar { @@ -47,9 +49,9 @@ class Loader(val size: Int, val parallelism: Int, val runWhat: String) extends B '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ" ) val charCode: Map[Char, Char] = for ((digit, letters) <- m; letter <- letters) yield letter -> digit - def wordCode(word: String): String = word.toUpperCase map charCode + def wordCode(word: String): String = (word.toUpperCase.toList map charCode).toString - Dictionary.wordarray.par groupBy wordCode + wa.par groupBy wordCode } def reset = runWhat match { diff --git a/test/files/neg/t2973.check b/test/files/neg/t2973.check new file mode 100644 index 000000000..582fe0063 --- /dev/null +++ b/test/files/neg/t2973.check @@ -0,0 +1,4 @@ +t2973.scala:1: error: ';' expected but 'package' found. +package foo {} package bar {} + ^ +one error found \ No newline at end of file diff --git a/test/files/neg/t2973.scala b/test/files/neg/t2973.scala new file mode 100644 index 000000000..b9d973580 --- /dev/null +++ b/test/files/neg/t2973.scala @@ -0,0 +1 @@ +package foo {} package bar {} diff --git a/test/files/pos/t2973.scala b/test/files/pos/t2973.scala new file mode 100644 index 000000000..f5dde856d --- /dev/null +++ b/test/files/pos/t2973.scala @@ -0,0 +1 @@ +package foo {}; package bar {}; package baz {}