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
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 ofif (convertedType != null)
makesconvertedType
aNonNullable<T>
instead ofT
. However sinceNonNullable<T>
is assignable toT
, this fix is satisfactory.