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

mergeDeep does not allow interface types #522

Open
RedHatter opened this issue Feb 16, 2024 · 2 comments
Open

mergeDeep does not allow interface types #522

RedHatter opened this issue Feb 16, 2024 · 2 comments
Assignees
Labels
bug Something isn't working typing Something type related

Comments

@RedHatter
Copy link
Contributor

mergeDeep does not allow interface types. The following

interface Example {
  b: string
}

const a: Example = { b: 'c' }

R.mergeDeep(a, { d: 'e' })

fails with

Argument of type 'Example' is not assignable to parameter of type 'Record<string, unknown>'.
  Index signature for type 'string' is missing in type 'Example'.
@cjquines
Copy link
Collaborator

i think this is microsoft/TypeScript#42825—interfaces are a target for declaration merging and so can't extend Record<string, unknown>

@eranhirsch
Copy link
Collaborator

I can see if we can extend the types to support interfaces, too; regardless, take a look at the following explanation of what kind of challenges mergeDeep introduces (here, about Classes):

#317 (comment)

@eranhirsch eranhirsch self-assigned this Feb 18, 2024
@eranhirsch eranhirsch added the bug Something isn't working label Feb 18, 2024
@eranhirsch eranhirsch added the typing Something type related label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typing Something type related
Projects
None yet
Development

No branches or pull requests

3 participants