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 an invalid compiler error:
/Users/rog/src/tst.go:7: fatal error: method mismatch: T for *T
It works fine if the x declaration is changed to:
x := T([]int{23,4,6,7})
package main
type T []int
func (t T) foo() { }
func main() {
x := T{23,4,6,7}
x.foo()
}
darwin 386
ffbf0900a20e+ tip
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: