@@ -469,6 +469,7 @@ import {
469
469
isAutoAccessorPropertyDeclaration,
470
470
isAwaitExpression,
471
471
isBinaryExpression,
472
+ isBinaryLogicalOperator,
472
473
isBindableObjectDefinePropertyCall,
473
474
isBindableStaticElementAccessExpression,
474
475
isBindableStaticNameExpression,
@@ -913,6 +914,7 @@ import {
913
914
OptionalTypeNode,
914
915
or,
915
916
orderedRemoveItemAt,
917
+ OuterExpression,
916
918
OuterExpressionKinds,
917
919
ParameterDeclaration,
918
920
parameterIsThisKeyword,
@@ -928,6 +930,7 @@ import {
928
930
PatternAmbientModule,
929
931
PlusToken,
930
932
PostfixUnaryExpression,
933
+ PredicateSemantics,
931
934
PrefixUnaryExpression,
932
935
PrivateIdentifier,
933
936
Program,
@@ -1114,9 +1117,6 @@ import {
1114
1117
WideningContext,
1115
1118
WithStatement,
1116
1119
YieldExpression,
1117
- PredicateSemantics,
1118
- OuterExpression,
1119
- isBinaryLogicalOperator,
1120
1120
} from "./_namespaces/ts.js";
1121
1121
import * as moduleSpecifiers from "./_namespaces/ts.moduleSpecifiers.js";
1122
1122
import * as performance from "./_namespaces/ts.performance.js";
@@ -44145,13 +44145,16 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
44145
44145
function checkTruthinessOfType(type: Type, node: Node) {
44146
44146
if (type.flags & TypeFlags.Void) {
44147
44147
error(node, Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness);
44148
- } else {
44148
+ }
44149
+ else {
44149
44150
const semantics = getSyntacticTruthySemantics(node);
44150
44151
if (semantics !== PredicateSemantics.Sometimes) {
44151
- error(node,
44152
+ error(
44153
+ node,
44152
44154
semantics === PredicateSemantics.Always ?
44153
- Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else :
44154
- Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else)
44155
+ Diagnostics.This_expression_is_always_truthy_Did_you_mean_to_test_something_else :
44156
+ Diagnostics.This_expression_is_always_falsy_Did_you_mean_to_test_something_else,
44157
+ );
44155
44158
}
44156
44159
}
44157
44160
0 commit comments