diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-25 06:43:45 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-25 06:43:45 -0700 |
commit | edc7071d3b284fcf82bd17c7a1cf83f23e32788f (patch) | |
tree | 848344b1cfca8015a125723960691b60732ba30e /test/files/run | |
parent | bf621aa912ec76ba5794280b88f62d0861aa530d (diff) | |
download | scala-edc7071d3b284fcf82bd17c7a1cf83f23e32788f.tar.gz scala-edc7071d3b284fcf82bd17c7a1cf83f23e32788f.tar.bz2 scala-edc7071d3b284fcf82bd17c7a1cf83f23e32788f.zip |
Fix reifier crashing repl.
Very first time I tried "reify" in the repl and it crashed.
I changed an assert to issue a proper error, as best I could
figure out how. We probably need to do a lot more of this.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/reify-repl-fail-gracefully.check | 21 | ||||
-rw-r--r-- | test/files/run/reify-repl-fail-gracefully.scala | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check new file mode 100644 index 0000000000..680db12667 --- /dev/null +++ b/test/files/run/reify-repl-fail-gracefully.check @@ -0,0 +1,21 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> import language.experimental.macros +import language.experimental.macros + +scala> import scala.reflect.mirror._ +import scala.reflect.mirror._ + +scala> + +scala> reify +<console>:12: error: macros cannot be partially applied + reify + ^ + +scala> + +scala> diff --git a/test/files/run/reify-repl-fail-gracefully.scala b/test/files/run/reify-repl-fail-gracefully.scala new file mode 100644 index 0000000000..d7a06e8da8 --- /dev/null +++ b/test/files/run/reify-repl-fail-gracefully.scala @@ -0,0 +1,10 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import language.experimental.macros + |import scala.reflect.mirror._ + | + |reify + """.stripMargin +} |