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
I would have expected no error. Even though flow doesn't allow union types for computed property keys, at the point where the error occurs, the type of "key" has already been refined to the literal type 'a'.
Actual behavior
I'm getting the error message:
Cannot use key [1] as a computed property. Computed properties may only be primitive literal values, but this one may be either string literal a [2] or string literal a [3]. Can you add a literal type annotation to key [1]? See https://flow.org/en/docs/types/literals/ for more information on literal types.
Flow version: 0.119.0
Expected behavior
Given this code:
I would have expected no error. Even though flow doesn't allow union types for computed property keys, at the point where the error occurs, the type of "key" has already been refined to the literal type 'a'.
Actual behavior
I'm getting the error message:
Cannot use
key
[1] as a computed property. Computed properties may only be primitive literal values, but this one may be either string literala
[2] or string literala
[3]. Can you add a literal type annotation tokey
[1]? See https://flow.org/en/docs/types/literals/ for more information on literal types.The text was updated successfully, but these errors were encountered: