public function specifyExpressionType(Node $expr, Type $type) : self
{
if ($expr instanceof Variable && is_string($expr->name)) {
$variableName = $expr->name;
$variableTypes = $this->getVariableTypes();
$variableTypes[$variableName] = $type;
return new self($this->broker, $this->printer, $this->getFile(), $this->isDeclareStrictTypes(), $this->getClass(), $this->getFunction(), $this->getNamespace(), $variableTypes, $this->inClosureBindScopeClass, $this->getAnonymousFunctionReturnType(), $this->isInAnonymousClass() ? $this->getAnonymousClass() : null, $this->getInFunctionCall(), $this->isNegated(), $this->moreSpecificTypes);
}
$exprString = $this->printer->prettyPrintExpr($expr);
return $this->addMoreSpecificTypes([$exprString => $type]);
}