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

go/parser: accept x[::] and others #5827

Closed
rsc opened this issue Jul 2, 2013 · 2 comments
Closed

go/parser: accept x[::] and others #5827

rsc opened this issue Jul 2, 2013 · 2 comments
Assignees
Milestone

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Jul 2, 2013

For the same reason that go/syntax does not reject `make()` or `x, y, z = <-c`, I do
not believe it should reject missing indexes in 3-index slice operations. It's generally
more useful to be able to parse and understand what's there and reject the missing
indexes during type checking.

g% gofmt -w test/slice3err.go
test/slice3err.go:20:14: 2nd and 3rd index must be present full slice expression
test/slice3err.go:21:15: 2nd and 3rd index must be present full slice expression
test/slice3err.go:22:15: 2nd and 3rd index must be present full slice expression
test/slice3err.go:23:16: 2nd and 3rd index must be present full slice expression
test/slice3err.go:24:15: 2nd and 3rd index must be present full slice expression
test/slice3err.go:25:16: 2nd and 3rd index must be present full slice expression
test/slice3err.go:33:14: 2nd and 3rd index must be present full slice expression
test/slice3err.go:34:15: 2nd and 3rd index must be present full slice expression
test/slice3err.go:35:15: 2nd and 3rd index must be present full slice expression
test/slice3err.go:36:16: 2nd and 3rd index must be present full slice expression
test/slice3err.go:37:15: 2nd and 3rd index must be present full slice expression
g%
@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 2, 2013

Comment 1:

Owner changed to @griesemer.

@griesemer
Copy link
Contributor

@griesemer griesemer commented Jul 3, 2013

Comment 3:

This issue was closed by revision dd1fe82.

Status changed to Fixed.

@rsc rsc added fixed labels Jul 3, 2013
@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.