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

Classes to be trusted need to be predeclared, apparently #3122

Closed
p6rt opened this issue May 4, 2013 · 4 comments
Closed

Classes to be trusted need to be predeclared, apparently #3122

p6rt opened this issue May 4, 2013 · 4 comments

Comments

@p6rt
Copy link

p6rt commented May 4, 2013

Migrated from rt.perl.org#117859 (status was 'resolved')

Searchable as RT117859$

@p6rt
Copy link
Author

p6rt commented May 4, 2013

From @lizmat

[19​:24​:46] <lizmat> :-) so what am I doing wrong here​:
[19​:24​:49] <lizmat> r​: class Foo { has $!foo; trusts Bar }; class Bar { method foo { self!Foo​::foo } }
[19​:24​:51] <+camelia> rakudo 474102​: OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Cannot call private method 'foo' on package Foo because it does not trust Bar␤at /tmp/E4zFVVR6lK​:1␤------> �[32m; class Bar { method foo { self!Foo​::foo�[33m⏏�[31m } }�[0m␤ expecting any of​:␤ method arguments␤»
[19​:25​:21] <timotimo> :o
[19​:25​:31] <timotimo> you don't need to predeclare Bar?
[19​:25​:40] <timotimo> r​: class Bar { ... }; class Foo { has $!foo; trusts Bar }; class Bar { method foo { self!Foo​::foo } }
[19​:25​:41] <+camelia> rakudo 474102​: ( no output )
[19​:25​:42] <moritz> you probably need to
[19​:25​:47] <timotimo> LTA error, i'd claim
[19​:25​:53] <+dalek> roast​: 33746c6 | larry++ | S05-modifier/ignorecase.t​:
[19​:25​:53] <+dalek> roast​: [M] is not <[M]>
[19​:25​:53] <+dalek> roast​: review​: Raku/roast@33746c6546
[19​:25​:56] <moritz> aye
[19​:26​:03] <timotimo> who feels like making a ticket?
[19​:26​:13] <moritz> masak!
[19​:26​:21] lizmat submits rakudobug

@p6rt
Copy link
Author

p6rt commented Mar 28, 2015

From @jnthn

On Sat May 04 10​:28​:00 2013, elizabeth wrote​:

[19​:24​:46] <lizmat> :-) so what am I doing wrong here​:
[19​:24​:49] <lizmat> r​: class Foo { has $!foo; trusts Bar }; class
Bar { method foo { self!Foo​::foo } }
[19​:24​:51] <+camelia> rakudo 474102​:
OUTPUT«�[31m===�[0mSORRY!�[31m===�[0m␤Cannot call private method 'foo'
on package Foo because it does not trust Bar␤at
/tmp/E4zFVVR6lK​:1␤------> �[32m; class Bar { method foo {
self!Foo​::foo�[33m⏏�[31m } }�[0m␤ expecting any of​:␤ method
arguments␤»
[19​:25​:21] <timotimo> :o
[19​:25​:31] <timotimo> you don't need to predeclare Bar?
[19​:25​:40] <timotimo> r​: class Bar { ... }; class Foo { has $!foo;
trusts Bar }; class Bar { method foo { self!Foo​::foo } }
[19​:25​:41] <+camelia> rakudo 474102​: ( no output )
[19​:25​:42] <moritz> you probably need to
[19​:25​:47] <timotimo> LTA error, i'd claim

It was failing to spot the undeclared type name after "trusts", continuing onward, and thus causing the confusion seen here. Now it catches the undeclared type correctly, is using a typed exception, and has the suggestion mechanism wired up.

Test added to S32-exceptions/misc.t. Resolving.

/jnthn

@p6rt
Copy link
Author

p6rt commented Mar 28, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Mar 28, 2015
@p6rt
Copy link
Author

p6rt commented Mar 28, 2015

@jnthn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant