Skip to content

Commit

Permalink
- added methods isCaptured and isTypeParameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
michelou committed Jul 7, 2005
1 parent d145b66 commit 4139c12
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions sources/scalac/symtab/Symbol.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ____ ____ ____ ____ ______ *\
** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala **
** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002-2005, LAMP/EPFL **
** /_____/\____/\___/\____/____/ **
\* */

Expand All @@ -19,10 +19,10 @@
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 {
Expand Down Expand Up @@ -351,13 +351,13 @@ final ClassSymbol newCompoundClass(Type info) {

// 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) {
Expand Down Expand Up @@ -554,6 +554,11 @@ public final boolean hasStableFlag() {
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();
Expand Down Expand Up @@ -801,6 +806,12 @@ public final boolean isParameter() {
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() {
Expand Down

0 comments on commit 4139c12

Please sign in to comment.