summaryrefslogtreecommitdiff
path: root/test/files/run/repl-javap-app.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2013-07-15 17:51:44 -0700
committerSom Snytt <som.snytt@gmail.com>2013-07-15 22:37:41 -0700
commit1010a324f20dfa1221f506d67700d748e6ed79d4 (patch)
treee04d13aa2a3a9de997f0c7045cd81bd046500ba9 /test/files/run/repl-javap-app.scala
parent11dcf82910b388046e675d76d277b09b931d5363 (diff)
downloadscala-1010a324f20dfa1221f506d67700d748e6ed79d4.tar.gz
scala-1010a324f20dfa1221f506d67700d748e6ed79d4.tar.bz2
scala-1010a324f20dfa1221f506d67700d748e6ed79d4.zip
SI-7488 REPL javap finds new style delayedEndpoint
The REPL :java -app command is a convenience to locate the body of DelayedInit code. Now it will look for new style delayedEndpoints on the class before it falls back to showing the apply method of the delayedInit$body closure. ``` apm@mara:~/tmp$ skala Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21). Type in expressions to have them evaluated. Type :help for more information. scala> :javap -pv -app delayed.C public final void delayedEndpoint$delayed$C$1(); flags: ACC_PUBLIC, ACC_FINAL Code: stack=2, locals=1, args_size=1 0: getstatic #29 // Field scala/Predef$.MODULE$:Lscala/Predef$; 3: ldc #31 // String this is the initialization code of C 5: invokevirtual #35 // Method scala/Predef$.println:(Ljava/lang/Object;)V 8: return LocalVariableTable: Start Length Slot Name Signature 0 9 0 this Ldelayed/C; LineNumberTable: line 11: 0 scala> :q apm@mara:~/tmp$ rm delayed/*.class apm@mara:~/tmp$ scalac delayed.scala apm@mara:~/tmp$ skala Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21). Type in expressions to have them evaluated. Type :help for more information. scala> :javap -pv -app delayed.C public final java.lang.Object apply(); flags: ACC_PUBLIC, ACC_FINAL Code: stack=2, locals=1, args_size=1 0: getstatic #13 // Field scala/Predef$.MODULE$:Lscala/Predef$; 3: ldc #15 // String this is the initialization code of C 5: invokevirtual #19 // Method scala/Predef$.println:(Ljava/lang/Object;)V 8: getstatic #25 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit; 11: areturn LocalVariableTable: Start Length Slot Name Signature 0 12 0 this Ldelayed/C$delayedInit$body; LineNumberTable: line 11: 0 line 10: 8 ```
Diffstat (limited to 'test/files/run/repl-javap-app.scala')
-rw-r--r--test/files/run/repl-javap-app.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/run/repl-javap-app.scala b/test/files/run/repl-javap-app.scala
new file mode 100644
index 0000000000..be04920be1
--- /dev/null
+++ b/test/files/run/repl-javap-app.scala
@@ -0,0 +1,10 @@
+
+import scala.tools.partest.ReplTest
+
+object MyApp extends App {
+ Console println "Hello, delayed world."
+}
+
+object Test extends ReplTest {
+ def code = ":javap -app MyApp$"
+}