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

feat(16755): interface stubbing for anonymous implementations #44781

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #16755

This PR fixes the second part of the requested changes, the first part was resolved in the #44576

Ideally, this would also be able to stub in the anonymous implementation of a function argument, but that would require inference of the interface being targeted for implementation:

function example(arg: Foo): void { }
example({})
example({
  field: string,
  func(): void {
    throw new Error('not yet implemented')
  },
}

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.

Looks good, just a couple of minor refactors to match the other ones already there.

src/services/codefixes/fixAddMissingMember.ts Outdated Show resolved Hide resolved
src/services/codefixes/fixAddMissingMember.ts Outdated Show resolved Hide resolved
@sandersn sandersn merged commit 69b5b2b into microsoft:main Aug 20, 2021
BobobUnicorn pushed a commit to BobobUnicorn/TypeScript that referenced this pull request Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

interface stubbing for anonymous implementations
3 participants