Skip to content

Commit

Permalink
Fix ConsoleInterface binding things properly^2
Browse files Browse the repository at this point in the history
Follow-up on #314 - I _still_ misinterpreted..

Turns out the ".asInstanceOf[AnyRef].getClass.getName" implementation
was the _original_ implementation. Then Mark switched to using bindValue
in sbt/sbt@4b8f0f3.

Since Scala 2.11.0 (scala/scala#1648 in particular) bindValue was
removed. So we'll use NamedParam and quietBind, both which exist since
Scala 2.9.0.

Fixes sbt/sbt#2884, tested with local releases.
  • Loading branch information
dwijnand committed Sep 5, 2017
1 parent ef3a2c4 commit 33d2e68
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package xsbt

import xsbti.Logger
import scala.tools.nsc.interpreter.{ ILoop, IMain, InteractiveReader }
import scala.tools.nsc.interpreter.{ ILoop, IMain, InteractiveReader, NamedParam }
import scala.tools.nsc.reporters.Reporter
import scala.tools.nsc.{ GenericRunnerCommand, Settings }

Expand Down Expand Up @@ -54,7 +54,7 @@ class ConsoleInterface {
super.createInterpreter()

for ((id, value) <- bindNames zip bindValues)
intp.beQuietDuring(intp.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value))
intp.quietBind(NamedParam.clazz(id, value))

if (!initialCommands.isEmpty)
intp.interpret(initialCommands)
Expand Down

0 comments on commit 33d2e68

Please sign in to comment.