Data-Printer icon indicating copy to clipboard operation
Data-Printer copied to clipboard

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

Open jonassmedegaard opened this issue 2 years ago • 5 comments

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) => {

jonassmedegaard avatar Jan 08 '23 18:01 jonassmedegaard

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!

garu avatar Jan 10 '23 03:01 garu

Quoting Breno G. de Oliveira (2023-01-10 04:38:12)

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.

Ohh, thanks for clueing me in on why App::Licensecheck 3.3.2 really fails, and why my fix for 3.3.3 won't do any good.

I will try look for a better fix.

  • Jonas

--

  • Jonas Smedegaard - idealist & Internet-arkitekt
  • Tlf.: +45 40843136 Website: http://dr.jones.dk/
  • Sponsorship: https://ko-fi.com/drjones

[x] quote me freely [ ] ask before reusing [ ] keep private

jonassmedegaard avatar Jan 10 '23 05:01 jonassmedegaard

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 avatar Jan 14 '23 16:01 jonassmedegaard

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

jonassmedegaard avatar Jan 31 '23 12:01 jonassmedegaard

because "no if" only made it to core in perl 5.22.0

The "no if" syntax exists forever (well, almost):

$ corelist if   
...
if was first released with perl v5.6.2

So I think there are no obstacles for applying the patch?

eserte avatar Jun 17 '24 14:06 eserte