Skip to content

0.12.26 - issue with trait using another trait #3415

@dmaicher

Description

@dmaicher

Bug report

With the latest 0.12.26 release I got some error on a trait using another trait 😋

Code snippet that reproduces the problem

<?php declare(strict_types = 1);

trait FooParentTrait {
    public function bar() {
        echo "bar";
    }
}

trait Foo {
    use FooParentTrait;
}

class SomeClass {
    use Foo {
        bar as baz;
    }

    public function __construct()
    {
        $this->baz();
    }
}

new SomeClass();

See https://phpstan.org/r/52adcded-4689-4d96-ab9e-c277a54d9f6d

Expected output

No error should be reported there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions