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 turns out that we cannot make this work as expected (i.e., to be interpreted as a type parameter followed by a parameterized constraint):
In general, an expression of the form T(x) may be a conversion or a function call, both of which may potentially result in a constant result (there are constant conversions, and some built-in functions like len can produce constant results). Thus, when we see [T (x)] we cannot assume a type parameter T followed by a parameterized constraint x without type checking; it could potentially be an array length. Here's a valid example:
package main
typeA [len(*p)]struct{} // array declaration, not a parameterized typevarp*[10]bytefuncmain() {
println(len(A{}))
}
is not recognized correctly:
The text was updated successfully, but these errors were encountered: