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

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

Closed
zoffixznet opened this issue Jul 29, 2018 · 2 comments
Closed

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

zoffixznet opened this issue Jul 29, 2018 · 2 comments
Labels
easy to resolve This issue is likely easy for beginners to resolve good first issue This issue is likely easy for beginners to resolve Hacktoberfest Issues for Hacktoberfest event tests needed Issue is generally resolved but tests were not written yet

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 29, 2018

See Newcomer Guide to Contributing to Core Perl 6 for tips on fixing this Issue


<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)
    }
@zoffixznet zoffixznet added good first issue This issue is likely easy for beginners to resolve easy to resolve This issue is likely easy for beginners to resolve labels Jul 29, 2018
ribbon-otter added a commit to ribbon-otter/rakudo that referenced this issue Jul 29, 2018
This commit fixes RT rakudo#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
Fix RT #2143. Make Distribution::Resource.^mro not error.
@zoffixznet zoffixznet added the tests needed Issue is generally resolved but tests were not written yet label Jul 29, 2018
@ribbon-otter
Copy link
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
Copy link
Contributor Author

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.

@zoffixznet zoffixznet added the Hacktoberfest Issues for Hacktoberfest event label Sep 28, 2018
Kaiepi added a commit to Kaiepi/roast that referenced this issue Jan 5, 2019
Kaiepi added a commit to Kaiepi/rakudo that referenced this issue Jan 5, 2019
Kaiepi added a commit to Kaiepi/rakudo that referenced this issue Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy to resolve This issue is likely easy for beginners to resolve good first issue This issue is likely easy for beginners to resolve Hacktoberfest Issues for Hacktoberfest event tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

2 participants