# New Ticket Created by Elizabeth Mattijsen
# Please include the string: [perl #132157]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=132157 >
<lizmat> jnthn: another issue I just realized: can you replace a method
in an augment ?
<lizmat> if we're adding a BUILD method at compose time, we cannot add a
possibly changed BUILD method when augmenting
<lizmat> m: use MONKEY; class Foo {}; augment class Foo { has $.a } #
this appears to be legal
<+camelia> rakudo-moar 6bdb2d: ( no output )
<jnthn> m: use MONKEY; class Foo {}; BEGIN Foo.new; augment class Foo { has $.a
}
<+camelia> rakudo-moar 6bdb2d: ( no output )
<jnthn> Huh...
<jnthn> m: use MONKEY; class Foo {}; BEGIN Foo.new; augment class Foo { has $.a
}; Foo.new
<+camelia> rakudo-moar 6bdb2d: ( no output )
<jnthn> m: use MONKEY; class Foo {}; BEGIN Foo.new; augment class Foo { has $.a
}; Foo.new.a.say
<+camelia> rakudo-moar 6bdb2d: OUTPUT: «P6opaque: no such attribute '$!a'
in type Foo when trying to get a value in block <unit> at <tmp> line 1»
<jnthn> Right, that clearly can't work, but where is the error going :S
<lizmat> so: we should disallow adding attributes on augment ?
<jnthn> It used to throw (at compile time) if you tried
<jnthn> I don't know when that regressed
<lizmat> ok, well, that's a relief
<lizmat> I guess we need to add a test :-)
<jnthn>
https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/P6opaque.c#L652
fwiw