Skip to content

refactor: fix pipe type#27952

Merged
dgp1130 merged 1 commit intoangular:mainfrom
dgp1130:type-narrowing
Jun 27, 2024
Merged

refactor: fix pipe type#27952
dgp1130 merged 1 commit intoangular:mainfrom
dgp1130:type-narrowing

Conversation

@dgp1130
Copy link
Copy Markdown
Collaborator

@dgp1130 dgp1130 commented Jun 27, 2024

An explicit cast was removed in fa9bce0#diff-29e41c6172a2d68db9886be9e933ed2b477732095313e104c52a725f887276cf which relies on control flow narrowing in TS 5.5. However, google3 is still on TS 5.4, so we can't fully depend on that feature. Using an intermediate variable makes the type narrowing work correctly even in TS 5.4.

An explicit cast was removed in angular@fa9bce0#diff-29e41c6172a2d68db9886be9e933ed2b477732095313e104c52a725f887276cf which relies on [control flow narrowing](https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/#control-flow-narrowing-for-constant-indexed-accesses) in TS 5.5. However, google3 is still on TS 5.4, so we can't fully depend on that feature. Using an intermediate variable makes the type narrowing work correctly even in TS 5.4.
@dgp1130 dgp1130 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Jun 27, 2024
@dgp1130 dgp1130 requested a review from clydin June 27, 2024 17:52
@clydin clydin added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jun 27, 2024
@dgp1130 dgp1130 merged commit 7982100 into angular:main Jun 27, 2024
@dgp1130 dgp1130 deleted the type-narrowing branch June 27, 2024 18:22
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants