summaryrefslogtreecommitdiff
path: root/test/files/run/repl-inline.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/repl-inline.scala')
-rw-r--r--test/files/run/repl-inline.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/repl-inline.scala b/test/files/run/repl-inline.scala
new file mode 100644
index 0000000000..260ed28a4f
--- /dev/null
+++ b/test/files/run/repl-inline.scala
@@ -0,0 +1,27 @@
+import scala.tools.nsc._
+
+object Test {
+ val testCode =
+ """
+def callerOfCaller = Thread.currentThread.getStackTrace.drop(2).head.getMethodName
+def g = callerOfCaller
+def h = g
+assert(h == "g", h)
+@inline def g = callerOfCaller
+def h = g
+assert(h == "h", h)
+ """
+
+ def main(args: Array[String]) {
+ def test(f: Settings => Unit): Unit = {
+ val settings = new Settings()
+ settings.processArgumentString("-opt:l:classpath")
+ f(settings)
+ settings.usejavacp.value = true
+ val repl = new interpreter.IMain(settings)
+ testCode.linesIterator.foreach(repl.interpret(_))
+ }
+ test(_ => ())
+ test(_.Yreplclassbased.value = true)
+ }
+}