summaryrefslogtreecommitdiff
path: root/sources/scalac
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-07-07 15:13:44 +0000
committermichelou <michelou@epfl.ch>2005-07-07 15:13:44 +0000
commit4139c127a7c754c9dbdd0bfc81535a976c344202 (patch)
treea77c3d6f8cd7053c44433882074697e2b72c0aa0 /sources/scalac
parentd145b661e1e9eeec3c9e2084cfba40e049dcb42e (diff)
downloadscala-4139c127a7c754c9dbdd0bfc81535a976c344202.tar.gz
scala-4139c127a7c754c9dbdd0bfc81535a976c344202.tar.bz2
scala-4139c127a7c754c9dbdd0bfc81535a976c344202.zip
- added methods isCaptured and isTypeParameter.
Diffstat (limited to 'sources/scalac')
-rw-r--r--sources/scalac/symtab/Symbol.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 0868c084fc..ad3710ff82 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -1,6 +1,6 @@
/* ____ ____ ____ ____ ______ *\
** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
-** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
+** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002-2005, LAMP/EPFL **
** /_____/\____/\___/\____/____/ **
\* */
@@ -19,10 +19,10 @@ import scalac.Global;
import scalac.Phase;
import scalac.framework.History;
import scalac.util.ArrayApply;
+import scalac.util.Debug;
import scalac.util.Name;
import scalac.util.Names;
import scalac.util.NameTransformer;
-import scalac.util.Debug;
public abstract class Symbol implements Modifiers, Kinds {
@@ -351,13 +351,13 @@ public abstract class Symbol implements Modifiers, Kinds {
// Copying & cloning ------------------------------------------------------
- /** Return a fresh symbol with the same fields as this one.
+ /** Returns a fresh symbol with the same fields as this one.
*/
public final Symbol cloneSymbol() {
return cloneSymbol(owner);
}
- /** Return a fresh symbol with the same fields as this one and the
+ /** Returns a fresh symbol with the same fields as this one and the
* given owner.
*/
public final Symbol cloneSymbol(Symbol owner) {
@@ -554,6 +554,11 @@ public abstract class Symbol implements Modifiers, Kinds {
return (flags & STABLE) != 0;
}
+ /** Is this symbol captured? */
+ public final boolean isCaptured() {
+ return (flags & CAPTURED) != 0;
+ }
+
/** Is this symbol static (i.e. with no outer instance)? */
public final boolean isStatic() {
return isRoot() || hasStaticAttribute() || owner.isStaticOwner();
@@ -801,6 +806,12 @@ public abstract class Symbol implements Modifiers, Kinds {
return (flags & PARAM) != 0;
}
+ /** Is this symbol a type parameter?
+ */
+ public final boolean isTypeParameter() {
+ return kind == TYPE && (flags & PARAM) != 0;
+ }
+
/** Is this symbol a def parameter?
*/
public final boolean isDefParameter() {