Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Analyser/ExprHandler/AssignHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ public function processAssignVar(
$throwPoints = array_merge($throwPoints, $keyResult->getThrowPoints());
$impurePoints = array_merge($impurePoints, $keyResult->getImpurePoints());
$isAlwaysTerminating = $isAlwaysTerminating || $keyResult->isAlwaysTerminating();
// no need for $keyResult->getScope()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol ;)

$scope = $keyResult->getScope();
}

if ($arrayItem->key === null) {
Expand Down
10 changes: 10 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-14019.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php declare(strict_types = 1);

namespace Bug14019;

use function PHPStan\Testing\assertType;

[($a = 'foo') => $b] = ['foo' => 1];

assertType("'foo'", $a);
assertType('1', $b);
Loading