-
Notifications
You must be signed in to change notification settings - Fork 12.8k
3.9 regression: bogus property-will-be-overwritten-by-spread errors #36779
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
Comments
To clarify, this isn't a 3.8 RC issue, right? |
Yep, that's why I put '3.9' in the title. (The code is only in master, not in 3.8, since I merged it after the release branch got merged from master) |
Our code base got hit by this as well when trying out the latest |
Trying to do this check in getSpreadType just doesn't have enough information, so I moved it to checkObjectLiteral, which is a better place for issuing errors anyway. Unfortunately, the approach is kind of expensive in that it 1. creates a new map for each property and 2. iterates over all properties of the spread type, even if it's a union. I have some ideas to improve (1) that might work out. I'm not sure how bad (2) is since we're going to iterate over all properties of all constituents of a union. Fixes #36779
* More precise property-overwritten-by-spread errors Trying to do this check in getSpreadType just doesn't have enough information, so I moved it to checkObjectLiteral, which is a better place for issuing errors anyway. Unfortunately, the approach is kind of expensive in that it 1. creates a new map for each property and 2. iterates over all properties of the spread type, even if it's a union. I have some ideas to improve (1) that might work out. I'm not sure how bad (2) is since we're going to iterate over all properties of all constituents of a union. Fixes #36779 * another test and rename
I think this might still be an issue in JSX?
|
I'm also getting a few of those since updating to 3.9-beta. Seems related to type Props = {
someProp?: any;
};
function Component(props: Props) {
return <View {...props} someProp={{}} />
} Using another type instead of |
@janicduplessis I'm not sure if this will be on their radar, given this issue is closed. Perhaps open a new issue? FWIW I find that |
@janicduplessis please do; I tried a simple repro like yours but couldn't get it to work since I don't have I just merged a fix from a community member that might help, but it didn't make the beta. Can you try |
@sandersn Here's a small reproduction repo https://github.com/mvestergaard/ts-36779-repro using |
I also have this, but I don't see store getting overwritten... const store = provideClearingStore(ctx, nuxtInject);
const apolloClient = provideVueApolloComposable(ctx);
(ctx as any).store = store; // delete vuex
provideGlobalsForCypress({ store, apolloClient, ...ctx });
return { store, apolloClient }; Error: 13:32 'store' is specified more than once, so this usage will be overwritten.
11 | const apolloClient = provideVueApolloComposable(ctx);
12 | (ctx as any).store = store; // del files.ete vuex
> 13 | provideGlobalsForCypress({ store,apolloClient, ...ctx });
| ^
14 | return { store, apolloClient }; provide-globals-once.ts(13,32):
15 | }; his usage will be overwritten.
16 | }; |
AH, I get it, it's also in my |
Expected behavior:
No error;
command
is not necessarily overwritten, for example whenb=false
.Actual behavior:
Error: 'command' is specified more than once, so this usage will be overwritten.
User tests vscode and office-fabric-ui have failures because of this.
The text was updated successfully, but these errors were encountered: