diff options
-rw-r--r-- | src/reflect/scala/reflect/internal/Internals.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/macros/Universe.scala | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/Internals.scala b/src/reflect/scala/reflect/internal/Internals.scala index 4bb05b0af1..994b907042 100644 --- a/src/reflect/scala/reflect/internal/Internals.scala +++ b/src/reflect/scala/reflect/internal/Internals.scala @@ -96,6 +96,7 @@ trait Internals extends api.Internals { def attachments(symbol: Symbol): Attachments { type Pos = Position } = symbol.attachments def updateAttachment[T: ClassTag](symbol: Symbol, attachment: T): symbol.type = symbol.updateAttachment(attachment) def removeAttachment[T: ClassTag](symbol: Symbol): symbol.type = symbol.removeAttachment[T] + def setOwner(symbol: Symbol, newowner: Symbol): symbol.type = { symbol.owner = newowner; symbol } def setInfo(symbol: Symbol, tpe: Type): symbol.type = symbol.setInfo(tpe) def setAnnotations(symbol: Symbol, annots: Annotation*): symbol.type = symbol.setAnnotations(annots: _*) def setName(symbol: Symbol, name: Name): symbol.type = symbol.setName(name) diff --git a/src/reflect/scala/reflect/macros/Universe.scala b/src/reflect/scala/reflect/macros/Universe.scala index 3906a3388d..08436df5a7 100644 --- a/src/reflect/scala/reflect/macros/Universe.scala +++ b/src/reflect/scala/reflect/macros/Universe.scala @@ -59,6 +59,9 @@ abstract class Universe extends scala.reflect.api.Universe { */ def removeAttachment[T: ClassTag](symbol: Symbol): symbol.type + /** Sets the `owner` of the symbol. */ + def setOwner(symbol: Symbol, newowner: Symbol): symbol.type + /** Sets the `info` of the symbol. */ def setInfo(symbol: Symbol, tpe: Type): symbol.type @@ -187,6 +190,9 @@ abstract class Universe extends scala.reflect.api.Universe { /** @see [[internal.removeAttachment]] */ def removeAttachment[A: ClassTag]: T = internal.removeAttachment[A](symbol) + /** @see [[internal.setOwner]] */ + def setOwner(newowner: Symbol): T = internal.setOwner(symbol, newowner) + /** @see [[internal.setInfo]] */ def setInfo(tpe: Type): T = internal.setInfo(symbol, tpe) |