Bug #69084 [Opn->Csd]: Unclear error message when not implementing a renamed abstract trait function

From: Date: Tue, 03 Mar 2020 11:11:38 +0000
Subject: Bug #69084 [Opn->Csd]: Unclear error message when not implementing a renamed abstract trait function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225861@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69084&edit=1

 ID:                 69084
 Updated by:         nikic@php.net
 Reported by:        fredemmott@php.net
 Summary:            Unclear error message when not implementing a
                     renamed abstract trait function
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   n/a
 PHP Version:        5.6.5
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

Fixed by https://github.com/php/php-src/commit/53efa1b0c69b463ea9d3606d828c036129f2dec9,
test added in https://github.com/php/php-src/commit/aa9a3ff891a84e19739ac394d32561ff4179d1e5.


Previous Comments:
------------------------------------------------------------------------
[2015-02-19 21:00:16] fredemmott@php.net

Description:
------------
It reports that the non-renamed function has not been implemented, even when it has. eg http://3v4l.org/vDEP9#v5411

Test script:
---------------
<?php

trait Foo {
    abstract public function doStuff();
    
    public function main() {
        $this->doStuff();
    }
}

class Bar {
    use Foo {
        Foo::doStuff as doOtherStuff;
    }
    
    public function doStuff() {
        var_dump(__FUNCTION__);
    }
}

$b = new Bar();
$b->main();

Expected result:
----------------
Complaint about doOtherStuff not being implemented.

Actual result:
--------------
Fatal error: Class Bar contains 1 abstract method and must therefore be declared abstract or
implement the remaining methods (Bar::doStuff) in /in/vDEP9 on line 19


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69084&edit=1


Thread (2 messages)

« previous php.bugs (#225861) next »