mirror of https://github.com/sbt/sbt.git
Use IMain.bindValue to bind repl values. This does a better job of getting the type to use for a bound value.
This commit is contained in:
parent
3d11d50ffa
commit
4b8f0f3f94
|
|
@ -41,8 +41,20 @@ class ConsoleInterface
|
||||||
else
|
else
|
||||||
super.createInterpreter()
|
super.createInterpreter()
|
||||||
|
|
||||||
for( (id, value) <- bindNames zip bindValues)
|
def bind(values: Seq[(String,Any)])
|
||||||
interpreter.beQuietDuring(interpreter.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value))
|
{
|
||||||
|
// for 2.8 compatibility
|
||||||
|
final class Compat {
|
||||||
|
def bindValue(id: String, value: Any) =
|
||||||
|
interpreter.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value)
|
||||||
|
}
|
||||||
|
implicit def compat(a: AnyRef): Compat = new Compat
|
||||||
|
|
||||||
|
for( (id, value) <- values )
|
||||||
|
interpreter.beQuietDuring(interpreter.bindValue(id, value))
|
||||||
|
}
|
||||||
|
|
||||||
|
bind(bindNames zip bindValues)
|
||||||
|
|
||||||
if(!initialCommands.isEmpty)
|
if(!initialCommands.isEmpty)
|
||||||
interpreter.interpret(initialCommands)
|
interpreter.interpret(initialCommands)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue