Skip to content

Limit the narrow-to-fresh rule added with boolean literals to only boolean literals - #27274

Merged
Wesley Wigham (weswigham) merged 7 commits into
microsoft:masterfrom
weswigham:remove-narrow-to-fresh-rule
Sep 24, 2018
Merged

Wesley Wigham (weswigham) merged 7 commits into
microsoft:masterfrom
weswigham:remove-narrow-to-fresh-rule

Conversation

@weswigham

Copy link
Copy Markdown
Member

Fixes #27259

@weswigham

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 21, 2018 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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.

@weswigham

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 21, 2018 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@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.

@weswigham Wesley Wigham (weswigham) changed the title Remove the narrow-to-fresh rule added with boolean literals Limit the narrow-to-fresh rule added with boolean literals to only boolean literals Sep 21, 2018
@weswigham

Copy link
Copy Markdown
Member Author

Ryan Cavanaugh (@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.

@weswigham
Wesley Wigham (weswigham) merged commit e1c8dc2 into microsoft:master Sep 24, 2018
@weswigham
Wesley Wigham (weswigham) deleted the remove-narrow-to-fresh-rule branch September 24, 2018 19:37
Wesley Wigham (weswigham) added a commit to weswigham/TypeScript that referenced this pull request Sep 24, 2018
…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
Wesley Wigham (weswigham) added a commit that referenced this pull request Sep 24, 2018
…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
@microsoft 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.

3 participants