Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reduce spurious nonuse warnings
  • Loading branch information
sorear committed Oct 20, 2011
1 parent ba7d08c commit 3a27812
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/CodeGen.cs
Expand Up @@ -3714,18 +3714,21 @@ public class DowncallReceiver : CallReceiver {
LexInfo li = csr.dylex[lkey];

if (file != null) {
for (SubInfo csr2 = from; csr2 != csr &&
for (SubInfo csr2 = from;
csr2.unit == from.unit && // modify this unit only
!csr2.used_in_scope.ContainsKey(lkey);
csr2 = csr2.outer, levels--) {

Console.WriteLine("Marking {0} used in {1}", lkey, csr2.name);
var uisi = new SubInfo.UsedInScopeInfo();
uisi.orig_file = li.file;
uisi.orig_line = li.line;
uisi.file = file;
uisi.line = line;
uisi.levels = levels;
csr2.used_in_scope[lkey] = uisi;
if (csr == csr2)
break; // stop *after* reaching defined scope
}
}

Expand Down Expand Up @@ -3772,6 +3775,7 @@ public class DowncallReceiver : CallReceiver {
foreach (KeyValuePair<string,LexInfo> kv in s.dylex) {
if (s.used_in_scope.ContainsKey(kv.Key))
continue;
Console.WriteLine("{0} not used in {1}", kv.Key, s.name);
ret.Add(kv.Key);
ret.Add(kv.Value.pos);
}
Expand Down
2 changes: 1 addition & 1 deletion src/NieczaBackendDotnet.pm6
Expand Up @@ -136,7 +136,7 @@ class StaticSub {
method add_exports($name, $obj, $tags) {
my $u = self.unit;
for @$tags -> $tag {
$u.bind($u.rel_pkg(self.cur_pkg, 'EXPORT', $tag, :auto),
$u.bind($u.rel_pkg(self.cur_pkg, 'EXPORT', $tag, :auto).who,
$name, $obj);
}
+$tags;
Expand Down

0 comments on commit 3a27812

Please sign in to comment.