mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Cache contextual type for || operator to avoid exponential compile time
This commit is contained in:
parent
601c113d93
commit
effa2597fa
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user