Skip to content

Commit 7a09b82

Browse files
committed
Fix location propagation in assignments
1 parent 4639991 commit 7a09b82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,8 @@ object Parsers {
19981998
t match
19991999
case Ident(_) | Select(_, _) | Apply(_, _) =>
20002000
atSpan(startOffset(t), in.skipToken()) {
2001-
Assign(t, subPart(() => expr(location)))
2001+
val loc = if location.inArgs then location else Location.ElseWhere
2002+
Assign(t, subPart(() => expr(loc)))
20022003
}
20032004
case _ =>
20042005
t

0 commit comments

Comments
 (0)