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: ParseExprFrom doesn't return errors if there were too many errors #34274

griesemer opened this issue Sep 12, 2019 · 1 comment


Copy link

Here's a simple test case:

package main

import "go/parser"
import "go/token"
import "fmt"

func main() {
	src := "s[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::] +\ns[::]"
	fset := token.NewFileSet()
	_, err := parser.ParseExprFrom(fset, "", src, 0)
	if err != nil {

This should report:

1:3: 2nd index required in 3-index slice (and 10 more errors)

But it doesn't report an error at all.

See also discussion on .

@griesemer griesemer added this to the Go1.14 milestone Sep 12, 2019
Copy link

Change mentions this issue: go/parser: fix ignored errors in ParseExprFrom

@golang golang locked and limited conversation to collaborators Sep 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants