diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-08-30 07:12:03 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-08-30 17:49:36 -0700 |
commit | 27d61a2ef6c3059fd56a36fc18886fc53bb354a8 (patch) | |
tree | ce49efff3e52cc3964273bb9c2c10ec6289132be /test/files | |
parent | 7a0d983aedd8ad8f3f41a22ffa0ce4b6ab2f1523 (diff) | |
download | scala-27d61a2ef6c3059fd56a36fc18886fc53bb354a8.tar.gz scala-27d61a2ef6c3059fd56a36fc18886fc53bb354a8.tar.bz2 scala-27d61a2ef6c3059fd56a36fc18886fc53bb354a8.zip |
SI-4760 Parser handles block-ending import
Don't molest the RBRACE.
Updated with additional parse tests suggested
by @retronym. "What are you lazy?" Yes, I
must be lazy. Can't ScalaCheck or Par-Test
generate these tests automatically? That seems
like a reasonable expectation.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t4760.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/files/pos/t4760.scala b/test/files/pos/t4760.scala new file mode 100644 index 0000000000..767e3847f4 --- /dev/null +++ b/test/files/pos/t4760.scala @@ -0,0 +1,34 @@ + +class Test { + // parses + def f1 = { + import scala._; + } + // b.scala:7: error: ';' expected but '}' found. + // } + // ^ + // one error found + def f2 = { + import scala._ + } + def f2b = { + import scala.collection.mutable.{ Map => MMap } + } + def f(): Unit = { + locally { + import scala.util.Properties.lineSeparator + } + } + + // parses + def f3 = { + import scala._ + 5 + } + locally { (x: Int) => + import scala.util._ + } + 1 match { + case 1 => import scala.concurrent._ + } +} |