diff options
author | paltherr <paltherr@epfl.ch> | 2003-09-06 18:52:22 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-09-06 18:52:22 +0000 |
commit | d107eb40f1372ab1a1b9b26220e55c512d44ecd7 (patch) | |
tree | 8715c93deed809a15d85da6e51864efaa4ff476a /sources/scalac/ast/TreeGen.java | |
parent | e2b146bbef7479f8bbd2aed1f461ace30d541899 (diff) | |
download | scala-d107eb40f1372ab1a1b9b26220e55c512d44ecd7.tar.gz scala-d107eb40f1372ab1a1b9b26220e55c512d44ecd7.tar.bz2 scala-d107eb40f1372ab1a1b9b26220e55c512d44ecd7.zip |
- Added TreeGen.mkTypeIdent
- Added assertion in TreeGen.Ident
- Changed LambdaLift to invoke TreeGen.mkTypeIdent/Ident for targs/vargs
- Changed Analyzer to not invoke TreeGen.Ident with class symbol
Diffstat (limited to 'sources/scalac/ast/TreeGen.java')
-rw-r--r-- | sources/scalac/ast/TreeGen.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index c6d7e72332..7ffcf347ea 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -116,6 +116,18 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { } } + /** Build and attribute type ident node with given symbol. + */ + public Tree mkTypeIdent(int pos, Symbol sym) { + assert sym.kind == TYPE: Debug.show(sym); + sym.flags |= ACCESSED; + return mkType(pos, sym.nextType()); + } + + public Tree mkTypeIdent(Symbol sym) { + return Ident(sym.pos, sym); + } + /** Build and attribute tree corresponding to given type. */ public Tree mkType(int pos, Type type) { @@ -496,11 +508,9 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { /** Build and attribute ident node with given symbol. */ public Tree Ident(int pos, Symbol sym) { - Global.instance.nextPhase(); - Type symtype = sym.type(); - Global.instance.prevPhase(); + assert sym.isTerm(): Debug.show(sym); sym.flags |= ACCESSED; - return make.Ident(pos, sym).setType(deref(symtype)); + return make.Ident(pos, sym).setType(deref(sym.nextType())); } public Tree Ident(Symbol sym) { |