Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #25245

@s-ve
Copy link

s-ve commented Jun 27, 2018

@DanielRosenwasser

The types of these values indicates that this condition will always be...

Shoudn't it be "indicate" ? (without the "s")

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indicate*

@DanielRosenwasser
Copy link
Member Author

Thanks for indicating that typo.

@DanielRosenwasser DanielRosenwasser merged commit 950593b into master Jun 28, 2018
@DanielRosenwasser DanielRosenwasser deleted the betterAlwaysTrueFalseErrors branch June 28, 2018 04:57
Copy link
Contributor

@mihailik mihailik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Human friendlier messages, please.

"category": "Error",
"code": 2366
},
"The types of these values indicate that this condition will always be '{0}'.": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If those are statically known primitive types, can we include actual values in error message? Like:

"These values are known to be '{0}' and '{1}', rendering this condition always '{2}'."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out #25311

if (x == 1) {
~~~~~~
!!! error TS2365: Operator '==' cannot be applied to types '0' and '1'.
!!! error TS2367: The types of these values indicate that this condition will always be 'false'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values are known to be '0' and '1', rendering this condition always 'false'.
^^^^ how much smoother to comprehend and fix!

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants