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

New error: type not assignable #37572

Closed
amcasey opened this issue Mar 25, 2020 · 0 comments · Fixed by #37610
Closed

New error: type not assignable #37572

amcasey opened this issue Mar 25, 2020 · 0 comments · Fixed by #37610
Assignees

Comments

@amcasey
Copy link
Member

amcasey commented Mar 25, 2020

https://github.com/jupyter-widgets/ipywidgets/blob/b91a6d9844d1e4e2571f1e7d2fa5416abf468106/packages/base/src/utils.ts#L70

src/utils.ts:70:7 - error TS2322: Type 'awaited V' is not assignable to type 'V'.
  'V' could be instantiated with an arbitrary type which could be unrelated to 'awaited V'.

70       d[keys[i]] = v[i];
         ~~~~~~~~~~

https://github.com/jupyter-widgets/ipywidgets/blob/b91a6d9844d1e4e2571f1e7d2fa5416abf468106/packages/base/src/viewlist.ts#L83

src/viewlist.ts:83:5 - error TS2322: Type 'Promise<(awaited T)[]>' is not assignable to type 'Promise<T[]>'.
  Types of property 'then' are incompatible.
    Type '<TResult1 = (awaited T)[], TResult2 = never>(onfulfilled?: ((value: (awaited T)[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | null | undefined) => Promise<...>' is not assignable to type '<TResult1 = T[], TResult2 = never>(onfulfilled?: ((value: T[]) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined) => Promise<...>'.
      Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible.
        Types of parameters 'value' and 'value' are incompatible.
          Type '(awaited T)[]' is not assignable to type 'T[]'.

83     return Promise.all(this.views);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To repro:

  1. yarn
  2. tsc -b -f packages/base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants