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
|
|
@ -40,9 +40,21 @@ class ConsoleInterface
|
|||
}
|
||||
else
|
||||
super.createInterpreter()
|
||||
|
||||
for( (id, value) <- bindNames zip bindValues)
|
||||
interpreter.beQuietDuring(interpreter.bind(id, value.asInstanceOf[AnyRef].getClass.getName, value))
|
||||
|
||||
def bind(values: Seq[(String,Any)])
|
||||
{
|
||||
// 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)
|
||||
interpreter.interpret(initialCommands)
|
||||
|
|
|
|||
Loading…
Reference in New Issue