diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-05-23 00:28:45 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-05-23 00:28:45 -0700 |
commit | 5b54681d0360616efdb2a561ce9201fbd67e7288 (patch) | |
tree | d02c028da1fbead849a7d191c0519af1e93e6ca5 /test/files/neg | |
parent | b45e2b7b30faaa4994740fbe063737934a187d4e (diff) | |
download | scala-5b54681d0360616efdb2a561ce9201fbd67e7288.tar.gz scala-5b54681d0360616efdb2a561ce9201fbd67e7288.tar.bz2 scala-5b54681d0360616efdb2a561ce9201fbd67e7288.zip |
SI-7473 Bad for expr crashes postfix
This commit makes building PostfixSelect robust against a bad pos
on its operand, which can happen if a bad for expression results
in an EmptyTree.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7473.check | 7 | ||||
-rw-r--r-- | test/files/neg/t7473.scala | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/t7473.check b/test/files/neg/t7473.check new file mode 100644 index 0000000000..bc8c29d463 --- /dev/null +++ b/test/files/neg/t7473.check @@ -0,0 +1,7 @@ +t7473.scala:6: error: '<-' expected but '=' found. + (for (x = Option(i); if x == j) yield 42) toList + ^ +t7473.scala:6: error: illegal start of simple expression + (for (x = Option(i); if x == j) yield 42) toList + ^ +two errors found diff --git a/test/files/neg/t7473.scala b/test/files/neg/t7473.scala new file mode 100644 index 0000000000..593231d5f2 --- /dev/null +++ b/test/files/neg/t7473.scala @@ -0,0 +1,7 @@ + +object Foo { + val i,j = 3 + //for (x = Option(i); if x == j) yield 42 //t7473.scala:4: error: '<-' expected but '=' found. + // evil postfix! + (for (x = Option(i); if x == j) yield 42) toList +} |