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

Can't .gist/.Str/.perl Distribution::Resource:U #2143

Open
zoffixznet opened this Issue Jul 29, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@zoffixznet
Contributor

zoffixznet commented Jul 29, 2018

<Zoffix_> m: say Distribution::Resource.^mro
<camelia> rakudo-moar b7379a804: OUTPUT: «Cannot look up attributes in a Distribution::Resource type object␤  in block <unit> at <tmp> line 1␤␤»

Fix would simply involve changing the methods to multi and type-constraining them on :D invocant. e.g.:

    multi method perl(::?CLASS:D: |c) {
        self.IO.perl(|c)
    }

ribbon-otter added a commit to ribbon-otter/rakudo that referenced this issue Jul 29, 2018

Fix RT #2143. Make Distribution::Resource.^mro not error.
This commit fixes RT #2143. Besides just making `say
Distribution::Resource.^mro` not error, `.WHAT`, `.gist,`, `.perl`,
and `.say` now also work on the type object.

Credit to zoffixznet for figuring out how to solve the problem,
as I just followed their instructions. See this irc log for more
context, http://colabti.org/irclogger/irclogger_log/perl6?date=2018-07-29#l84

zoffixznet added a commit that referenced this issue Jul 29, 2018

Merge pull request #2145 from ribbon-otter/master
Fix RT #2143. Make Distribution::Resource.^mro not error.
@ribbon-otter

This comment has been minimized.

Show comment
Hide comment
@ribbon-otter

ribbon-otter Jul 31, 2018

Contributor

Where would an appropriate place to write the tests be? Searching for either "Distribution" or "%?RESOURCES" on Perl6/Roast doesn't seem to give any hints for tests should be placed. UPDATE: I am placed my tests in MISC/bug-coverage.t for now.

Also, note that even with the pull request, Distribution::Resource.Str still errors. I don't know enough about perl6 to know if this correct behaviour or not.

Contributor

ribbon-otter commented Jul 31, 2018

Where would an appropriate place to write the tests be? Searching for either "Distribution" or "%?RESOURCES" on Perl6/Roast doesn't seem to give any hints for tests should be placed. UPDATE: I am placed my tests in MISC/bug-coverage.t for now.

Also, note that even with the pull request, Distribution::Resource.Str still errors. I don't know enough about perl6 to know if this correct behaviour or not.

@zoffixznet

This comment has been minimized.

Show comment
Hide comment
@zoffixznet

zoffixznet Jul 31, 2018

Contributor

Distribution::Resource.Str

It doesn't error. That's a stringification warning that usually is displayed when you stringify classes ain't meant to be stringified.

Contributor

zoffixznet commented Jul 31, 2018

Distribution::Resource.Str

It doesn't error. That's a stringification warning that usually is displayed when you stringify classes ain't meant to be stringified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment