Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

… them to Any
  • Loading branch information...
commit 641e6b7e4610c0a10ea489bfd83d4e2dab4c3122 1 parent eee338b
@tadzik tadzik authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Perl6/Actions.pm
View
5 src/Perl6/Actions.pm
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.