diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-17 15:16:53 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 19:04:09 +0200 |
commit | c598e764b91307587388ab2a3f5188e64f42af44 (patch) | |
tree | 4e62dbe8c432be718e696b3868bb09777df8289e /gitignore.SAMPLE | |
parent | 85af192fffd3801692b91c2d8f806cd55d559ffd (diff) | |
download | scala-c598e764b91307587388ab2a3f5188e64f42af44.tar.gz scala-c598e764b91307587388ab2a3f5188e64f42af44.tar.bz2 scala-c598e764b91307587388ab2a3f5188e64f42af44.zip |
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
Diffstat (limited to 'gitignore.SAMPLE')
0 files changed, 0 insertions, 0 deletions