Hi Timo,
After I read your explanation and now it is even logical to use role
punning in my app. In most cases I don't want to override this default
behavior of method xyz but I would like to add new specific one. Only
one class does opposite so it should be subclass of a role.
On Fri, Jun 27, 20
On 27 Jun 2014, at 09:25, Timo Paulssen wrote:
> On 27/06/14 10:07, Kamil Kułaga wrote:
>> Hi,
>>
>> I would like to ask for help in understanding difference between this code:
>>
>>use v6;
>>
>>role X {
>>multi method xyz(Any $a) {say "Class X"}
>> }
>>
>> class Y does
On 27/06/14 10:07, Kamil Kułaga wrote:
Hi,
I would like to ask for help in understanding difference between this code:
use v6;
role X {
multi method xyz(Any $a) {say "Class X"}
}
class Y does X {
multi method xyz(Any $a) {say "Class Y"}
}
say Y.ne
Hi,
I would like to ask for help in understanding difference between this code:
use v6;
role X {
multi method xyz(Any $a) {say "Class X"}
}
class Y does X {
multi method xyz(Any $a) {say "Class Y"}
}
say Y.new.xyz(1);
$ perl6 tst.pl
Ambiguous call