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
To be pedantic, T is an arbitrary subtype of Un, which includes classes that have an x: string or y: string property (try flow), so the provided code shouldn't typecheck.
However, there is still a problem here, because it also happens without generics (try flow).
This is indeed just a special case of "the spread operator doesn't work so well right now", but I felt it bore mention just to make sure it didn't get missed.
I would expect flow to say, "Well, T is a plain object, and you spread T into an object and returned it, so it must be a T. All good!"
Instead I get
object literal. Could not decide which case to select
.The text was updated successfully, but these errors were encountered: