From 941c56918e052a1c619f35b24c6aa6c736390dc5 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Wed, 30 Jan 2013 21:27:59 +0100 Subject: SI-6812 scaladoc can opt out of expanding macros This is a temporary change, possible only because macros currently can't affect the global symbol table (except for the case when they will steer inference of a method's return type). Later on, e.g. with the addition of c.introduceTopLevel in master, we will have to upgrade Scaladoc to allow for separate generation of documentation, because then we'll be forced to expand macros in order to get the whole picture of the code. --- test/scaladoc/run/SI-6812.check | 1 + test/scaladoc/run/SI-6812.scala | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/scaladoc/run/SI-6812.check create mode 100644 test/scaladoc/run/SI-6812.scala (limited to 'test/scaladoc/run') diff --git a/test/scaladoc/run/SI-6812.check b/test/scaladoc/run/SI-6812.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/SI-6812.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/SI-6812.scala b/test/scaladoc/run/SI-6812.scala new file mode 100644 index 0000000000..fbd9588ede --- /dev/null +++ b/test/scaladoc/run/SI-6812.scala @@ -0,0 +1,24 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest +import language._ + +object Test extends ScaladocModelTest { + + override def code = """ + import scala.reflect.macros.Context + import language.experimental.macros + + object Macros { + def impl(c: Context) = c.literalUnit + def foo = macro impl + } + + class C { + def bar = Macros.foo + } + """ + + def scaladocSettings = "" + override def extraSettings = super.extraSettings + " -Ymacro-no-expand" + def testModel(root: Package) = () +} -- cgit v1.2.3