Skip to content

property-will-be-overwritten-by-spread error is issued multiple times #37688

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

Open
sandersn opened this issue Mar 30, 2020 · 0 comments
Open

property-will-be-overwritten-by-spread error is issued multiple times #37688

sandersn opened this issue Mar 30, 2020 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@sandersn
Copy link
Member

interface XX {
    paddingLeft: string;
}

declare var x: XX
declare function clonElement<Q>(props?: object): void;
clonElement({ style: {
    paddingLeft: 'hi',
    ...x
}})

Expected behavior:
One error on paddingLeft: 'hi': 'paddingLeft' is specified more than once, so this usage will be overwritten.

Actual behavior:
Two errors.

Our old commit of ant-design issues this error 8 times. This is probably just a result of (1) not caching the type from checking object literals (2) checking object literals multiple times during resolveCall.

Not high priority -- I'm not sure it's observable from VS Code -- and probably expensive to fix, depending on whether the reason that we decided to not cache object literal types is still true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant