We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a code that give me an error only in VIM. If I try the same code in VisualStudio or Typescript Playground there error disappear.
The error is:
Argument of type 'ElementShape<E>' is not assignable to parameter of type 'Partial<ElementShape<E>>'
This is the code:
const element_def = { element1: { name: { } }, element2: { age: { } } } as const; const element_def_optional = { element1: { title: { } }, element2: { price: { } } } as const; export type ElementName = 'element1' | 'element2'; export type ElementShape<A extends ElementName> = { [k in keyof typeof element_def[A]]: string } & { [k in keyof typeof element_def_optional[A]]?: string }; function process_partial<E extends ElementName>(name: E, partial:Partial<ElementShape<E>>){ console.log(name, partial); } export function process_shape<E extends ElementName>(name: E, shape:ElementShape<E>):void{ process_partial(name, shape); // ~~~ Error: Argument of type 'ElementShape<E>' is not assignable to parameter of type 'Partial<ElementShape<E>>' }
Playground Link
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a code that give me an error only in VIM. If I try the same code in VisualStudio or Typescript Playground there error disappear.
The error is:
This is the code:
Playground Link
The text was updated successfully, but these errors were encountered: