mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
* Cherry-pick PR #47927 into release-4.6
Component commits:
c4aa31b67f early return if pattern type is never
* Update LKG
Co-authored-by: Gabriela Araujo Britto <gabrielaa@microsoft.com>
Co-authored-by: typescript-bot <typescript@microsoft.com>
This commit is contained in:
co-authored by
Gabriela Araujo Britto
typescript-bot
parent
f4fe064b38
commit
78ee4cacaf
@@ -70225,6 +70225,9 @@ var ts;
|
||||
if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
|
||||
var pattern = declaration.parent;
|
||||
var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
|
||||
if (narrowedType.flags & 131072 /* Never */) {
|
||||
return neverType;
|
||||
}
|
||||
return getBindingElementTypeFromParentType(declaration, narrowedType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user