Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

literal array type botch #529

Closed
rogpeppe opened this issue Jan 14, 2010 · 2 comments
Closed

literal array type botch #529

rogpeppe opened this issue Jan 14, 2010 · 2 comments

Comments

@rogpeppe
Copy link
Contributor

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
@rsc
Copy link
Contributor

rsc commented Jan 14, 2010

Comment 1:

Labels changed: added compilerbug.

Owner changed to r...@golang.org.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jan 19, 2010

Comment 2:

This issue was closed by revision ff6e310.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants