Skip to content

[DependencyInjection] Circular reference detected for autowired decorator #28283

@BoShurik

Description

@BoShurik

Symfony version(s) affected: 4.1.3

Description
With this config

App\DI\Foo\FooInterface: '@App\DI\Foo\Foo'

App\DI\Foo\FooDecorator:
    decorates: App\DI\Foo\FooInterface

App\DI\Bar\BarInterface: '@App\DI\Bar\Bar'

App\DI\Bar\BarDecorator:
    decorates: App\DI\Bar\BarInterface

I've got

Circular reference detected for service "App\DI\Foo\FooDecorator", path: "App\DI\Foo\FooDecorator -> App\DI\Foo\FooDecorator".

If I comment decorates: App\DI\Bar\BarInterface line - all works fine
Explicit setting

arguments:
    $decorated: '@App\DI\Bar\BarDecorator.inner'

also works

How to reproduce
https://github.com/BoShurik/symfony-di-issue

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