diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-02-07 12:54:20 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-15 09:23:57 +0100 |
commit | d7b6662ddd346d0a4dc12ea62a3392ac176bf271 (patch) | |
tree | c16642e938167d638afe7259ae68c14ae9e83db7 | |
parent | 24780095d14938e60e28c710c47ed69629b7afc7 (diff) | |
download | scala-d7b6662ddd346d0a4dc12ea62a3392ac176bf271.tar.gz scala-d7b6662ddd346d0a4dc12ea62a3392ac176bf271.tar.bz2 scala-d7b6662ddd346d0a4dc12ea62a3392ac176bf271.zip |
moves Symbol.pos to public API
Seems to be useful to people, so why not expose it more widely?
-rw-r--r-- | src/reflect/scala/reflect/api/Symbols.scala | 3 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Internals.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/macros/Universe.scala | 7 |
3 files changed, 3 insertions, 8 deletions
diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala index c7c23ea9f2..22039d22b6 100644 --- a/src/reflect/scala/reflect/api/Symbols.scala +++ b/src/reflect/scala/reflect/api/Symbols.scala @@ -163,6 +163,9 @@ trait Symbols { self: Universe => */ def fullName: String + /** Position of the tree. */ + def pos: Position + /** Does this symbol represent the definition of a type? * Note that every symbol is either a term or a type. * So for every symbol `sym` (except for `NoSymbol`), diff --git a/src/reflect/scala/reflect/internal/Internals.scala b/src/reflect/scala/reflect/internal/Internals.scala index ad0bcef48d..5e718ce4bd 100644 --- a/src/reflect/scala/reflect/internal/Internals.scala +++ b/src/reflect/scala/reflect/internal/Internals.scala @@ -95,7 +95,6 @@ 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 pos(symbol: Symbol): Position = symbol.pos 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 2dfb4ee0e2..8521b782e3 100644 --- a/src/reflect/scala/reflect/macros/Universe.scala +++ b/src/reflect/scala/reflect/macros/Universe.scala @@ -58,9 +58,6 @@ abstract class Universe extends scala.reflect.api.Universe { */ def removeAttachment[T: ClassTag](symbol: Symbol): symbol.type - /** The position of this symbol. */ - def pos(symbol: Symbol): Position - /** Sets the `info` of the symbol. */ def setInfo(symbol: Symbol, tpe: Type): symbol.type @@ -232,10 +229,6 @@ abstract class Universe extends scala.reflect.api.Universe { @deprecated("Use `internal.removeAttachment` instead", "2.11.0") def removeAttachment[T: ClassTag]: Symbol = internal.removeAttachment[T](symbol) - /** @see [[InternalMacroApi.pos]] */ - @deprecated("Use `internal.pos` instead", "2.11.0") - def pos: Position = internal.pos(symbol) - /** @see [[InternalMacroApi.setInfo]] */ @deprecated("Use `internal.setInfo` instead", "2.11.0") def setTypeSignature(tpe: Type): Symbol = internal.setInfo(symbol, tpe) |