diff options
author | Martin Odersky <odersky@gmail.com> | 2004-04-06 17:57:30 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2004-04-06 17:57:30 +0000 |
commit | 35f72d0a599e3aca2940e295052c0275c0a32533 (patch) | |
tree | 86c40542dc2a3412b4a0fcb76a71c1e1141522bf /sources/scalac/symtab/Symbol.java | |
parent | 17c857d22ec405ec89e87e40206aecc2be84255d (diff) | |
download | scala-35f72d0a599e3aca2940e295052c0275c0a32533.tar.gz scala-35f72d0a599e3aca2940e295052c0275c0a32533.tar.bz2 scala-35f72d0a599e3aca2940e295052c0275c0a32533.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index c65bdcdc6c..ccd9f2632a 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -504,6 +504,12 @@ public abstract class Symbol implements Modifiers, Kinds { throw new ApplicationError("setLoBound inapplicable for " + this); } + /** Set the view bound of this type variable + */ + public Symbol setVuBound(Type lobound) { + throw new ApplicationError("setVuBound inapplicable for " + this); + } + /** Add an auxiliary constructor to class. */ public void addConstructor(Symbol constr) { @@ -575,6 +581,13 @@ public abstract class Symbol implements Modifiers, Kinds { return kind == VAL && (flags & MUTABLE) != 0; } + /** Does this symbol denote a view bounded type variable? */ + public final boolean isViewBounded() { + Global global = Global.instance; + return kind == TYPE && (flags & VIEWBOUND) != 0 && + global.currentPhase.id <= global.PHASE.REFCHECK.id(); + } + /** * Does this symbol denote a final method? A final method is one * that can't be overridden in a subclass. This method assumes @@ -1278,6 +1291,12 @@ public abstract class Symbol implements Modifiers, Kinds { return Global.instance.definitions.ALL_TYPE(); } + /** The view bound of this type variable + */ + public Type vuBound() { + return Global.instance.definitions.ANY_TYPE(); + } + /** Get this.type corresponding to this symbol */ public Type thisType() { @@ -1757,6 +1776,7 @@ final class AliasTypeSymbol extends TypeSymbol { final class AbsTypeSymbol extends TypeSymbol { private Type lobound = null; + private Type vubound = null; /** Initializes this instance. */ AbsTypeSymbol(int pos, Name name, Symbol owner, int flags, int attrs) { @@ -1769,14 +1789,25 @@ final class AbsTypeSymbol extends TypeSymbol { return lobound == null ? Global.instance.definitions.ALL_TYPE() : lobound; } + public Type vuBound() { + initialize(); + return vubound == null ? Global.instance.definitions.ANY_TYPE() : vubound; + } + public Symbol setLoBound(Type lobound) { this.lobound = lobound; return this; } + public Symbol setVuBound(Type vubound) { + this.vubound = vubound; + return this; + } + protected TypeSymbol cloneTypeSymbolImpl(Symbol owner, int attrs) { TypeSymbol clone = new AbsTypeSymbol(pos, name, owner, flags, attrs); clone.setLoBound(loBound()); + clone.setVuBound(vuBound()); return clone; } |