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
{{ message }}
Repository navigation
spec: document behavior of type switches containing type parameter cases #51110
I think you may want to specify that a type parameter can be one of the types used in the type(s) of a case, as long as the typeparam satisfies the type of x (based on its bound). You may want to mention explicitly that there may be duplicate cases after instantiation of a generic function/method with type args, and that is fine. So, then, the first case matched is chosen. Duplicate cases are only checked before instantiation.
Activity
ianlancetaylor commentedon Feb 9, 2022
The proposal has this: https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#generic-types-as-type-switch-cases
gopherbot commentedon Feb 9, 2022
Change https://go.dev/cl/384674 mentions this issue:
spec: document behavior of generic type switch casesspec: document behavior of generic type switch cases