Skip to content
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

Make map constructor generic #41008

Closed
wants to merge 1 commit into from
Closed

Make map constructor generic #41008

wants to merge 1 commit into from

Conversation

osdiab
Copy link

@osdiab osdiab commented Oct 9, 2020

Fixes #29786

@DanielRosenwasser 's suggested change to MapConstructor. I shot myself in the foot because of a sneaky implicit any from this!

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'.

@typescript-bot typescript-bot added lib update PR modifies files in the `lib` folder For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 9, 2020
@osdiab
Copy link
Author

osdiab commented Oct 9, 2020

hmm looks like this is actually undoing what #28052 did before. looking into that to understand the context why its this way...

@osdiab
Copy link
Author

osdiab commented Oct 9, 2020

huh. So the goal was to have Map<string> be an error since applying defaults lets you skip the generics, which is also not desirable.

Guess that this is probably a no-go then. Any alternatives @DanielRosenwasser ? for now i guess i'll just deal with it on my project with a lint rule or something.

@andrewbranch
Copy link
Member

Good find @osdiab; yeah, we decided it’s best to leave it as is. Thanks!

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 lib update PR modifies files in the `lib` folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use generic defaults for "empty" constructors of Array, Map, Set
4 participants