Permalink
Browse files

Implement %*MYSTERY check to suppress warning in foo; sub foo() { }

  • Loading branch information...
1 parent fa0725c commit 9a69bf4f07dbeffde70bfdfc9259cdaf4b917f88 @sorear committed Oct 30, 2011
Showing with 11 additions and 0 deletions.
  1. +3 −0 lib/CodeGen.cs
  2. +8 −0 src/NieczaBackendDotnet.pm6
View
@@ -3507,6 +3507,9 @@ public class DowncallReceiver : CallReceiver {
uisi.line, li.file, li.line, uisi.orig_file, uisi.orig_line };
li.owner.AddLexical(li.name, li);
+ if (li.name.Length >= 1 && li.name[0] == '&')
+ return new object[] { "sub", li.name };
+
return new object[] { "" };
}
@@ -152,6 +152,14 @@ class StaticSub {
$truename ~~ s/<?before \w>/OUTER::/ for ^$count;
die "Lexical symbol '$slot' is already bound to an outer symbol{Metamodel.locstr($of, $ol, $nf, $nl)};\n the implicit outer binding at line $line must be rewritten as $truename\n before you can unambiguously declare a new '$slot' in this scope";
}
+ when 'sub' {
+ my ($ , $slot) = @args;
+ if %*MYSTERY{substr($slot,1)} -> $my {
+ my $ix = $my<line>.index(',');
+ self.lookup_lex($slot, $*FILE<name>,
+ +(defined($ix) ?? substr($my<line>,0,$ix) !! $my<line>));
+ }
+ }
}
}

0 comments on commit 9a69bf4

Please sign in to comment.