From c9ca7370575ef2245b03ead50ec86fad99c3cce9 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 15 Feb 2014 01:48:34 +0100 Subject: SI-6785 exposes Symbol.flags, setFlag and resetFlag My first feeling was not to expose Symbol.flags, because that would inevitably lead to exposing more methods on FlagSet. However we do need flag manipulation in async, which is representative of advanced macros, so I'm caving in. --- src/reflect/scala/reflect/macros/Universe.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/reflect/scala/reflect/macros') diff --git a/src/reflect/scala/reflect/macros/Universe.scala b/src/reflect/scala/reflect/macros/Universe.scala index 08436df5a7..039dcc7331 100644 --- a/src/reflect/scala/reflect/macros/Universe.scala +++ b/src/reflect/scala/reflect/macros/Universe.scala @@ -74,6 +74,12 @@ abstract class Universe extends scala.reflect.api.Universe { /** Sets the `privateWithin` of the symbol. */ def setPrivateWithin(symbol: Symbol, sym: Symbol): symbol.type + /** Enables `flags` on the symbol. */ + def setFlag(symbol: Symbol, flags: FlagSet): symbol.type + + /** Disables `flags` on the symbol. */ + def resetFlag(symbol: Symbol, flags: FlagSet): symbol.type + /** The attachment of the tree. */ def attachments(tree: Tree): Attachments { type Pos = Position } @@ -204,6 +210,12 @@ abstract class Universe extends scala.reflect.api.Universe { /** @see [[internal.setPrivateWithin]] */ def setPrivateWithin(sym: Symbol): T = internal.setPrivateWithin(symbol, sym) + + /** @see [[internal.setFlag]] */ + def setFlag(flags: FlagSet): T = internal.setFlag(symbol, flags) + + /** @see [[internal.setFlag]] */ + def resetFlag(flags: FlagSet): T = internal.resetFlag(symbol, flags) } } } -- cgit v1.2.3