diff options
Diffstat (limited to 'test/files/run/repl-inline.scala')
-rw-r--r-- | test/files/run/repl-inline.scala | 21 |
1 files changed, 21 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..5a5f205ad8 --- /dev/null +++ b/test/files/run/repl-inline.scala @@ -0,0 +1,21 @@ +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]) { + val settings = new Settings() + settings.processArgumentString("-opt:l:classpath") + settings.usejavacp.value = true + val repl = new interpreter.IMain(settings) + testCode.linesIterator.foreach(repl.interpret(_)) + } +} |