You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/a.ts:24:7 - error TS2322: Type 'C' is not assignable to type 'ClassComponent<any>'.
Types of property 'view' are incompatible.
Type '(v: Vnode<Attrs, Lifecycle<Attrs, Lifecycle<Attrs, State>>>) => number' is not assignable to type '(vnode: Vnode<any, ClassComponent<any>>) => number'.
Types of parameters 'v' and 'vnode' are incompatible.
Type 'Vnode<any, ClassComponent<any>>' is not assignable to type 'Vnode<Attrs, Lifecycle<Attrs, Lifecycle<Attrs, State>>>'.
Type 'ClassComponent<any>' is not assignable to type 'Lifecycle<Attrs, Lifecycle<Attrs, State>>'.
Types of property 'oninit' are incompatible.
Type '((vnode: Vnode<any, ClassComponent<any>>) => number) | undefined' is not assignable to type '((vnode: Vnode<Attrs, Lifecycle<Attrs, State>>) => number) | undefined'.
Type '(vnode: Vnode<any, ClassComponent<any>>) => number' is not assignable to type '(vnode: Vnode<Attrs, Lifecycle<Attrs, State>>) => number'.
Types of parameters 'vnode' and 'vnode' are incompatible.
Type 'Vnode<Attrs, Lifecycle<Attrs, State>>' is not assignable to type 'Vnode<any, ClassComponent<any>>'.
Type 'Lifecycle<Attrs, State>' is not assignable to type 'ClassComponent<any>'.
Property 'view' is missing in type 'Lifecycle<Attrs, State>'.
24 const test8: ClassComponent<any> = new C();
~~~~~
Found 1 error.
Found in mithril on DefinitelyTyped.
The text was updated successfully, but these errors were encountered:
If you rename the Attrs interface to MyAttrs or the like, the error becomes a little easier to process:
!!! error TS2322: Type 'C' is not assignable to type 'ClassComponent<any>'.
!!! error TS2322: Types of property 'view' are incompatible.
!!! error TS2322: Type '(v: Vnode<MyAttrs, Lifecycle<MyAttrs, Lifecycle<Attrs, State>>>) => number' is not assignable to type '(vnode: Vnode<any, ClassComponent<any>>) => number'.
!!! error TS2322: Types of parameters 'v' and 'vnode' are incompatible.
!!! error TS2322: Type 'Vnode<any, ClassComponent<any>>' is not assignable to type 'Vnode<MyAttrs, Lifecycle<MyAttrs, Lifecycle<Attrs, State>>>'.
!!! error TS2322: Type 'ClassComponent<any>' is not assignable to type 'Lifecycle<MyAttrs, Lifecycle<Attrs, State>>'.
!!! error TS2322: Types of property 'oninit' are incompatible.
!!! error TS2322: Type '(vnode: Vnode<any, ClassComponent<any>>) => number' is not assignable to type '(vnode: Vnode<MyAttrs, Lifecycle<Attrs, State>>) => number'.
!!! error TS2322: Types of parameters 'vnode' and 'vnode' are incompatible.
!!! error TS2322: Type 'Vnode<MyAttrs, Lifecycle<Attrs, State>>' is not assignable to type 'Vnode<any, ClassComponent<any>>'.
!!! error TS2322: Type 'Lifecycle<Attrs, State>' is not assignable to type 'ClassComponent<any>'.
!!! error TS2322: Property 'view' is missing in type 'Lifecycle<Attrs, State>'.
The signature type is reported as (v: Vnode<MyAttrs, Lifecycle<MyAttrs, Lifecycle<Attrs, State>>>) => number but should be closer to (v: Vnode<MyAttrs, Lifecycle<MyAttrs, (circular any placeholder)>>) => number. Seems like wee're defaulting to a constraint somewhere where we used to default to any instead. (note the uninstantiated Attrs and State params that have leaked!)
TypeScript Version: 3.2.0-dev.20181106
Code
Expected behavior:
No error, as in
[email protected]
.Actual behavior:
Found in
mithril
on DefinitelyTyped.The text was updated successfully, but these errors were encountered: