public function assignVariable(string $variableName, Type $type = null) : self
{
$variableTypes = $this->getVariableTypes();
$variableTypes[$variableName] = $type !== null ? $type : new MixedType(true);
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);
}