diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/macro-basic-mamdmi.check | 3 | ||||
-rw-r--r-- | test/files/neg/t5753.check | 3 | ||||
-rwxr-xr-x | test/files/presentation/doc/doc.scala | 16 | ||||
-rw-r--r-- | test/files/run/t5527.check | 99 | ||||
-rw-r--r-- | test/files/run/t5527.scala | 107 |
5 files changed, 15 insertions, 213 deletions
diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check index c7b58d70d2..621d318ceb 100644 --- a/test/files/neg/macro-basic-mamdmi.check +++ b/test/files/neg/macro-basic-mamdmi.check @@ -1,4 +1,5 @@ -Impls_Macros_Test_1.scala:36: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) +Impls_Macros_Test_1.scala:36: error: macro implementation not found: foo +(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(2) + Macros.bar(2) * new Macros().quux(4)) ^ one error found diff --git a/test/files/neg/t5753.check b/test/files/neg/t5753.check index 76602de17d..379416c179 100644 --- a/test/files/neg/t5753.check +++ b/test/files/neg/t5753.check @@ -1,4 +1,5 @@ -Test_2.scala:9: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) +Test_2.scala:9: error: macro implementation not found: foo +(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(42)) ^ one error found diff --git a/test/files/presentation/doc/doc.scala b/test/files/presentation/doc/doc.scala index d198f4c324..7a2eb9a588 100755 --- a/test/files/presentation/doc/doc.scala +++ b/test/files/presentation/doc/doc.scala @@ -37,17 +37,23 @@ object Test extends InteractiveTest { prepre + docComment(nTags) + prepost + post } - - override lazy val compiler = { prepareSettings(settings) - new Global(settings, compilerReporter) with MemberLookupBase with CommentFactoryBase { + new Global(settings, compilerReporter) with MemberLookupBase with CommentFactoryBase with doc.ScaladocGlobalTrait { outer => + val global: this.type = this override lazy val analyzer = new { val global: outer.type = outer - } with doc.ScaladocAnalyzer + } with doc.ScaladocAnalyzer with InteractiveAnalyzer { + override def newTyper(context: Context): InteractiveTyper with ScaladocTyper = + new Typer(context) with InteractiveTyper with ScaladocTyper + } + + override lazy val loaders = new scala.tools.nsc.symtab.SymbolLoaders { + val global: outer.type = outer + } def chooseLink(links: List[LinkTo]): LinkTo = links.head def internalLink(sym: Symbol, site: Symbol) = None @@ -125,7 +131,7 @@ object Test extends InteractiveTest { case s: Seq[_] => s exists (existsText(_, text)) case p: Product => p.productIterator exists (existsText(_, text)) } - val (derived, base) = compiler.ask { () => + val (derived, base) = compiler.ask { () => val derived = definitions.RootPackage.info.decl(newTermName("p")).info.decl(newTypeName("Derived")) (derived, derived.ancestors(0)) } diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check deleted file mode 100644 index 1518168c51..0000000000 --- a/test/files/run/t5527.check +++ /dev/null @@ -1,99 +0,0 @@ -[[syntax trees at end of parser]] // newSource1 -package <empty> { - object UselessComments extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - }; - var z = 0; - def test1 = { - object Maybe extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - }; - /** Some comment inside */ - def nothing() = () - }; - () - }; - def test2 = { - var x = 4; - if (true) - { - x = 5; - val y = 6; - () - } - else - () - }; - def test3 = { - if (true) - z = 3 - else - (); - val t = 4; - 0.to(4).foreach(((i) => println(i))) - }; - val test4 = 'a' match { - case ('0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9') => true - case _ => false - } - }; - /** comments that we should keep */ - object UsefulComments extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - }; - /** class A */ - class A extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - }; - /** f */ - def f(i: Int) = i; - /** v */ - val v = 1; - /** u */ - var u = 2 - }; - /** trait B */ - abstract trait B extends scala.AnyRef { - def $init$() = { - () - }; - /** T */ - type T >: _root_.scala.Nothing <: _root_.scala.Any; - /** f */ - def f(i: Int): scala.Unit; - /** v */ - val v = 1; - /** u */ - var u = 2 - }; - /** object C */ - object C extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - }; - /** f */ - def f(i: Int) = i; - /** v */ - val v = 1; - /** u */ - var u = 2 - }; - /** class D */ - @new deprecated("use ... instead", "2.10.0") class D extends scala.AnyRef { - def <init>() = { - super.<init>(); - () - } - } - } -} - diff --git a/test/files/run/t5527.scala b/test/files/run/t5527.scala deleted file mode 100644 index 2449ff60c3..0000000000 --- a/test/files/run/t5527.scala +++ /dev/null @@ -1,107 +0,0 @@ -import scala.tools.partest._ -import java.io._ -import scala.tools.nsc._ -import scala.tools.nsc.util.CommandLineParser -import scala.tools.nsc.doc.{Settings, DocFactory} -import scala.tools.nsc.reporters.ConsoleReporter - -object Test extends DirectTest { - - override def extraSettings: String = "-usejavacp -Xprint:parser -Yrangepos -Ystop-after:parser -d " + testOutput.path - - override def code = """ - // SI-5527 - object UselessComments { - - var z = 0 - - def test1 = { - /** Some comment here */ - object Maybe { - /** Some comment inside */ - def nothing() = () - } - } - - def test2 = { - var x = 4 - if (true) { - /** Testing 123 */ - x = 5 - val y = 6 - } - } - - def test3 = { - if (true) - z = 3 - - /** Calculate this result. */ - val t = 4 - for (i <- 0 to 4) - println(i) - } - - val test4 = ('a') match { - /** Another digit is a giveaway. */ - case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => - true - case _ => - false - } - } - - /** comments that we should keep */ - object UsefulComments { - /** class A */ - class A { - /** f */ - def f(i: Int) = i - /** v */ - val v = 1 - /** u */ - var u = 2 - } - /** trait B */ - trait B { - /** T */ - type T - /** f */ - def f(i: Int) - /** v */ - val v = 1 - /** u */ - var u = 2 - } - /** object C */ - object C { - /** f */ - def f(i: Int) = i - /** v */ - val v = 1 - /** u */ - var u = 2 - } - /** class D */ - @deprecated("use ... instead", "2.10.0") - class D - } - """.trim - - override def show(): Unit = { - // redirect err to out, for logging - val prevErr = System.err - System.setErr(System.out) - compile() - System.setErr(prevErr) - } - - override def newCompiler(args: String*): Global = { - // we want the Scaladoc compiler here, because it keeps DocDef nodes in the tree - val settings = new Settings(_ => ()) - val command = new ScalaDoc.Command((CommandLineParser tokenize extraSettings) ++ args.toList, settings) - new DocFactory(new ConsoleReporter(settings), settings).compiler - } - - override def isDebug = false // so we don't get the newSettings warning -} |