Description
Symfony version(s) affected: 4.4.0
Description
Named argument binding doesn't support !tagged_locator
.
How to reproduce
services:
_defaults:
bind:
Psr\Container\ContainerInterface $foo: !tagged_locator my.locator
Invalid value for binding key "Psr\Container\ContainerInterface $foo" for service "Some\Unrelated\Service\That\Doesn't\Even\Have$foo\Argument": expected null, an instance of Symfony\Component\DependencyInjection\Reference or an instance of Symfony\Component\DependencyInjection\Definition or an instance of Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument, object given.
Possible Solution
Works fine if type is omitted, e.g. $foo: !tagged_locator my.locator
. Breaks as soon as Psr\Container\ContainerInterface
is specified as a type prefix, by attempting to inject into every service instead of just those with matching parameters.