@@ -1373,9 +1373,11 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
13731373
13741374 def typedAssign (tree : untpd.Assign , pt : Type )(using Context ): Tree =
13751375 tree.lhs match {
1376- case lhs @ Apply (fn, args) =>
1377- typed(untpd.Apply (untpd.Select (fn, nme.update), args :+ tree.rhs), pt)
1378- case untpd.TypedSplice (Apply (MaybePoly (Select (fn, app), targs), args)) if app == nme.apply =>
1376+ case Apply (fn, args) =>
1377+ val appliedUpdate =
1378+ untpd.Apply (untpd.Select (fn, nme.update), args :+ tree.rhs)
1379+ typed(appliedUpdate, pt)
1380+ case untpd.TypedSplice (Apply (MaybePoly (Select (fn, nme.apply), targs), args)) =>
13791381 val rawUpdate : untpd.Tree = untpd.Select (untpd.TypedSplice (fn), nme.update)
13801382 val wrappedUpdate =
13811383 if (targs.isEmpty) rawUpdate
@@ -1389,7 +1391,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
13891391 def lhs1 = adapt(lhsCore, LhsProto , locked)
13901392
13911393 def reassignmentToVal =
1392- report.error(ReassignmentToVal (lhsCore .symbol.name), tree.srcPos)
1394+ report.error(ReassignmentToVal (lhs1 .symbol.name), tree.srcPos)
13931395 cpy.Assign (tree)(lhsCore, typed(tree.rhs, lhs1.tpe.widen)).withType(defn.UnitType )
13941396
13951397 def canAssign (sym : Symbol ) =
@@ -1478,8 +1480,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
14781480 typedDynamicAssign(tree, pt)
14791481 case tpe =>
14801482 reassignmentToVal
1481- }
1483+ }
14821484 }
1485+ end typedAssign
14831486
14841487 def typedBlockStats (stats : List [untpd.Tree ])(using Context ): (List [tpd.Tree ], Context ) =
14851488 index(stats)
0 commit comments