Skip to content

Commit

Permalink
bug #29432 [DI] dont inline when lazy edges are found (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] dont inline when lazy edges are found

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #29412, #29391
| License       | MIT
| Doc PR        | -

I'm not able to create a reproducer to hit this situation, but on 4.2, this check makes the difference.
I'm merging to fix the issue as that's still the proper fix.

Commits
-------

484c49e [DI] dont inline when lazy edges are found
  • Loading branch information
nicolas-grekas committed Dec 2, 2018
2 parents c2d2f5b + 484c49e commit 0ca1614
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -130,7 +130,7 @@ private function isInlineableDefinition($id, Definition $definition, ServiceRefe
$isReferencedByConstructor = false;
foreach ($graph->getNode($id)->getInEdges() as $edge) {
$isReferencedByConstructor = $isReferencedByConstructor || $edge->isReferencedByConstructor();
if ($edge->isWeak()) {
if ($edge->isWeak() || $edge->isLazy()) {
return false;
}
$ids[] = $edge->getSourceNode()->getId();
Expand Down

0 comments on commit 0ca1614

Please sign in to comment.