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
typeStrangeOptional={allow: string[]}|{allow: null};// This should be easy for Flow to understand - it's clearly case [1] and not case [2].({allow: ['com']}: StrangeOptional);
Actual behavior
5: ({allow: ['com']}: StrangeOptional);
^ Could not decide which case to select. Since case 1 [1] may work but if it doesn't case 2 [2] looks promising too. To fix add a type annotation to array literal [3].
References:
3: type EitherOptional = {allow: string[]} | {allow: null};
^ [1]
3: type EitherOptional = {allow: string[]} | {allow: null};
^ [2]
5: ({allow: ['com']}: EitherOptional);
^ [3]
Workaround
// Explicitly telling Flow that this is a string array seems to fix the error.({allow: (['com']: string[])}: StrangeOptional);
Flow version: v0.92.1
Expected behavior
This code should produce no errors:
Actual behavior
Workaround
The text was updated successfully, but these errors were encountered: