Skip to content

Commit 49ee464

Browse files
committed
chore: change error message
1 parent 3dcb46c commit 49ee464

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32513,7 +32513,7 @@ namespace ts {
3251332513
condExpr,
3251432514
/*maybeMissingAwait*/ true,
3251532515
Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap,
32516-
"true", getTypeNameForErrorDisplay(type), "boolean");
32516+
"true", getTypeNameForErrorDisplay(type), "false");
3251732517
}
3251832518

3251932519
function checkTestingKnownTruthyCallableType(condExpr: Expression, body: Statement | Expression, type: Type) {

tests/baselines/reference/truthinessPromiseCoercion.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/compiler/truthinessPromiseCoercion.ts(5,9): error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'boolean' have no overlap.
2-
tests/cases/compiler/truthinessPromiseCoercion.ts(9,5): error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'boolean' have no overlap.
1+
tests/cases/compiler/truthinessPromiseCoercion.ts(5,9): error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'false' have no overlap.
2+
tests/cases/compiler/truthinessPromiseCoercion.ts(9,5): error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'false' have no overlap.
33

44

55
==== tests/cases/compiler/truthinessPromiseCoercion.ts (2 errors) ====
@@ -9,14 +9,14 @@ tests/cases/compiler/truthinessPromiseCoercion.ts(9,5): error TS2367: This condi
99
async function f() {
1010
if (p) {} // err
1111
~
12-
!!! error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'boolean' have no overlap.
12+
!!! error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'false' have no overlap.
1313
!!! related TS2773 tests/cases/compiler/truthinessPromiseCoercion.ts:5:9: Did you forget to use 'await'?
1414
if (!!p) {} // no err
1515
if (p2) {} // no err
1616

1717
p ? f.arguments : f.arguments;
1818
~
19-
!!! error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'boolean' have no overlap.
19+
!!! error TS2367: This condition will always return 'true' since the types 'Promise<number>' and 'false' have no overlap.
2020
!!! related TS2773 tests/cases/compiler/truthinessPromiseCoercion.ts:9:5: Did you forget to use 'await'?
2121
!!p ? f.arguments : f.arguments;
2222
p2 ? f.arguments : f.arguments;

0 commit comments

Comments
 (0)