We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There appears to be a new panic in go/parser due to code merged from dev.typeparams related to parsing instances (parseIndexOrSliceOrInstance):
parseIndexOrSliceOrInstance
Simple repro:
package p func _() { var items []bool items[] = false }
This is invalid syntax, but of course should not cause a panic. Instead, we get:
panic: go/parser internal error: identifier items already declared or resolved [recovered] panic: go/parser internal error: identifier items already declared or resolved [recovered] panic: go/parser internal error: identifier items already declared or resolved goroutine 6 [running]: testing.tRunner.func1.2(0x556ea0, 0xc000068ed0) /usr/local/google/home/rfindley/src/go/src/testing/testing.go:1144 +0x34b testing.tRunner.func1(0xc000001380) /usr/local/google/home/rfindley/src/go/src/testing/testing.go:1147 +0x4b6 panic(0x556ea0, 0xc000068ed0) /usr/local/google/home/rfindley/src/go/src/runtime/panic.go:972 +0x1d4 go/parser.ParseFile.func1(0xc00008df40, 0xc000001680, 0xc00008df48) /usr/local/google/home/rfindley/src/go/src/go/parser/interface.go:97 +0x1e8 panic(0x556ea0, 0xc000068ed0) /usr/local/google/home/rfindley/src/go/src/runtime/panic.go:972 +0x1d4 go/parser.assert(...) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:461 go/parser.(*parser).tryResolve(0xc000001680, 0x5be898, 0xc000072140, 0x1) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:184 +0x2ec go/parser.(*parser).resolve(...) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:206 go/parser.(*parser).parseLhsList(0xc000001680, 0xc00008d988, 0x2, 0x2) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:613 +0xcd go/parser.(*parser).parseSimpleStmt(0xc000001680, 0x1, 0x0, 0x0, 0xc000072100) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:1958 +0x7b go/parser.(*parser).parseStmt(0xc000001680, 0x0, 0x0) /usr/local/google/home/rfindley/src/go/src/go/parser/parser.go:2513 +0x9a
Thanks to @stamblerre for reporting.
CC @griesemer
The text was updated successfully, but these errors were encountered:
Change https://golang.org/cl/295151 mentions this issue: go/parser: return ast.BadExpr for missing index operands
go/parser: return ast.BadExpr for missing index operands
Sorry, something went wrong.
1126bbb
No branches or pull requests
There appears to be a new panic in go/parser due to code merged from dev.typeparams related to parsing instances (
parseIndexOrSliceOrInstance
):Simple repro:
This is invalid syntax, but of course should not cause a panic. Instead, we get:
Thanks to @stamblerre for reporting.
CC @griesemer
The text was updated successfully, but these errors were encountered: