Limit the narrow-to-fresh rule added with boolean literals to only boolean literals#27274
Conversation
|
@typescript-bot test this |
|
Heya @weswigham, I've started to run the extended test suite on this PR at 9f96fe5. You can monitor the build here. It should now contribute to this PR's status checks. |
|
@typescript-bot test this |
|
Heya @weswigham, I've started to run the extended test suite on this PR at 2c56f49. You can monitor the build here. It should now contribute to this PR's status checks. |
|
@RyanCavanaugh as we discussed, rather than removing the freshness propagation through narrowing, I've limited it to just boolean literal assignments. This way strings/numbers/enums/etc continue to behave as they do today, and the propagation exists for booleans so they continue to behave more like one may hope/slightly more like they did before they became freshable. This is, IMO, a pretty good compromise, as it avoids breaking as many people as possible while still fixing the original issue. |
…olean literals (microsoft#27274) * Remove the narrow-to-fresh rule added with boolean literals * Revert "Remove the narrow-to-fresh rule added with boolean literals" This reverts commit 9f96fe5. * Only apply freshness to booleans for now * Add largeish example from issue * Should be AND not OR * Add minor improvements suggested by @ahejelsberg * Reorder conditional a bit
…olean literals (#27274) (#27319) * Remove the narrow-to-fresh rule added with boolean literals * Revert "Remove the narrow-to-fresh rule added with boolean literals" This reverts commit 9f96fe5. * Only apply freshness to booleans for now * Add largeish example from issue * Should be AND not OR * Add minor improvements suggested by @ahejelsberg * Reorder conditional a bit
Fixes #27259