aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-02-13 20:04:30 +0100
committerGuillaume Martres <smarter@ubuntu.com>2017-02-18 23:35:34 +0100
commit2979a14d0e4b10dc897d027dbfc827fc7624a520 (patch)
tree5035b948da237b38235c614c2fe0f297aa3c9b00
parent14e1c86113ca8af94b596cf6494213486d79dd12 (diff)
downloaddotty-2979a14d0e4b10dc897d027dbfc827fc7624a520.zip
dotty-2979a14d0e4b10dc897d027dbfc827fc7624a520.tar.gz
dotty-2979a14d0e4b10dc897d027dbfc827fc7624a520.tar.bz2
typedApply: Avoid using incorrect context in tryEither
Previously, the following code accidentally used the implicit Context parameter of `typedApply`: tryEither { implicit ctx => typedOpAssign
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Applications.scala2
-rw-r--r--tests/repl/imports.check2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala
index 0ed6ed6..6c5dac5 100644
--- a/compiler/src/dotty/tools/dotc/typer/Applications.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala
@@ -683,7 +683,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
*
* { val xs = es; e' = e' + args }
*/
- def typedOpAssign: Tree = track("typedOpAssign") {
+ def typedOpAssign(implicit ctx: Context): Tree = track("typedOpAssign") {
val Apply(Select(lhs, name), rhss) = tree
val lhs1 = typedExpr(lhs)
val liftedDefs = new mutable.ListBuffer[Tree]
diff --git a/tests/repl/imports.check b/tests/repl/imports.check
index 5260589..345fac1 100644
--- a/tests/repl/imports.check
+++ b/tests/repl/imports.check
@@ -11,7 +11,7 @@ scala> buf += xs
11 |buf += xs
| ^^
| found: scala.collection.immutable.List[Int](o.xs)
- | required: String
+ | required: Int
|
scala> buf ++= xs
val res1: scala.collection.mutable.ListBuffer[Int] = ListBuffer(1, 2, 3)