Skip to content

Conversation

@JaredNeil
Copy link
Contributor

Fixes #37779

@msftclas
Copy link

msftclas commented Apr 24, 2020

CLA assistant check
All CLA requirements met.

@sandersn sandersn added the For Backlog Bug PRs that fix a backlog bug label May 5, 2020
@sandersn sandersn self-assigned this May 5, 2020
@JaredNeil
Copy link
Contributor Author

Anything needed to get this merged?

@sandersn
Copy link
Member

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 17, 2020

Heya @sandersn, I've started to run the extended test suite on this PR at 1754492. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 17, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 17, 2020

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

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@sandersn
Copy link
Member

Looks like VS Code and Puppeteer fail to compile with this change.

@JaredNeil
Copy link
Contributor Author

Is this possibly because this PR is now a couple months old? Should I try to rebase my changes on master first? If that's not likely to be the issue, are there instructions for running those tests myself to reproduce the issue?

@sandersn
Copy link
Member

For VS Code, I just followed their instructions to clone and get started developing. Then I opened the file with the error. For puppeteer, you can probably skip that by running gulp runtests --ru=user --t=puppeteer, then opening the puppeteer repo at tests/cases/user/puppeteer/puppeteer/

@sandersn
Copy link
Member

sandersn commented Jun 17, 2020

Puppeteer's error is of the form

const m = new Map();
const v = m.get('k')
v.push // 'push' not found on 'unknown'

Previously m: Map<any, any> and v: any, but now m: Map<unknown, unknown> and v: unknown. Overload resolution chooses a stricter overload now.

Edit: VS Code has the same problem as puppeteer.

@sandersn
Copy link
Member

It could be that lib.es2015.iterable.d.ts is loaded before lib.es2015.collection.d.ts, so the nullary overload matches first. You can try adding new (): Map<any,any> to es2015.iterable.d.ts as the first entry too.

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.

Need a test to show that

const m = new Map()

still has m: Map<any, any>

@sandersn
Copy link
Member

@JaredNeil did you want to keep working on this?

@sandersn
Copy link
Member

This PR hasn't seen any activity for quite a while, so I'm going to close it to keep the number of open PRs manageable. Feel free to open a fresh PR or continue the discussion here.

@sandersn sandersn closed this Feb 16, 2021
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type error for new Map from undefined Iterable

4 participants