masak (>>), Coke (>):
>> From the backlog:
>>
>> <hudnix> well I just spent a miserable two hours figuring out that the
>> error message "Type objects are abstract and have no attributes, but
>> you tried to access @!foo" in fact had nothing to do with the
>> attribute @!foo or anything else in my class, but was really
>> complaining that I had declared my object with "my $obj;" instead of
>> "my $obj .= new"
>>
>> Would it be possible to have the error message be something like
>> "Tried to use type object $obj as an instance object"? Especially
>> having the name of the variable with the object being improperly
>> accessed seems like it would be a big help in a situation such as the
>> above.
>
> Can we get some sample code that demonstrates this problem?

<masak> r: class A { has $!x; method foo { say $!x } }; A.foo
<p6eval> rakudo 197e0b: OUTPUT«Cannot look up attributes in a type object [...]

Reply via email to