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

spews warnings with recent Object::Pad: Object::Pad::MOP is experimental ... #174

Open
jonassmedegaard opened this issue Jan 8, 2023 · 4 comments

Comments

@jonassmedegaard
Copy link

Calls to Object::Pad::MOP spews errors since recently, as documented here.

Here's a fix:

--- a/GenericClass.pm
+++ b/GenericClass.pm
@@ -93,6 +93,7 @@ filter '-class' => sub {
             }
             elsif ($parent eq 'Object::Pad::UNIVERSAL') {
                 Data::Printer::Common::_tryme(sub {
+                    no if ( $] >= 5.018 ), warnings => 'experimental';
                     my $meta = Object::Pad::MOP::Class->for_class( $class_name );
                     %attributes = map {
                         $_->name . $_->value($class_name) => {
@garu
Copy link
Owner

garu commented Jan 10, 2023

Hi Jonas! Thanks for the head's up and the patch! Unfortunately I cannot accept it as is because "no if" only made it to core in perl 5.22.0 and Object::Pad's minimal version is 5.18.0 - and I don't want to add an extra dependency just to cover Object::Pad.

Could you update the patch so it works with older perls without adding an extra dependency? I know it's a bit of a pain but a lot of developers need to work on pretty wild codebases and I want DDP to be a tool for everyone. If you can't, just let me know and I'll try and come up with something when I have enough time.

Thanks!

@jonassmedegaard
Copy link
Author

jonassmedegaard commented Jan 10, 2023 via email

@jonassmedegaard
Copy link
Author

I think you are mistaken: perl 5.18 documents the syntax proposed here, and tests for App::Licensecheck v3.3.4 using that syntax seems to succeed for perl 5.18.

@jonassmedegaard
Copy link
Author

@garu Can you elaborate on why you believe this won't work for older perls?

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

2 participants