mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 00:34:47 -05:00
Add contextual types infer
This commit is contained in:
@@ -22365,6 +22365,8 @@ namespace ts {
|
||||
return contextSensitive === true ? getTypeOfExpression(left) : contextSensitive;
|
||||
case SyntaxKind.BarBarToken:
|
||||
case SyntaxKind.QuestionQuestionToken:
|
||||
case SyntaxKind.BarBarEqualsToken:
|
||||
case SyntaxKind.QuestionQuestionEqualsToken:
|
||||
// When an || expression has a contextual type, the operands are contextually typed by that type, except
|
||||
// when that type originates in a binding pattern, the right operand is contextually typed by the type of
|
||||
// the left operand. When an || expression has no contextual type, the right operand is contextually typed
|
||||
|
||||
Reference in New Issue
Block a user