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
First of - thanks @lttb so much for this library! It's a huge help!
I'm running into the following issue best demonstrated by a small repro:
typeGetUserInfoArgs={|user_id: number|};typeGetUserInfo=(GetUserInfoArgs)=>{first_name: string,last_name: string};typeDerivedArg=$ElementType<Arguments<GetUserInfo>,0>;// should be equivalent to `GetUserInfoArgs`?/** * Using Arguments<GetUserInfo>: * - `a` fails type checking as expected * - `b` does not fail type checking :( */consta: DerivedArg={foo: 'bar'};constb: {| ...DerivedArg|}={foo: 'bar'};/** * Without using Arguments<GetUserInfo>: * - `c` fails type checking as expected * - `d` fails type checking as expected */constc: GetUserInfoArgs={foo: 'bar'};constd: {| ...GetUserInfoArgs|}={foo: 'bar'};
typeGetUserInfoArgs={|user_id: number|};typeGetUserInfo=(GetUserInfoArgs)=>{first_name: string,last_name: string};// Similar to how `Arguments` works - produces the same errortypeExtractArg=<A,F: (A)=>any>(F)=>A&AtypeDerivedArg=$Call<ExtractArg,GetUserInfo>/** * Using Arguments<GetUserInfo>: * - `a` fails type checking as expected * - `b` does not fail type checking :( */const a: DerivedArg={foo: 'bar'};constb: {| ...DerivedArg|}={foo: 'bar'};/** * Without using Arguments<GetUserInfo>: * - `c` fails type checking as expected * - `d` fails type checking as expected */constc: GetUserInfoArgs={foo: 'bar'};constd: {| ...GetUserInfoArgs|}={foo: 'bar'};
First of - thanks @lttb so much for this library! It's a huge help!
I'm running into the following issue best demonstrated by a small repro:
Link to full repro in tryflow
Perhaps I'm missing something, but I'd expect flow to complain about
b
?Thanks!
The text was updated successfully, but these errors were encountered: