From 982e8e38aaaff9bf8cb53f393595a7254ac9dae2 Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Thu, 27 May 2010 03:50:24 +0200 Subject: [PATCH] Fix $obj.Foo::bar in the case that Foo is lexically scoped. --- src/Perl6/Actions.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 590bc733b6e..4231ef49e7b 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -1767,10 +1767,11 @@ method methodop($/) { my @parts := Perl6::Grammar::parse_name(~$); my $name := @parts.pop; if +@parts { + my $scope := is_lexical(pir::join('::', @parts)) ?? 'lexical' !! 'package'; $past.unshift(PAST::Var.new( :name(@parts.pop), :namespace(@parts), - :scope('package') + :scope($scope) )); $past.unshift($name); $past.name('!dispatch_::');