diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-07-24 15:47:58 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-07-24 23:59:48 +0200 |
commit | e6f3a8f6d3d4607d60e74ab8658a40fb55915d69 (patch) | |
tree | 4c03f419957fdfbd5057065b3f911646067b82c5 | |
parent | f5f7570778586e8230439c4dbacb5f49dea185ff (diff) | |
download | scala-e6f3a8f6d3d4607d60e74ab8658a40fb55915d69.tar.gz scala-e6f3a8f6d3d4607d60e74ab8658a40fb55915d69.tar.bz2 scala-e6f3a8f6d3d4607d60e74ab8658a40fb55915d69.zip |
SI-6112 exposes symbol mutators in macro universe
In makro.Universe we expose the most hardcore fragments of the compiler API
that don't make sense / can't be made use of in runtime reflection API.
makro.Universe is already refining Tree to include setters for
symbols, types and positions. Now we bring Symbol up to speed.
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/makro/Universe.scala | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 10d02376b1..6054af0ac2 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -78,6 +78,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => def asType: Type = tpe def asTypeIn(site: Type): Type = site.memberType(this) def asTypeConstructor: Type = typeConstructor + def setFlags(flags: FlagSet): this.type = setInternalFlags(flags) def setInternalFlags(flag: Long): this.type = { setFlag(flag); this } def setTypeSignature(tpe: Type): this.type = { setInfo(tpe); this } def getAnnotations: List[AnnotationInfo] = { initialize; annotations } diff --git a/src/reflect/scala/reflect/makro/Universe.scala b/src/reflect/scala/reflect/makro/Universe.scala index a676f7f1de..d88e7e0bb8 100644 --- a/src/reflect/scala/reflect/makro/Universe.scala +++ b/src/reflect/scala/reflect/makro/Universe.scala @@ -24,8 +24,15 @@ abstract class Universe extends scala.reflect.api.Universe { */ trait SymbolContextApi extends SymbolApi with AttachableApi { this: Symbol => - // [Eugene++ to Martin] should we also add mutability methods here (similarly to what's done below for trees)? - // I'm talking about `setAnnotations` and friends + def setFlags(flags: FlagSet): this.type + + def setTypeSignature(tpe: Type): this.type + + def setAnnotations(annots: AnnotationInfo*): this.type + + def setName(name: Name): this.type + + def setPrivateWithin(sym: Symbol): this.type } // Tree extensions --------------------------------------------------------------- |