diff options
author | Martin Odersky <odersky@gmail.com> | 2003-03-03 14:33:53 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-03-03 14:33:53 +0000 |
commit | 6749e5dd658522cb63600021a9ee5a86f911cfeb (patch) | |
tree | a22d4bf7f2bf71b5775418dfddaa31a1640313d1 /sources/scalac/typechecker/RefCheck.java | |
parent | e1fb3fb655a067039870016b3a47e2305d692d98 (diff) | |
download | scala-6749e5dd658522cb63600021a9ee5a86f911cfeb.tar.gz scala-6749e5dd658522cb63600021a9ee5a86f911cfeb.tar.bz2 scala-6749e5dd658522cb63600021a9ee5a86f911cfeb.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/typechecker/RefCheck.java')
-rw-r--r-- | sources/scalac/typechecker/RefCheck.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/scalac/typechecker/RefCheck.java b/sources/scalac/typechecker/RefCheck.java index b45a9d3a2f..753c81986b 100644 --- a/sources/scalac/typechecker/RefCheck.java +++ b/sources/scalac/typechecker/RefCheck.java @@ -97,7 +97,7 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { case ValDef(_, _, _, _): sym = stat.symbol(); } - if (sym != null) { + if (sym != null && sym.isLocal()) { scopes[level].enter(sym); symIndex.put(sym, new Integer(index)); } @@ -163,7 +163,7 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { Symbol sym = tree.symbol(); resultTree = transform(tree); //todo: handle variables - if (index <= maxindex[level]) { + if (sym.isLocal() && index <= maxindex[level]) { if (Global.instance.debug) System.out.println(refsym[level] + ":" + refsym[level].type()); unit.error( @@ -189,7 +189,8 @@ public class RefCheck extends Transformer implements Modifiers, Kinds { return copy.Block(tree, stats1); case Ident(Name name): Scope.Entry e = scopes[level].lookupEntry(name); - if (tree.symbol() == e.sym) { + Symbol sym = tree.symbol(); + if (sym.isLocal() && sym == e.sym) { int i = level; while (scopes[i] != e.owner) i--; int symindex = ((Integer) symIndex.get(tree.symbol())).intValue(); |