Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not be able to add attributes in augment #6548

Open
p6rt opened this issue Sep 25, 2017 · 1 comment
Open

Should not be able to add attributes in augment #6548

p6rt opened this issue Sep 25, 2017 · 1 comment
Labels
regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Sep 25, 2017

Migrated from rt.perl.org#132157 (status was 'new')

Searchable as RT132157$

@p6rt
Copy link
Author

p6rt commented Sep 25, 2017

From @lizmat

<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

@p6rt p6rt added the regression Issue did not exist previously label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant