Skip to content

Commit 08cd627

Browse files
committed
typedApply: Avoid using incorrect context in tryEither
Previously, the following code accidentally used the implicit Context parameter of `typedApply`: tryEither { implicit ctx => typedOpAssign
1 parent 6d970ad commit 08cd627

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
683683
*
684684
* { val xs = es; e' = e' + args }
685685
*/
686-
def typedOpAssign: Tree = track("typedOpAssign") {
686+
def typedOpAssign(implicit ctx: Context): Tree = track("typedOpAssign") {
687687
val Apply(Select(lhs, name), rhss) = tree
688688
val lhs1 = typedExpr(lhs)
689689
val liftedDefs = new mutable.ListBuffer[Tree]

tests/repl/imports.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ scala> buf += xs
1111
11 |buf += xs
1212
| ^^
1313
| found: scala.collection.immutable.List[Int](o.xs)
14-
| required: String
14+
| required: Int
1515
|
1616
scala> buf ++= xs
1717
val res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)

0 commit comments

Comments
 (0)