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
it would be helpful, but for now I'm trying to explicitly define the return type annotation for a function to make it work.
However I haven't had luck, and very thankful to @panagosg7 for helping me. @panagosg7 thought there may be a bug when we got as far as in the example below:
Expected behavior
The & operator should successfully join the two types together:
Code:
classA{aMethod(): number{return123}}classBextendsA{bMethod(): number{return123}}declarefunctionChildTracker<TextendsObject>(Base: Class<T>): Class<interface{constructor(): T&{// <--------------- Here's the intersectionfoo(): number;}}>&{bar: string;};constCtor=ChildTracker(B);consts: string=Ctor.barasstringconstb=newCtor();b.aMethod()b.bMethod()b.foo()// <------------------ HERE, .foo is missing
Actual behavior
The second type in the T & {...} seems to be ignored:
Flow version: 0.256
I'm trying to write a type definition for a class-factory mixins. If it could be improved,
it would be helpful, but for now I'm trying to explicitly define the return type annotation for a function to make it work.
However I haven't had luck, and very thankful to @panagosg7 for helping me. @panagosg7 thought there may be a bug when we got as far as in the example below:
Expected behavior
The
&
operator should successfully join the two types together:Code:
Actual behavior
The second type in the
T & {...}
seems to be ignored:Flow Try example 1
If you swap the
{...}
withT
, then the opposite set of properties are ignored:Flow Try example 2
The text was updated successfully, but these errors were encountered: