diff options
Diffstat (limited to 'src/reflect/scala/reflect/api')
-rw-r--r-- | src/reflect/scala/reflect/api/FlagSets.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/api/Internals.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/api/Printers.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/api/Symbols.scala | 41 | ||||
-rw-r--r-- | src/reflect/scala/reflect/api/TypeTags.scala | 2 |
5 files changed, 28 insertions, 20 deletions
diff --git a/src/reflect/scala/reflect/api/FlagSets.scala b/src/reflect/scala/reflect/api/FlagSets.scala index d3294dad9b..2d5d1d5d6b 100644 --- a/src/reflect/scala/reflect/api/FlagSets.scala +++ b/src/reflect/scala/reflect/api/FlagSets.scala @@ -173,6 +173,7 @@ trait FlagSets { self: Universe => * - the enum's class * - enum constants **/ + @deprecated("Use `isJavaEnum` on the corresponding symbol instead.", since = "2.11.8") val ENUM: FlagSet /** Flag indicating that tree represents a parameter of the primary constructor of some class diff --git a/src/reflect/scala/reflect/api/Internals.scala b/src/reflect/scala/reflect/api/Internals.scala index f57d7efa00..1457fdc133 100644 --- a/src/reflect/scala/reflect/api/Internals.scala +++ b/src/reflect/scala/reflect/api/Internals.scala @@ -939,7 +939,7 @@ trait Internals { self: Universe => /** Marks underlying reference to id as boxed. * - * <b>Precondition:</b> id must refer to a captured variable + * <b>Precondition:<\b> id must refer to a captured variable * A reference such marked will refer to the boxed entity, no dereferencing * with `.elem` is done on it. * This tree node can be emitted by macros such as reify that call referenceCapturedVariable. diff --git a/src/reflect/scala/reflect/api/Printers.scala b/src/reflect/scala/reflect/api/Printers.scala index c0abc5120c..257dd6c43e 100644 --- a/src/reflect/scala/reflect/api/Printers.scala +++ b/src/reflect/scala/reflect/api/Printers.scala @@ -232,7 +232,7 @@ trait Printers { self: Universe => * @group Printers */ def showRaw(any: Any, printTypes: BooleanFlag = None, printIds: BooleanFlag = None, printOwners: BooleanFlag = None, printKinds: BooleanFlag = None, printMirrors: BooleanFlag = None, printPositions: BooleanFlag = None): String = - render(any, newRawTreePrinter(_), printTypes, printIds, printOwners, printKinds, printMirrors, printPositions) + render(any, newRawTreePrinter, printTypes, printIds, printOwners, printKinds, printMirrors, printPositions) /** Hook to define what `showRaw(...)` means. * @group Printers diff --git a/src/reflect/scala/reflect/api/Symbols.scala b/src/reflect/scala/reflect/api/Symbols.scala index c01029d067..b9fb323a4c 100644 --- a/src/reflect/scala/reflect/api/Symbols.scala +++ b/src/reflect/scala/reflect/api/Symbols.scala @@ -228,7 +228,7 @@ trait Symbols { self: Universe => throw new ScalaReflectionException(s"$this $msg") } - /** Used to provide a better error message for `asMethod` + /** Used to provide a better error message for `asMethod`. * * @group Tests */ @@ -257,12 +257,9 @@ trait Symbols { self: Universe => def isClass: Boolean = false /** Does this symbol represent the definition of a class implicitly associated - * with an object definition (module class in scala compiler parlance). + * with an object definition (module class in scala compiler parlance)? * If yes, `isType` is also guaranteed to be true. * - * Note to compiler developers: During the "mixin" phase, trait implementation class symbols - * receive the `lateMODULE` flag, hence `isImplClass && isModuleClass` becomes true. - * * @group Tests */ def isModuleClass: Boolean = false @@ -294,7 +291,7 @@ trait Symbols { self: Universe => /** For a class: the module or case class factory with the same name in the same package. * For a module: the class with the same name in the same package. - * For all others: NoSymbol + * For all others: NoSymbol. * * This API may return unexpected results for module classes, packages and package classes. * Use `companion` instead in order to get predictable results. @@ -345,7 +342,7 @@ trait Symbols { self: Universe => */ def overrides: List[Symbol] - /** The overloaded alternatives of this symbol + /** The overloaded alternatives of this symbol. * * @group Basics */ @@ -354,8 +351,7 @@ trait Symbols { self: Universe => /******************* tests *******************/ /** Does this symbol represent a synthetic (i.e. a compiler-generated) entity? - * Examples of synthetic entities are accessors for vals and vars - * or mixin constructors in trait implementation classes. + * Examples of synthetic entities are accessors for vals and vars. * * @group Tests */ @@ -370,7 +366,7 @@ trait Symbols { self: Universe => /** Does this symbol represent a declaration or definition written in a source file as `private[this]` * or generated in tree/symbol form with the combination of flags LOCAL and PRIVATE? - * If yes, `isPrivate` is guaranteed to be true, + * If yes, `isPrivate` is guaranteed to be true. * * @group Tests */ @@ -504,6 +500,18 @@ trait Symbols { self: Universe => */ def isImplicit: Boolean + /** Does this symbol represent a java enum class or a java enum value? + * + * @group Tests + */ + def isJavaEnum: Boolean + + /** Does this symbol represent a java annotation interface? + * + * @group Tests + */ + def isJavaAnnotation: Boolean + /******************* helpers *******************/ /** Provides an alternate if symbol is a NoSymbol. @@ -678,7 +686,7 @@ trait Symbols { self: Universe => */ def toTypeIn(site: Type): Type - /** A type reference that refers to this type symbol + /** A type reference that refers to this type symbol. * Note if symbol is a member of a class, one almost always is interested * in `asTypeIn` with a site type instead. * @@ -727,7 +735,7 @@ trait Symbols { self: Universe => */ def isExistential : Boolean - /** For a polymorphic type, its type parameters, the empty list for all other types + /** For a polymorphic type, its type parameters, the empty list for all other types. * * @group Type */ @@ -756,12 +764,13 @@ trait Symbols { self: Universe => */ def typeParams: List[Symbol] - /** @see [[paramLists]] */ + /** @see [[paramLists]] + * + * The name ending with "ss" indicates that the result type is a list of lists. */ @deprecated("Use `paramLists` instead", "2.11.0") def paramss: List[List[Symbol]] /** All parameter lists of the method. - * The name ending with "ss" indicates that the result type is a list of lists. * * Can be used to distinguish nullary methods and methods with empty parameter lists. * For a nullary method, returns the empty list (i.e. `List()`). @@ -777,7 +786,7 @@ trait Symbols { self: Universe => */ def isVarargs: Boolean - /** The return type of the method + /** The return type of the method. * * @group Method */ @@ -911,7 +920,7 @@ trait Symbols { self: Universe => */ def superPrefix(supertpe: Type): Type - /** For a polymorphic class/trait, its type parameters, the empty list for all other classes/trait + /** For a polymorphic class/trait, its type parameters, the empty list for all other classes/trait. * * @group Class */ diff --git a/src/reflect/scala/reflect/api/TypeTags.scala b/src/reflect/scala/reflect/api/TypeTags.scala index bc239ca870..cad318dbed 100644 --- a/src/reflect/scala/reflect/api/TypeTags.scala +++ b/src/reflect/scala/reflect/api/TypeTags.scala @@ -7,8 +7,6 @@ package scala package reflect package api -import java.lang.{ Class => jClass } -import scala.language.implicitConversions import java.io.ObjectStreamException /** |