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’s common for folks to reach for existentials in places we don’t allow them, e.g.,
structContainerView: View {
varchildView: View// error: Protocol ‘View’ can only be used as a generic constraint because it has Self or associated type requirements
}
In some common scenarios, such as stored properties of a struct, cases of an enum, or parameters of a function, the answer is to parameterize the enclosing entity, e.g.,
structContainerView<V: View>: View {
varchildView: V
}
Can we suggest such a transformation as a Fix-It to help the user along?
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: a3dae738ebde8ba9413ccc614390b5bd
Issue Description:
It’s common for folks to reach for existentials in places we don’t allow them, e.g.,
In some common scenarios, such as stored properties of a struct, cases of an enum, or parameters of a function, the answer is to parameterize the enclosing entity, e.g.,
Can we suggest such a transformation as a Fix-It to help the user along?
The text was updated successfully, but these errors were encountered: