diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t5706.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t5706.scala | 10 | ||||
-rw-r--r-- | test/files/presentation/callcc-interpreter/Runner.scala | 4 | ||||
-rw-r--r-- | test/files/presentation/random.check | 3 | ||||
-rw-r--r-- | test/files/run/reify-repl-fail-gracefully.check | 21 | ||||
-rw-r--r-- | test/files/run/reify-repl-fail-gracefully.scala | 10 |
6 files changed, 44 insertions, 5 deletions
diff --git a/test/files/pos/t5706.flags b/test/files/pos/t5706.flags new file mode 100644 index 0000000000..cd66464f2f --- /dev/null +++ b/test/files/pos/t5706.flags @@ -0,0 +1 @@ +-language:experimental.macros
\ No newline at end of file diff --git a/test/files/pos/t5706.scala b/test/files/pos/t5706.scala new file mode 100644 index 0000000000..847acb693f --- /dev/null +++ b/test/files/pos/t5706.scala @@ -0,0 +1,10 @@ +import scala.reflect.makro.Context + +class Logger { + def error(message: String) = macro Impls.error +} + +object Impls { + type LoggerContext = Context { type PrefixType = Logger } + def error(c: LoggerContext)(message: c.Expr[String]): c.Expr[Unit] = ??? +} diff --git a/test/files/presentation/callcc-interpreter/Runner.scala b/test/files/presentation/callcc-interpreter/Runner.scala index 61b6efd50d..1ef3cf9025 100644 --- a/test/files/presentation/callcc-interpreter/Runner.scala +++ b/test/files/presentation/callcc-interpreter/Runner.scala @@ -1,5 +1,3 @@ import scala.tools.nsc.interactive.tests._ -object Test extends InteractiveTest { - settings.XoldPatmat.value = true // TODO: could this be running into some kind of race condition? sometimes the match has been translated, sometimes it hasn't -}
\ No newline at end of file +object Test extends InteractiveTest
\ No newline at end of file diff --git a/test/files/presentation/random.check b/test/files/presentation/random.check index 1b73720312..fce4b69fb3 100644 --- a/test/files/presentation/random.check +++ b/test/files/presentation/random.check @@ -4,8 +4,7 @@ askType at Random.scala(18,14) ================================================================================ [response] askTypeAt at (18,14) val filter: Int => Boolean = try { - case <synthetic> val x1: Int = java.this.lang.Integer.parseInt(args.apply(0)); - x1 match { + java.this.lang.Integer.parseInt(args.apply(0)) match { case 1 => ((x: Int) => x.%(2).!=(0)) case 2 => ((x: Int) => x.%(2).==(0)) case _ => ((x: Int) => x.!=(0)) 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 +} |