diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php index d98387ca0..337559988 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Assignment/InstancePropertyAssignmentAnalyzer.php @@ -1046,10 +1046,6 @@ class InstancePropertyAssignmentAnalyzer ), $statements_analyzer->getSuppressedIssues() )) { - //var_dump($context); - //$context->vars_in_scope['$this->t'] = new \Psalm\Type\Atomic\TNamedObject("Closed"); - //die; - //throw new \Exception('here'); return false; } } else { diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php index 64465de29..e4ea771ff 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/AssignmentAnalyzer.php @@ -1297,6 +1297,7 @@ class AssignmentAnalyzer return; } + $var_id = ExpressionIdentifier::getVarId( $stmt, $statements_analyzer->getFQCLN(), diff --git a/typestatetest.php b/typestatetest.php deleted file mode 100644 index 5265ed15f..000000000 --- a/typestatetest.php +++ /dev/null @@ -1,95 +0,0 @@ -open(); -if ($file instanceof OpenFile) { - $content = $file->read(); - $file->close(); -} elseif ($file instanceof CannotOpen) { - // Mooo. -} - -for ($i = 1; $i < 10; ++$i) { - // TODO: What here? - $file->open(); -} - -// ClosedFile -$file = new MyFile("somefile"); -if ($file instanceof OpenFile) { - // TODO: Impossible -} -if (hardcomputation()) { - $file->open(); -} -// $file is OpenFile|ClosedFile|CannotOpen -// TODO: Have to check state? - -/** - * @param OpenFile $file - */ -function readall(OpenFile $file) { - $file->read(); - $file->close(); // TODO: Not allowed to change state of aliased variable. - return $file; // TODO: Not allowed to transfer ownership -} - -/** - * @param string $name - * @return ClosedFile - */ -function makefile($name) { - // ClosedFile - $file = new File($name); - dosomething($file); // Can't change state, still closed - return $file; // Owner can change -} - -/** - * @param ClosedFile $file - * @param-out OpenFile $file - */ -function open(ClosedFile &$file) -{ -}