SI-7345 Improved Context.toString

    ticket/7345-2 ~/code/scala qbin/scala
    Welcome to Scala version 2.11.0-20130416-231609-7829011884 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
    Type in expressions to have them evaluated.
    Type :help for more information.

    scala> import language.experimental._import language.experimental._

    scala> import reflect.macros.Contextimport reflect.macros.Context

    scala> def showContextImpl(c: Context) = {println(c.asInstanceOf[reflect.macros.runtime.Context].callsiteTyper.context.enclosingContextChain.mkString("\n\n")); c.literalUnit}
    showContextImpl: (c: scala.reflect.macros.Context)c.Expr[Unit]

    scala> def showContext = macro showContextImpldefined term macro showContext: Unit

    scala> object Foo { def foo(a: Any) { {class C { println("") }; showContext } } }Context(<console>) {
       owner       = method foo
       tree        = Block:{ class C extends scala.AnyRef { def <init>(): C = { super.<init>(); (
       scope       = 1 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = method foo
    }

    Context(<console>) {
       owner       = method foo
       tree        = DefDef:def foo(a: Any): Unit = { class C extends scala.AnyRef { def <init>():
       scope       = 1 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object Foo
    }

    Context(<console>) {
       owner       = object Foo
       tree        = Template(scala.AnyRef, _, 2 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object Foo
    }

    Context(<console>) {
       owner       = object Foo
       tree        = ModuleDef:object Foo extends scala.AnyRef { def <init>(): Foo.type = { super.<in
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = Template(scala.AnyRef, _, 2 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    ImportContext { import $line18.$read.$iw.$iw.$iw.$iw.showContext; outer.owner = object $iw }

    ImportContext { import $line17.$read.$iw.$iw.$iw.$iw.showContextImpl; outer.owner = object $iw }

    ImportContext { import reflect.macros.Context; outer.owner = object $iw }

    Context(<console>) {
       owner       = object $iw
       tree        = Template(scala.AnyRef, _, 5 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    ImportContext { import language.experimental._; outer.owner = object $iw }

    Context(<console>) {
       owner       = object $iw
       tree        = Template(scala.AnyRef, _, 3 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = Template(scala.AnyRef, _, 2 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $iw
    }

    Context(<console>) {
       owner       = object $iw
       tree        = ModuleDef:object $iw extends scala.AnyRef { def <init>(): type = { super.<init>(
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $read
    }

    Context(<console>) {
       owner       = object $read
       tree        = Template(scala.AnyRef, _, 2 stats)
       scope       = 0 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = object $read
    }

    Context(<console>) {
       owner       = object $read
       tree        = ModuleDef:object $read extends scala.AnyRef { def <init>(): $line19.$read.type =
       scope       = 1 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = package $line19
    }

    Context(<console>) {
       owner       = package $line19
       tree        = PackageDef:package $line19 { object $read extends scala.AnyRef { def <init>(): $l
       scope       = 1 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = package <root>
    }

    Context(<console>) {
       owner       = package <root>
       tree        = EmptyTree:<empty>
       scope       = 50 decls
       contextMode = AmbiguousErrors ImplicitsEnabled MacrosEnabled ReportErrors
       outer.owner = package <root>
    }

    ImportContext { import scala.this.Predef._; outer.owner = package <root> }

    ImportContext { import scala._; outer.owner = package <root> }

    ImportContext { import java.this.lang._; outer.owner = package <root> }

    Context(NoCompilationUnit) {
       owner       = package <root>
       tree        = Template(Nil, _, 0 stats)
       scope       = 50 decls
       contextMode = MacrosEnabled
       outer.owner = <none>
    }
    defined object Foo