Skip to content

Commit 41ee45e

Browse files
author
Adriaan Moors
committed
Merge pull request scala#985 from scalamacros/ticket/6112
SI-6112 exposes symbol mutators in macro universe
2 parents 950c783 + e6f3a8f commit 41ee45e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/reflect/scala/reflect/internal/Symbols.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
7878
def asType: Type = tpe
7979
def asTypeIn(site: Type): Type = site.memberType(this)
8080
def asTypeConstructor: Type = typeConstructor
81+
def setFlags(flags: FlagSet): this.type = setInternalFlags(flags)
8182
def setInternalFlags(flag: Long): this.type = { setFlag(flag); this }
8283
def setTypeSignature(tpe: Type): this.type = { setInfo(tpe); this }
8384
def getAnnotations: List[AnnotationInfo] = { initialize; annotations }

src/reflect/scala/reflect/makro/Universe.scala

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ abstract class Universe extends scala.reflect.api.Universe {
2424
*/
2525
trait SymbolContextApi extends SymbolApi with AttachableApi { this: Symbol =>
2626

27-
// [Eugene++ to Martin] should we also add mutability methods here (similarly to what's done below for trees)?
28-
// I'm talking about `setAnnotations` and friends
27+
def setFlags(flags: FlagSet): this.type
28+
29+
def setTypeSignature(tpe: Type): this.type
30+
31+
def setAnnotations(annots: AnnotationInfo*): this.type
32+
33+
def setName(name: Name): this.type
34+
35+
def setPrivateWithin(sym: Symbol): this.type
2936
}
3037

3138
// Tree extensions ---------------------------------------------------------------

0 commit comments

Comments
 (0)