Skip to content

mark Intl.LocalesArgument as readonly - #50135

Merged
Nathan Shively-Sanders (sandersn) merged 1 commit into
microsoft:mainfrom
k-yle:readonly-intlargument
Aug 18, 2022
Merged

mark Intl.LocalesArgument as readonly#50135
Nathan Shively-Sanders (sandersn) merged 1 commit into
microsoft:mainfrom
k-yle:readonly-intlargument

Conversation

@k-yle

Copy link
Copy Markdown
Contributor

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 (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 2, 2022
@typescript-bot

Copy link
Copy Markdown
Contributor

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

@ProKashif Kashif Ahmed (ProKashif) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@sandersn

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@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

TypeScript Bot (typescript-bot) commented Aug 17, 2022

Copy link
Copy Markdown
Contributor

Heya Nathan Shively-Sanders (@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
Copy Markdown
Member

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.

@typescript-bot

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn) Here are the results of running the user test suite comparing main and refs/pull/50135/merge:

Everything looks good!

@sandersn
Nathan Shively-Sanders (sandersn) merged commit ea36fb3 into microsoft:main Aug 18, 2022
@k-yle
Kyℓe Hensel (k-yle) deleted the readonly-intlargument branch August 18, 2022 21:52
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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