Skip Menu |
Report information
Id: 132157
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: liz [at] wenzperl.nl
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Elizabeth Mattijsen <liz [...] wenzperl.nl>
Subject: [REGRESSION] Should not be able to add attributes in augment
Date: Mon, 25 Sep 2017 13:51:52 +0200
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
<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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org