Skip to content

InfoSys::FreeDB regression: UNIVERSAL::import makes use_ok fatal #1214

Description

@fglock

Summary

The InfoSys::FreeDB 0.92 CPAN regression fails only when use_ok imports the package. Standard Perl accepts this case (with a non-fatal undefined-import warning), but PerlOnJava makes it fatal.

Reproduction

timeout 120 env PERL5LIB=... jperl t/00-entry.t

Observed on both the JVM and interpreter backends:

not ok 1 - use InfoSys::FreeDB::Entry
Error: UNIVERSAL does not export anything
ok 2 - new_from_fn
ok 3 - mkdir
ok 4 - write
ok 5 - compare

System Perl passes all 5 tests. The CPAN tester record is a regression from the prior passing run and reports 54/55 subtests passing.

Root cause

Test::More::use_ok passes its diagnostic argument to the package import. Since InfoSys::FreeDB::Entry has no import method, PerlOnJava dispatches to UNIVERSAL::import, whose importUniversal implementation throws whenever more than one argument is present:

UNIVERSAL does not export anything

This should be compatible with standard Perl's undefined-import behavior and should not fail use_ok.

Suggested fix

Make the fallback UNIVERSAL::import path tolerate the diagnostic/import arguments when the target package does not define its own import method, while preserving errors for genuinely unsupported exports.

Observed by the CPAN compatibility tester in the InfoSys::FreeDB regression run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeCore Perl runtime semanticsbugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions