Skip to content

fix(es5): type narrowing of return type #56866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

imwh0im
Copy link

@imwh0im imwh0im commented Dec 24, 2023

Fixes #56865

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 24, 2023
@MartinJohns
Copy link
Contributor

A change like this was previously rejected: #36401 (comment)

@@ -780,7 +780,7 @@ interface Date {
/** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
getUTCDate(): number;
/** Gets the day of the week, using local time. */
getDay(): number;
getDay(): 0 | 1 | 2 | 3 | 4 | 5 | 6;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is incorrect. It can also be NaN (like every other method).

Copy link
Contributor

Choose a reason for hiding this comment

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

Related: #15135

@imwh0im imwh0im closed this Dec 28, 2023
@imwh0im imwh0im deleted the fix/get-day-type branch July 28, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

type narrowing for getday
4 participants