Skip to content

Commit c8d7ca1

Browse files
committed
tryfix(16459): xml literal in for comprehension
xml literal may appear in LHS of for comprehension. The previous fix caused a syntax error for the following code. ```scala val actual: List[Node] = for (case t @ <book><title>Blabla</title></book> <- NodeSeq.fromSeq(books.child).toList) yield t ```
1 parent 3debae0 commit c8d7ca1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ object Parsers {
906906
var braces = 0
907907
while (true) {
908908
val token = lookahead.token
909-
if (token == XMLSTART) return false
909+
if (query != LARROW && token == XMLSTART) return false
910910
if (braces == 0) {
911911
if (token == query) return true
912912
if (stopScanTokens.contains(token) || lookahead.isNestedEnd) return false

0 commit comments

Comments
 (0)