This does not compile; I think it should:

use v6;

class Foo {
    class Bar {
        our $quux = 42;
    }
}

say $Foo::Bar::quux;  # works - 42
say Foo::Bar::<$quux>;  # works - 42
my $bar = 'Bar';
say $Foo::($bar)::quux;  # works - 42

# shouldn't this work too?
say Foo::($bar)::<$quux>;  # nope - won't compile

# ===SORRY!=== Error while compiling /home/hogaboom/hogaboom/Perl6/p6ex/./p6test.p6
# Combination of indirect name lookup and call not supported
# at /home/hogaboom/hogaboom/Perl6/p6ex/./p6test.p6:16
# ------> say Foo::($bar)::⏏<$quux>;  # nope
#     expecting any of:
#         argument list

# See https://docs.perl6.org/language/packages
# and look at the first two sections: 'Names' and 'Package-qualified names'

--

rahogaboom

Reply via email to