Skip to content

Commit

Permalink
Fix #1935 - clear stub grandchildren
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Jul 11, 2019
1 parent 7d05568 commit 12eeb8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Psalm/Internal/Codebase/Populator.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ public function populateCodebase(\Psalm\Codebase $codebase)
} }
} }


foreach ($class_storage->dependent_classlikes as $dependent_classlike_name => $_) {
$dependee_storage = $this->classlike_storage_provider->get($dependent_classlike_name);

$class_storage->dependent_classlikes += $dependee_storage->dependent_classlikes;
}

if ($class_storage->aliases) { if ($class_storage->aliases) {
foreach ($class_storage->public_class_constant_nodes as $const_name => $node) { foreach ($class_storage->public_class_constant_nodes as $const_name => $node) {
$const_type = \Psalm\Internal\Analyzer\StatementsAnalyzer::getSimpleType( $const_type = \Psalm\Internal\Analyzer\StatementsAnalyzer::getSimpleType(
Expand Down
2 changes: 1 addition & 1 deletion tests/StubTest.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ public function foo(string $a) {
*/ */
public function testStubFileWithTemplatedClassDefinitionAndMagicMethodOverride() public function testStubFileWithTemplatedClassDefinitionAndMagicMethodOverride()
{ {
$this->markTestSkipped('Currently broken'); //$this->markTestSkipped('Currently broken');
$this->project_analyzer = $this->getProjectAnalyzerWithConfig( $this->project_analyzer = $this->getProjectAnalyzerWithConfig(
TestConfig::loadFromXML( TestConfig::loadFromXML(
dirname(__DIR__), dirname(__DIR__),
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/stubs/templated_class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ class A {
*/ */
public function find($id, $lockMode = null, $lockVersion = null) {} public function find($id, $lockMode = null, $lockVersion = null) {}
} }


0 comments on commit 12eeb8b

Please sign in to comment.