Permalink
Browse files

Make the compiler not whine about undeclared $= variables, and vivify…

… them to Any
  • Loading branch information...
1 parent eee338b commit 641e6b7e4610c0a10ea489bfd83d4e2dab4c3122 @tadzik tadzik committed May 1, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Perl6/Actions.pm
View
@@ -1178,12 +1178,15 @@ class Perl6::Actions is HLL::Actions {
# I don't know what the correct solution is. Disabling the check
# inside double quotes fixes the most common case, but fails to
# catch undeclared variables in double-quoted strings.
- if $sigil ne '&' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
+ if $sigil ne '&' && $twigil ne '=' && !$*IN_DECL && ($*QSIGIL eq '' || $*QSIGIL eq '$') && !$*W.is_lexical($past.name) {
$*W.throw($/, ['X', 'Undeclared'], symbol => $past.name());
}
elsif $sigil eq '&' {
$past.viviself(PAST::Var.new(:name('Nil'), :scope('lexical_6model')));
}
+ elsif $twigil eq '=' {
+ $past.viviself(PAST::Var.new(:name('Any'), :scope('lexical_6model')));
+ }
# Expect variable to have been declared somewhere.
# Locate descriptor and thus type.

0 comments on commit 641e6b7

Please sign in to comment.