diff --git a/src/Analyser/NodeScopeResolver.php b/src/Analyser/NodeScopeResolver.php
index <HASH>..<HASH> 100644
--- a/src/Analyser/NodeScopeResolver.php
+++ b/src/Analyser/NodeScopeResolver.php
@@ -682,7 +682,7 @@ class NodeScopeResolver
 			}
 
 			if ($intersectedScope === null) {
-				$intersectedScope = $branchScope;
+				$intersectedScope = $initialScope->addVariables($branchScope);
 			} elseif ($mergeWithPrevious) {
 				if ($previousBranchScope !== null) {
 					$intersectedScope = $branchScope->addVariables($previousBranchScope);
diff --git a/src/Analyser/Scope.php b/src/Analyser/Scope.php
index <HASH>..<HASH> 100644
--- a/src/Analyser/Scope.php
+++ b/src/Analyser/Scope.php
@@ -1043,6 +1043,9 @@ class Scope
 	{
 		$variableTypes = $this->getVariableTypes();
 		foreach ($otherScope->getVariableTypes() as $name => $variableType) {
+			if ($this->hasVariableType($name)) {
+				$variableType = $this->getVariableType($name)->combineWith($variableType);
+			}
 			$variableTypes[$name] = $variableType;
 		}
Fixed weird issue with defineVariablesWithoutDefaultBranch set to true