In perl.git, the branch avar/no-UNIVERSAL-import-routine-TODO has been created

<http://perl5.git.perl.org/perl.git/commitdiff/4d55d23063fa53650fcad290c280f2f34ffafb14?hp=0000000000000000000000000000000000000000>

        at  4d55d23063fa53650fcad290c280f2f34ffafb14 (commit)

- Log -----------------------------------------------------------------
commit 4d55d23063fa53650fcad290c280f2f34ffafb14
Author: Ævar Arnfjörð Bjarmason <[email protected]>
Date:   Fri Jul 15 21:50:33 2016 +0000

    UNIVERSAL: Get rid of the import routine so Whatever->can("import") is false
    
    Whenever someone does "use UNIVERSAL" $anything->can("import)" becomes
    true and returns the UNIVERSAL subref.
    
    The reason for this is that we used to support e.g.:
    
        use UNIVERSAL qw(can);
    
    That was warned about back in in v5.10.0-2172-g1d9f57d, and since
    v5.21.2-13-g1178d2c "use UNIVERSAL (...)" dies.
    
    However the negative side of how this is done now is that we're still
    injecting an import routine to every single Perl class, remove that
    edge case at the cost of checking for this in gv.c, which is fine
    since UNIVERSAL was always in core anyway.
    
    FAIL: This doesn't work because it breaks "use UNIVERSAL" since I
    can't emulate the "return unless @_ > 1" case here. Just committing
    this so others can learn from this mistake in the future.
-----------------------------------------------------------------------

--
Perl5 Master Repository

Reply via email to