diff options
author | Martin Odersky <odersky@gmail.com> | 2003-04-30 09:06:27 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-04-30 09:06:27 +0000 |
commit | 21f24de326d79515c44f80665f9679410389b1ab (patch) | |
tree | bc8820c917f88ecda8469c90bd7f7298fdc27975 /sources/scalac/typechecker/RefCheck.java | |
parent | e0d3451834b3cc5748dadb6b53971c05878faee4 (diff) | |
download | scala-21f24de326d79515c44f80665f9679410389b1ab.tar.gz scala-21f24de326d79515c44f80665f9679410389b1ab.tar.bz2 scala-21f24de326d79515c44f80665f9679410389b1ab.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/typechecker/RefCheck.java')
-rw-r--r-- | sources/scalac/typechecker/RefCheck.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sources/scalac/typechecker/RefCheck.java b/sources/scalac/typechecker/RefCheck.java index 2728bdb6c3..0d5caa78e4 100644 --- a/sources/scalac/typechecker/RefCheck.java +++ b/sources/scalac/typechecker/RefCheck.java @@ -118,12 +118,6 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { return stats; } - public Tree nullTree(int pos, Type tp) { - return gen.TypeApply( - gen.Ident(pos, defs.NULL), - new Tree[]{gen.mkType(pos, tp)}); - } - private boolean isGlobalModule(Symbol sym) { return sym.isModule() && @@ -150,20 +144,20 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { Tree vdef = gen.ValDef(sym, alloc); return new Tree[]{cdef, vdef}; } else { - // var m$: T = null[T]; + // var m$: T = null; Name varname = Name.fromString(name + "$"); Symbol mvar = new TermSymbol( tree.pos, varname, sym.owner(), PRIVATE | MUTABLE | SYNTHETIC) .setInfo(sym.type()); - Tree vdef = gen.ValDef(mvar, nullTree(tree.pos, sym.type())); + Tree vdef = gen.ValDef(mvar, gen.Ident(tree.pos, defs.NULL)); - // { if (null[T] == m$) m$ = new m$class; m$ } + // { if (null == m$) m$ = new m$class; m$ } Symbol eqMethod = getMemberMethod( sym.type(), Names.EQEQ, defs.ANY_TYPE); Tree body = gen.Block(new Tree[]{ gen.If( gen.Apply( - gen.Select(nullTree(tree.pos, sym.type()), eqMethod), + gen.Select(gen.Ident(tree.pos, defs.NULL), eqMethod), new Tree[]{gen.mkRef(tree.pos, mvar)}), gen.Assign(gen.mkRef(tree.pos, mvar), alloc), gen.Block(tree.pos, Tree.EMPTY_ARRAY)), |