diff options
author | James Iry <jamesiry@gmail.com> | 2013-01-30 15:46:40 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-01-30 16:14:13 -0800 |
commit | 80a814d82cd85a63ec1df516dc18559661f67559 (patch) | |
tree | 6296502a3b4a08983c112e6b928abc4f94488003 /test/files/neg | |
parent | 74b3e9aefe05363a14c217b558d8f9890c008379 (diff) | |
download | scala-80a814d82cd85a63ec1df516dc18559661f67559.tar.gz scala-80a814d82cd85a63ec1df516dc18559661f67559.tar.bz2 scala-80a814d82cd85a63ec1df516dc18559661f67559.zip |
SI-6728 Fixes crash in parser on incomplete for expression
The parser was trying to take the position of an empty expression
which would crash. Son on the empty expression case in TreeBuilder#
makeWhile it tries to do that and, if that failed, gets a position
that wraps both the condition and the body.
I also made a slight improvement to the UnsupportedOperationEx
messages in Position.
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t6728.check | 4 | ||||
-rw-r--r-- | test/files/neg/t6728.scala | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/test/files/neg/t6728.check b/test/files/neg/t6728.check new file mode 100644 index 0000000000..d853d6f724 --- /dev/null +++ b/test/files/neg/t6728.check @@ -0,0 +1,4 @@ +t6728.scala:4: error: '(' expected but '}' found. + } + ^ +one error found diff --git a/test/files/neg/t6728.scala b/test/files/neg/t6728.scala new file mode 100644 index 0000000000..ba0b1a0fdf --- /dev/null +++ b/test/files/neg/t6728.scala @@ -0,0 +1,5 @@ +object X { + while(true) { + for + } +} |