summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-07-31 11:33:16 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-08-02 15:50:52 +0200
commit027b00171c0d92ec669deaa471966e6468c6b8cf (patch)
tree63808014ea752c49ae39e0b731f0d15bc6edeb28 /src/library
parentb578059b43a4caaadee2cb20f74cd9a7c876c8ef (diff)
downloadscala-027b00171c0d92ec669deaa471966e6468c6b8cf.tar.gz
scala-027b00171c0d92ec669deaa471966e6468c6b8cf.tar.bz2
scala-027b00171c0d92ec669deaa471966e6468c6b8cf.zip
more refinements of reflection API
Added a bunch of test methods to symbols to cover public flags: (e.g. isPrivate, isFinal, isOverride, isImplicit, etc). I'd argue that the API duplication w.r.t flag sets is trumped by unified interface to tests and better encapsulation. Also updated the API to be easier to understand after prior exposure to Java or .NET reflection APIs: 1) Added typeParams to TypeSymbol and ClassSymbol. 2) Renamed MethodSymbol.resultType to returnType. 3) Removed the distinction between MethodSymbol.params vs MethodSymbol.allParams now we just have MethodSymbol.params: List[List[Symbol]].
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/reflect/base/Symbols.scala16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/library/scala/reflect/base/Symbols.scala b/src/library/scala/reflect/base/Symbols.scala
index 052571dbcb..45f7c0c1bd 100644
--- a/src/library/scala/reflect/base/Symbols.scala
+++ b/src/library/scala/reflect/base/Symbols.scala
@@ -80,10 +80,6 @@ trait Symbols { self: Universe =>
/** The base API that all symbols support */
trait SymbolBase { this: Symbol =>
- /** An id number which is unique for all symbols in this universe */
- // [Eugene++ to Martin] do we leave this here?
- def id: Int
-
/** The owner of this symbol. This is the symbol
* that directly contains the current symbol's definition.
* The `NoSymbol` symbol does not have an owner, and calling this method
@@ -112,18 +108,6 @@ trait Symbols { self: Universe =>
*/
def fullName: String
- /** If this symbol is a class, this symbol; otherwise the next enclosing
- * class, or `NoSymbol` if none exists.
- */
- def enclosingClass: Symbol =
- if (isClass || this == NoSymbol) this else owner.enclosingClass
-
- /** If this symbol is a method, this symbol; otherwise the next enclosing
- * method, or `NoSymbol` if none exists.
- */
- def enclosingMethod: Symbol =
- if (isMethod || this == NoSymbol) this else owner.enclosingMethod
-
/** 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`, either `sym.isTerm` is true