Trey wrote:
> I'm wondering about how the sigil-invariance rule interacts with
> attributes.
>
> class Foo {
> attr $bar;
> attr @bar;
> method baz {
> return @.bar[$.bar]; # sigils disambiguate
> }
> method frob ($self:) {
> return $self.bar[$self.bar]; # uh-oh....
> }
> }
>
> Is this a problem,
Not in this example. Since neither attribute was declared public,
neither generates a default accessor method.
> or do attributes share a namespace, making the two bar
> attributes above a redefinition?
No. But it will surely to a compile-time error to declare two
public attributes with the same symbolic name, unless you also
declare a method of the same symbolic name (which would then
suppress the two colliding implicit method creations).
Damian