summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/repl/scala/tools/nsc/interpreter/ILoop.scala2
-rw-r--r--test/files/run/t7634.check8
-rw-r--r--test/files/run/t7634.scala22
3 files changed, 31 insertions, 1 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
index 217414809e..a96bed4696 100644
--- a/src/repl/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/repl/scala/tools/nsc/interpreter/ILoop.scala
@@ -579,7 +579,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
def apply(line: String): Result = line match {
case "" => showUsage()
case _ =>
- val toRun = classOf[ProcessResult].getName + "(" + string2codeQuoted(line) + ")"
+ val toRun = s"new ${classOf[ProcessResult].getName}(${string2codeQuoted(line)})"
intp interpret toRun
()
}
diff --git a/test/files/run/t7634.check b/test/files/run/t7634.check
new file mode 100644
index 0000000000..aea3b94da5
--- /dev/null
+++ b/test/files/run/t7634.check
@@ -0,0 +1,8 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+
+scala> .lines
+res1: List[String] = List(shello, world.)
+
+scala>
diff --git a/test/files/run/t7634.scala b/test/files/run/t7634.scala
new file mode 100644
index 0000000000..aeb6a5e671
--- /dev/null
+++ b/test/files/run/t7634.scala
@@ -0,0 +1,22 @@
+import java.io.File
+import scala.tools.partest.ReplTest
+import scala.util.Properties.propOrElse
+
+/**
+* filter out absolute path to java
+* filter: java
+*/
+object Test extends ReplTest {
+ def java = propOrElse("javacmd", "java")
+ def code = s""":sh $java -classpath $testOutput hello.Hello
+ |.lines""".stripMargin
+}
+
+package hello {
+ object Hello {
+ def main(a: Array[String]) {
+ System.out.println("shello, world.")
+ }
+ }
+}
+