What will happen if the attribute's names are the same but declared with different keyword?

2005-08-17 Thread Yiyi Hu
class T { has $.a =1; my $.a=2; }; my T $o .= new; $o.a().say; What the result will be please? 1 or 2? Or an error? Thanks, Xinming

Re: What will happen if the attribute's names are the same but declared with different keyword?

2005-08-17 Thread Larry Wall
On Thu, Aug 18, 2005 at 03:33:35AM +0800, Yiyi Hu wrote: : class T : { : has $.a =1; : my $.a=2; : }; : my T $o .= new; : $o.a().say; : : What the result will be please? : 1 or 2? : Or an error? Definitely a compile-time error. You can't declare the same lexical name even if the declarator is