# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #69378]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=69378 >


<masak> rakudo: class A { has $.bar = "OH HAI"; method Str() { $.bar }
}; say A.new.Str
<p6eval> rakudo 0eaf62: OUTPUT«OH HAI␤»
<masak> rakudo: class A is Str { has $.bar = "OH HAI"; method Str() {
$.bar } }; say A.new.Str
<p6eval> rakudo 0eaf62: OUTPUT«Use of uninitialized value␤␤»
* masak reports rakudobug
<moritz_> masak: why is that a bug?
<masak> moritz_: because it calls the Str method, but the attribute is undef.
<moritz_> masak: A.new ~~ Str, so I don't see why it should call
method Str at all
<masak> moritz_: well, it does.
<masak> so either way, it's a bug.
<masak> moritz_: actually, I'd argue that if you define your own .Str
method, and then call it, it should be called.
<masak> but it is, so that's no problem.
<moritz_> oh wait, you call it explicitly... yeah, sorry
<masak> np. it's a confusing bug.
<masak> the problem is that $.bar yields undef for some reason.

Reply via email to