Author: jonathan
Date: Sat Nov  8 03:06:11 2008
New Revision: 32446

Modified:
   trunk/languages/perl6/src/parser/actions.pm

Log:
[rakudo] When you use a type in a signature that was captured earlier in the 
signature, need to fix up the scope.

Modified: trunk/languages/perl6/src/parser/actions.pm
==============================================================================
--- trunk/languages/perl6/src/parser/actions.pm (original)
+++ trunk/languages/perl6/src/parser/actions.pm Sat Nov  8 03:06:11 2008
@@ -1070,10 +1070,19 @@
             for $_<parameter><type_constraint> {
                 # Just a type name?
                 if $_<typename><name><identifier> {
+                    # Get type; we may have to fix up the scope if it's
+                    # been captured within the signature.
+                    my $type := $( $_<typename> );
+                    my $local_sym := $block_past.symbol($type.name());
+                    if $local_sym {
+                        $type.scope($local_sym<scope>);
+                    }
+
+                    # Emit check.
                     my $type_obj := PAST::Op.new(
                         :pasttype('call'),
                         :name('!TYPECHECKPARAM'),
-                        $( $_<typename> ),
+                        $type,
                         PAST::Var.new(
                             :name($parameter.name()),
                             :scope('lexical')

Reply via email to