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

chore: old type fix in libtypes #2217

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Conversation

tssweeney
Copy link
Collaborator

Running yarn tsc with some node / ts versions causes the following error. This has been happening to me for almost a year now 😮‍💨 ... anyway, this is because the above check of if (convertedType != null) makes convertedType a NonNullable<T> instead of T. However since NonNullable<T> is assignable to T, this fix is satisfactory.

src/components/Panel2/panellib/libtypes.ts:84:11 - error TS2322: Type 'TypedInputHandlerStack<NonNullable<T>, TypedInputHandler<NonNullable<T>>, TypedInputConverter<NonNullable<T>>>[]' is not assignable to type 'TypedInputHandlerStack<T, H, C>[]'.
  Type 'TypedInputHandlerStack<NonNullable<T>, TypedInputHandler<NonNullable<T>>, TypedInputConverter<NonNullable<T>>>' is not assignable to type 'TypedInputHandlerStack<T, H, C>'.
    Type 'TypedInputHandler<NonNullable<T>>' is not assignable to type 'TypedInputHandlerStack<T, H, C>'.
      Type 'TypedInputHandler<NonNullable<T>>' is not assignable to type 'C & { inputType: T; child: TypedInputHandlerStack<T, H, C>; }'.
        Type 'TypedInputHandler<NonNullable<T>>' is not assignable to type 'C'.
          'C' could be instantiated with an arbitrary type which could be unrelated to 'TypedInputHandler<NonNullable<T>>'.

84       let children: Array<TypedInputHandlerStack<T, H, C>> =
             ~~~~~~~~

src/components/Panel2/panellib/libtypes.ts:87:11 - error TS2345: Argument of type 'H[]' is not assignable to parameter of type 'TypedInputHandler<NonNullable<T>>[]'.
  Type 'H' is not assignable to type 'TypedInputHandler<NonNullable<T>>'.
    Type 'TypedInputHandler<T>' is not assignable to type 'TypedInputHandler<NonNullable<T>>'.
      Types of property 'inputType' are incompatible.
        Type 'T' is not assignable to type 'NonNullable<T>'.

87           handlers,
             ~~~~~~~~


Found 2 errors in the same file, starting at: src/components/Panel2/panellib/libtypes.ts:84

@tssweeney tssweeney requested a review from a team as a code owner August 26, 2024 22:49
@circle-job-mirror
Copy link

circle-job-mirror bot commented Aug 26, 2024

@tssweeney tssweeney merged commit 128caca into master Aug 27, 2024
26 checks passed
@tssweeney tssweeney deleted the tim/fix_typing_in_libtypes branch August 27, 2024 22:29
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants