summaryrefslogtreecommitdiff
path: root/sources/scalac
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-03-14 16:12:13 +0000
committerschinz <schinz@epfl.ch>2005-03-14 16:12:13 +0000
commit90a381470739e5a37f98ed6fae6c68d11c5e1781 (patch)
tree5ec13dcee3bfa15d9d1b88e89fa8f0e269e96c3f /sources/scalac
parent105ddb769e97e0f2957648ab5826c9e326fe781f (diff)
downloadscala-90a381470739e5a37f98ed6fae6c68d11c5e1781.tar.gz
scala-90a381470739e5a37f98ed6fae6c68d11c5e1781.tar.bz2
scala-90a381470739e5a37f98ed6fae6c68d11c5e1781.zip
- added a new kind of literal, SYMBOL_NAME, whi...
- added a new kind of literal, SYMBOL_NAME, which is a string literal whose value is the name of the attached symbol - modified mkLocalRef to handle static members
Diffstat (limited to 'sources/scalac')
-rw-r--r--sources/scalac/ast/TreeGen.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index 1594be86ad..31389a3227 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -139,6 +139,11 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
return Literal(pos, AConstant.STRING(value));
}
+ /** Builds a symbol name literal. */
+ public Tree mkSymbolNameLit(int pos, Symbol value) {
+ return Literal(pos, AConstant.SYMBOL_NAME(value));
+ }
+
/** Builds a null literal. */
public Tree mkNullLit(int pos) {
return Literal(pos, AConstant.NULL);
@@ -258,7 +263,10 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
/** Builds a local reference to given symbol. */
public Tree mkLocalRef(int pos, Symbol symbol) {
assert symbol.isTerm(): Debug.show(symbol);
- return mkRef(pos, symbol.owner().thisType(), symbol);
+ Type prefix = symbol.hasStaticAttribute()
+ ? Type.NoPrefix
+ : symbol.owner().thisType();
+ return mkRef(pos, prefix, symbol);
}
/** Builds a global reference to given symbol. */