Skip to content
This repository was archived by the owner on Feb 23, 2018. It is now read-only.

Commit 83152c9

Browse files
author
plocinic
committed
Closes #4163. no review
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24458 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent 8c49e09 commit 83152c9

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,10 @@ self =>
977977
def selector(t: Tree): Tree = {
978978
val point = in.offset
979979
//assert(t.pos.isDefined, t)
980-
Select(t, ident(false)) setPos r2p(t.pos.startOrPoint, point, in.lastOffset)
980+
if (t != EmptyTree)
981+
Select(t, ident(false)) setPos r2p(t.pos.startOrPoint, point, in.lastOffset)
982+
else
983+
errorTermTree // has already been reported
981984
}
982985

983986
/** Path ::= StableId
@@ -1429,7 +1432,7 @@ self =>
14291432
val t =
14301433
if (isLiteral) atPos(in.offset)(literal(false))
14311434
else in.token match {
1432-
case XMLSTART =>
1435+
case XMLSTART =>
14331436
xmlLiteral()
14341437
case IDENTIFIER | BACKQUOTED_IDENT | THIS | SUPER =>
14351438
path(true, false)

test/files/neg/t4163.check

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
t4163.scala:4: error: '<-' expected but '=' found.
2+
x = 3
3+
^
4+
t4163.scala:5: error: illegal start of simple expression
5+
y <- 0 to 100
6+
^
7+
two errors found

test/files/neg/t4163.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Bug {
2+
val z = (
3+
for {
4+
x = 3
5+
y <- 0 to 100
6+
} yield y
7+
).toArray
8+
}

0 commit comments

Comments
 (0)