-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/gofmt: gofmt -r "interface{} -> Type" = error #4406
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
Labels
Comments
known good revision 52a50509b83b after bisect, this is the first commit that breaks gofmt -r 'interface{} -> MyType' (endless recursion) changeset: 7680:eb24c3668d9f user: Robert Griesemer <gri@golang.org> date: Mon Mar 07 11:01:23 2011 -0800 summary: go/ast, go/parser: populate identifier scopes at parse time Labels changed: added priority-later, removed priority-triage. Status changed to Accepted. |
after more bisect, this commit is the first for go/parser.ParseExpr to reject "interface{}". changeset: 9441:5a5e15e082c4 user: Robert Griesemer <gri@golang.org> date: Wed Aug 17 10:27:32 2011 -0700 summary: go/parser: do not accept type literals where not permitted in general and sure enough, rev 9440:e7bbaa4eae1f could still properly rewrite pkg/container/vector/vector.go. well, this means go/parser.ParseExpr is working as intended. leaving for gri to decide how to do with "gofmt -r 'interface{} -> MyType'". IMO, it should be supported, as "gofmt -r 'int -> int8'" is supported, and rewriting interface{} to some specific type is generally useful for specializing a generic (interface{}) data type implementation. |
Owner changed to @griesemer. |
This issue was closed by revision 2ba6ecb. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by fabrizio.milo:
The text was updated successfully, but these errors were encountered: