mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Cache contextual type for || operator to avoid exponential compile time
This commit is contained in:
1 parent
601c113d93
commit
effa2597fa
1 file changed
+1
-1
@@ -13059,7 +13059,7 @@ namespace ts {
|
||||
// expression has no contextual type, the right operand is contextually typed by the type of the left operand.
|
||||
let type = getContextualType(binaryExpression);
|
||||
if (!type && node === binaryExpression.right) {
|
||||
type = getTypeOfExpression(binaryExpression.left);
|
||||
type = getTypeOfExpression(binaryExpression.left, /*cache*/ true);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user