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
The following program gives a syntax error. Using the round bracket syntax for instantiating the function works as expected. It appears that the parser doesn't allow the new square bracket syntax with multiple type parameters.
package main
import "fmt"
func main() {
fmt.Println(double[int, int](24, 56))
}
func double[type T, S](x S, y T) (S, T) {
return x, y
}
The text was updated successfully, but these errors were encountered:
The parser currently decides that it will use square brackets based on the first parameterized declaration. If the first use of square brackets it is a use rather than a declaration, it doesn't always understand it. This is a temporary hack until we settle on a syntax.
commit 722af87
The following program gives a syntax error. Using the round bracket syntax for instantiating the function works as expected. It appears that the parser doesn't allow the new square bracket syntax with multiple type parameters.
The text was updated successfully, but these errors were encountered: