Skip to content

mark Intl.LocalesArgument as readonly #50135

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

Merged
merged 1 commit into from
Aug 18, 2022
Merged

mark Intl.LocalesArgument as readonly #50135

merged 1 commit into from
Aug 18, 2022

Conversation

k-yle
Copy link
Contributor

@k-yle k-yle commented Aug 2, 2022

This PR changes Intl.LocalesArgument to accept a readonly array, since typescript currently considers this to be unacceptable code:

new Date().toLocaleDateString(navigator.languages)
Argument of type 'readonly string[]' is not assignable to parameter of type 'string | string[] | undefined'.
  The type 'readonly string[]' is 'readonly' and cannot be assigned to the mutable type 'string[]'.(2345)

(playground link)

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 2, 2022
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copy link

@ProKashif ProKashif left a comment

Choose a reason for hiding this comment

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

LGTM

@sandersn
Copy link
Member

@typescript-bot run dt
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 17, 2022

Heya @sandersn, I've started to run the diff-based user code test suite on this PR at f207e30. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 17, 2022

Heya @sandersn, I've started to run the parallelized Definitely Typed test suite on this PR at f207e30. You can monitor the build here.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

This sounds like a good idea, but let's make sure that it doesn't break any user code that we know about.

@sandersn sandersn self-assigned this Aug 17, 2022
@typescript-bot
Copy link
Collaborator

@sandersn Here are the results of running the user test suite comparing main and refs/pull/50135/merge:

Everything looks good!

@sandersn sandersn merged commit ea36fb3 into microsoft:main Aug 18, 2022
@k-yle k-yle deleted the readonly-intlargument branch August 18, 2022 21:52
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
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants